/* ============================================
   FAROUK BLOG — Design System & Styles
   Light theme, light-blue accents, clean design
   ============================================ */

/* === CSS Variables === */
:root {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-glass: #f8fafc;
    --border-color: #e2e8f0;
    --border-hover: #b3e5fc;

    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --accent: #039BE5;
    --accent-hover: #0288D1;
    --accent-light: #E1F5FE;
    --accent-mid: #4FC3F7;
    --accent-dark: #0277BD;

    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.10);
    --shadow-glow: 0 0 20px rgba(3, 155, 229, 0.08);

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Reset & Base === */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
}

#app {
    position: relative;
    z-index: 1;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition-fast);
}

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

img {
    max-width: 100%;
    height: auto;
}

/* === Scrollbar === */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* === Typography === */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

/* === Layout === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-narrow {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px;
}

/* === Navbar === */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.90);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
}

.navbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.navbar-brand {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--accent);
    cursor: pointer;
    transition: var(--transition);
}

.navbar-brand:hover {
    color: var(--accent-hover);
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
}

.navbar-nav a,
.navbar-nav .nav-link {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

.navbar-nav a:hover,
.navbar-nav .nav-link:hover {
    color: var(--accent);
    background: var(--accent-light);
}

.navbar-nav a.active,
.navbar-nav .nav-link.active {
    color: var(--accent);
    background: var(--accent-light);
}

.nav-btn-admin {
    background: var(--accent) !important;
    color: white !important;
    font-weight: 600 !important;
    padding: 8px 20px !important;
    border-radius: var(--radius-sm) !important;
}

.nav-btn-admin:hover {
    background: var(--accent-hover) !important;
    transform: translateY(-1px);
}

/* Mobile nav */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
}

/* === Hero Section === */
.hero {
    position: relative;
    padding: 120px 0 100px;
    text-align: center;
    background-image: url('/img/hero.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: white;
    margin-top: -40px;
    /* Offset the container padding to touch navbar */

    /* Breakout of any parent padding to span full viewport */
    width: 100vw;
    margin-left: calc(50% - 50vw);
    right: 0;
}

/* Add an overlay to ensure text is readable regardless of the background image */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    /* 50% black overlay */
    z-index: 1;
}

/* Ensure content stays above the overlay */
.hero .container {
    position: relative;
    z-index: 10;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 10;
}

.hero p {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 650px;
    margin: 0 auto;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    line-height: 1.6;
    position: relative;
    z-index: 10;
}

/* We don't need the circular profile image anymore */

/* === Cards === */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* === Post List (Updated from Grid) === */
.post-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 32px;
}

.post-card {
    cursor: pointer;
    overflow: hidden;
    display: flex;
    gap: 24px;
    align-items: center;
    /* Optimasi performa render halaman */
    content-visibility: auto;
    contain-intrinsic-size: 1px 200px;
}

.post-card-image {
    width: 240px;
    height: 160px;
    min-width: 240px;
    object-fit: cover;
    border-radius: var(--radius-md);
    aspect-ratio: 16/9;
}

.post-card-image-placeholder {
    width: 240px;
    height: 160px;
    min-width: 240px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--text-muted);
    border-radius: var(--radius-md);
}

.post-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.post-card-category {
    background: var(--accent-light);
    color: var(--accent-dark);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.post-card h3 {
    margin-bottom: 8px;
    font-size: 1.25rem;
    transition: var(--transition-fast);
    line-height: 1.3;
}

.post-card:hover h3 {
    color: var(--accent);
}

.post-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 16px;
    flex: 1;
}

.post-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.post-card-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.tag-chip {
    background: #E0F7FA;
    color: #00838F;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* === Post Detail === */
.post-detail {
    padding: 40px 0 80px;
}

.post-header {
    text-align: center;
    margin-bottom: 48px;
}

.post-header h1 {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 16px;
    line-height: 1.2;
}

.post-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.post-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-cover {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    margin-bottom: 40px;
}

/* Markdown content */
.post-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    margin-top: 2em;
    margin-bottom: 0.8em;
    color: var(--text-primary);
}

.post-content h2 {
    font-size: 1.8rem;
}

.post-content h3 {
    font-size: 1.4rem;
}

.post-content p {
    margin-bottom: 1.2em;
}

.post-content a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.post-content img {
    border-radius: var(--radius-md);
    margin: 24px 0;
}

