/* Sticky footer */
html {
    height: 100%;
}

body {
    min-height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
}

.navbar,
.blog-hero {
    flex-shrink: 0;
}

.blog-content {
    flex: 1 0 auto !important;
    padding-bottom: 80px;
}

footer {
    flex-shrink: 0 !important;
    margin-top: auto !important;
}

.blog-hero {
    padding-top: 140px;
    padding-bottom: 60px;
    background: white;
    text-align: center;
}

.blog-hero h1 {
    font-size: 2.75rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
}

.blog-hero p {
    font-size: 1.125rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto;
}

.blog-content {
    padding: 60px 0 100px;
    background: var(--bg-body);
}

.posts-grid {
    display: grid;
    gap: 2rem;
}

.post-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: var(--shadow-sm);
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

.post-content {
    padding: 2rem;
}

.post-date {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.post-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.post-title a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

.post-title a:hover {
    color: var(--accent);
}

.post-excerpt {
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.read-more:hover {
    gap: 0.75rem;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 4rem;
}

.pagination a,
.pagination span {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    transition: all 0.2s;
}

.pagination a:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.pagination span.current {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.no-posts {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.no-posts h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.post-hero {
    padding-top: 140px;
    padding-bottom: 40px;
    background: white;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.breadcrumb a {
    color: var(--accent);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.post-header h1 {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.post-meta {
    display: flex;
    gap: 1.5rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.post-article {
    padding: 60px 0 100px;
    background: var(--bg-body);
}

.post-container {
    max-width: 800px;
    margin: 0 auto;
}

.post-body {
    background: white;
    padding: 3rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.post-body h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin: 2rem 0 1rem;
}

.post-body h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary);
    margin: 1.5rem 0 1rem;
}

.post-body p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
    color: var(--text-main);
}

.post-body ul,
.post-body ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.post-body li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.post-body a {
    color: var(--accent);
    text-decoration: underline;
}

.post-body a:hover {
    color: var(--accent-hover);
}

.post-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: 2rem 0;
}

.post-body blockquote {
    border-left: 4px solid var(--accent);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--text-muted);
}

.back-to-blog {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
    padding: 0.75rem 1.5rem;
    background: white;
    color: var(--primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

.back-to-blog:hover {
    background: #f8fafc;
    border-color: var(--accent);
}

.admin-header {
    background: var(--primary);
    color: white;
    padding: 1.5rem 0;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.admin-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h1 {
    font-size: 1.5rem;
    margin: 0;
    color: white;
}

.admin-nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.admin-nav a {
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.admin-nav a:hover {
    color: white;
}

.admin-nav a.active {
    color: var(--accent);
}

.admin-content {
    padding: 2rem 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.stat-card h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stat-card .number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent);
}

.posts-table {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.posts-table-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.posts-table-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--primary);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: #f8fafc;
    padding: 1rem 1.5rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-main);
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
}

tr:hover {
    background: #f8fafc;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-published {
    background: #d1fae5;
    color: #065f46;
}

.status-draft {
    background: #fee;
    color: #991b1b;
}

.btn-action {
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s;
    display: inline-block;
    margin-right: 0.5rem;
}

.btn-edit {
    background: var(--accent);
    color: white;
}

.btn-edit:hover {
    background: var(--accent-hover);
}

.btn-delete {
    background: #dc2626;
    color: white;
}

.btn-delete:hover {
    background: #b91c1c;
}

.btn-new {
    background: var(--accent);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-block;
}

.btn-new:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.form-container {
    background: white;
    padding: 2.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    max-width: 900px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-main);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.btn-submit {
    padding: 0.875rem 2rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.btn-submit:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-draft {
    padding: 0.875rem 2rem;
    background: white;
    color: var(--primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.btn-draft:hover {
    background: #f8fafc;
    border-color: var(--primary);
}

.success {
    background: #d1fae5;
    color: #065f46;
    padding: 0.75rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    border: 1px solid #a7f3d0;
}

.error {
    background: #fee;
    color: #c00;
    padding: 0.75rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    border: 1px solid #fcc;
}

.login-container {
    background: white;
    padding: 3rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--border);
}

.login-container h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--primary);
    font-size: 1.75rem;
}

.confirm-container {
    background: white;
    padding: 3rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 500px;
    border: 1px solid var(--border);
    text-align: center;
}

.confirm-container h1 {
    margin-bottom: 1.5rem;
    color: #dc2626;
    font-size: 1.75rem;
}

.confirm-container p {
    margin-bottom: 2rem;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.post-title-text {
    font-weight: 600;
    color: var(--primary);
}

.btn-cancel {
    padding: 0.875rem 2rem;
    background: white;
    color: var(--primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    display: inline-block;
}

.btn-cancel:hover {
    background: #f8fafc;
}

.error-container {
    text-align: center;
    padding: 3rem;
}

.error-container h1 {
    font-size: 8rem;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 1rem;
    line-height: 1;
}

.error-container h2 {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.error-container p {
    color: var(--text-muted);
    font-size: 1.125rem;
    margin-bottom: 2rem;
}

.btn-home {
    display: inline-block;
    padding: 0.875rem 2rem;
    background: var(--accent);
    color: white;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-home:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

body.login-page,
body.delete-page,
body.error-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-body);
}

body.admin-page {
    background: var(--bg-body);
}

@media (max-width: 768px) {
    .post-header h1 {
        font-size: 2rem;
    }
    .post-body {
        padding: 2rem 1.5rem;
    }
    .blog-hero h1 {
        font-size: 2rem;
    }
    .form-actions {
        flex-direction: column;
    }
}