.post-content blockquote {
    border-left: 3px solid var(--accent);
    padding: 16px 24px;
    margin: 24px 0;
    background: var(--accent-light);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    color: var(--text-secondary);
    font-style: italic;
}

.post-content code {
    font-family: 'JetBrains Mono', monospace;
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    color: #0277BD;
}

.post-content pre {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: var(--radius-md);
    padding: 20px;
    overflow-x: auto;
    margin: 24px 0;
}

.post-content pre code {
    background: none;
    padding: 0;
    color: #e2e8f0;
    font-size: 0.9rem;
}

.post-content ul,
.post-content ol {
    padding-left: 24px;
    margin-bottom: 1.2em;
}

.post-content li {
    margin-bottom: 0.5em;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
}

.post-content th,
.post-content td {
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    text-align: left;
}

.post-content th {
    background: var(--bg-tertiary);
    font-weight: 600;
}

.post-content hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 32px 0;
}

/* === Comments === */
.comments-section {
    margin-top: 48px;
    padding-top: 48px;
    border-top: 1px solid var(--border-color);
}

.comments-section h3 {
    margin-bottom: 24px;
}

.comment-item {
    padding: 20px;
    margin-bottom: 16px;
}

.comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.comment-author {
    font-weight: 600;
    color: var(--text-primary);
}

.comment-date {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.comment-body {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Comment Form */
.comment-form {
    margin-top: 32px;
}

.comment-form h4 {
    margin-bottom: 16px;
}

/* === Forms === */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(3, 155, 229, 0.12);
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: var(--radius-md);
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 8px rgba(3, 155, 229, 0.25);
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 14px rgba(3, 155, 229, 0.30);
    color: white;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--border-hover);
    background: #e2e8f0;
}

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

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

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
}

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

.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* === Status Badge === */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-published {
    background: #d1fae5;
    color: var(--success);
}

.badge-draft {
    background: #fef3c7;
    color: var(--warning);
}

.badge-pending {
    background: #fef3c7;
    color: var(--warning);
}

.badge-approved {
    background: #d1fae5;
    color: var(--success);
}

/* === Admin Layout === */
.admin-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.admin-sidebar {
    background: #ffffff;
    border-right: 1px solid var(--border-color);
    padding: 24px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.admin-sidebar-brand {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--accent);
    padding: 0 12px 24px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
    cursor: pointer;
    display: block;
}

.admin-nav {
    list-style: none;
}

.admin-nav li {
    margin-bottom: 4px;
}

.admin-nav a,
.admin-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.admin-nav a:hover,
.admin-nav .nav-link:hover {
    color: var(--accent);
    background: var(--accent-light);
}

.admin-nav a.active,
.admin-nav .nav-link.active {
    color: var(--accent);
    background: var(--accent-light);
    font-weight: 600;
}

.admin-nav-icon {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.sidebar-nav-group {
    margin-bottom: 20px;
}

.sidebar-group-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 0 16px;
    margin-bottom: 6px;
}

.nav-icon-badge {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.admin-main {
    padding: 32px 40px;
    overflow-y: auto;
    background: var(--bg-primary);
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.admin-header h1 {
    font-size: 1.8rem;
}

/* === Dashboard Header === */
.admin-header p.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 4px;
}

/* === Quick Actions === */
.quick-actions {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    flex: 1;
    justify-content: center;
}

.quick-action-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.quick-action-icon {
    font-size: 1.2rem;
}

/* === Stat Cards === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-card-info {
    display: flex;
    flex-direction: column;
}

.stat-card-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent-dark);
    line-height: 1.1;
}

.stat-card-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Icon Colors */
.icon-blue {
    background: #e0f2fe;
    color: #0284c7;
}

.icon-green {
    background: #dcfce7;
    color: #16a34a;
}

.icon-yellow {
    background: #fef9c3;
    color: #ca8a04;
}

.icon-purple {
    background: #f3e8ff;
    color: #9333ea;
}

.icon-orange {
    background: #ffedd5;
    color: #ea580c;
}

.icon-red {
    background: #fee2e2;
    color: #dc2626;
}

/* === Avatars === */
.avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* === Tables === */
.table-wrapper {
    overflow-x: auto;
}

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

.data-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border-color);
    background: var(--bg-tertiary);
}

.data-table th:first-child {
    border-radius: var(--radius-md) 0 0 0;
}

.data-table th:last-child {
    border-radius: 0 var(--radius-md) 0 0;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.data-table tr:hover td {
    background: var(--accent-light);
}

.data-table .actions {
    display: flex;
    gap: 6px;
}

/* Mobile responsive for horizontal post cards */
@media (max-width: 768px) {
    .blog-layout {
        grid-template-columns: 1fr;
    }

    .post-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .post-card-image,
    .post-card-image-placeholder {
        width: 100%;
        height: 200px;
        min-width: unset;
    }
}

/* === Editor === */
.editor-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 24px;
}

.editor-pane {
    min-height: 500px;
}

.editor-textarea {
    width: 100%;
    min-height: 500px;
    padding: 20px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.7;
    resize: vertical;
    outline: none;
    transition: var(--transition);
}

.editor-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(3, 155, 229, 0.12);
}

.editor-preview {
    padding: 20px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    min-height: 500px;
    overflow-y: auto;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

/* === Login Page === */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    background: var(--bg-tertiary);
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 48px 40px;
    text-align: center;
    background: #ffffff;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.login-card h1 {
    font-size: 1.8rem;
    margin-bottom: 8px;
    color: var(--accent);
}

.login-card p {
    color: var(--text-muted);
    margin-bottom: 32px;
}

.login-card .form-group {
    text-align: left;
}

.login-card .btn {
    width: 100%;
    margin-top: 8px;
    padding: 14px;
}

/* === Pagination === */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 48px;
}

.pagination button {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: #ffffff;
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.pagination button:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
}

.pagination button.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* === Layout === */
.blog-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 32px;
    align-items: start;
}

.sidebar {
    position: sticky;
    top: 88px;
    align-self: start;
}

.sidebar-section {
    margin-bottom: 32px;
}

.sidebar-section h4 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-dark);
    margin-bottom: 16px;
}

.sidebar-list {
    list-style: none;
}

.sidebar-list li {
    margin-bottom: 6px;
}

.sidebar-list a,
.sidebar-list .sidebar-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.sidebar-list a:hover,
.sidebar-list .sidebar-link:hover {
    color: var(--accent);
    background: var(--accent-light);
}

.sidebar-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 10px;
}

/* === Toast Notification === */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 14px 24px;
    border-radius: var(--radius-md);
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.9rem;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
    max-width: 400px;
}

.toast-success {
    border-left: 4px solid var(--success);
}

.toast-error {
    border-left: 4px solid var(--danger);
}

.toast-info {
    border-left: 4px solid var(--accent);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* === Loading === */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* === Footer === */
.footer {
    padding: 48px 24px 32px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 80px;
}

.footer a {
    color: var(--accent);
}

/* === Modal === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 32px;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
}

.modal h3 {
    margin-bottom: 20px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* === Alert Messages === */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--danger);
}

.alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: var(--success);
}

/* === Transitions === */
.page-enter {
    animation: pageEnter 0.3s ease;
}

@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Footer === */
.footer {
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    padding: 64px 0 24px;
    margin-top: 64px;
    color: var(--text-secondary);
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 48px;
}

.footer-brand h3 {
    margin-bottom: 16px;
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.footer-brand p {
    line-height: 1.6;
    font-size: 0.95rem;
}

.footer-links h4,
.footer-social h4 {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 20px;
    font-weight: 600;
}

.footer-links ul {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a,
.social-icons a {
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
}

.footer-links a:hover,
.social-icons a:hover {
    color: var(--primary);
}

.social-icons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* === Responsive === */
@media (max-width: 1024px) {
    .blog-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: fixed;
        left: -280px;
        z-index: 200;
        transition: var(--transition);
        height: 100vh;
        width: 260px;
    }

    .admin-sidebar.open {
        left: 0;
    }

    .admin-main {
        padding: 24px 20px;
    }
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .post-grid {
        grid-template-columns: 1fr;
    }

    .post-header h1 {
        font-size: 2rem;
    }

    .editor-layout {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.6rem;
    }

    .navbar-nav {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: #ffffff;
        border-bottom: 1px solid var(--border-color);
        padding: 16px;
    }

    .navbar-nav.open {
        display: flex;
    }

    .post-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .post-card-image,
    .post-card-image-placeholder {
        width: 100%;
        min-width: 100%;
        height: auto;
        aspect-ratio: 16/9;
    }

    .nav-toggle {
        display: block;
    }
}

@media (max-width: 480px) {

    .container,
    .container-narrow {
        padding: 0 16px;
    }

    .hero {
        padding: 48px 0 40px;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .post-header h1 {
        font-size: 1.6rem;
    }

    .login-card {
        padding: 32px 24px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}