:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: #1a2234;
    --bg-hover: #1f2a3f;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #22c55e;
    --accent-hover: #16a34a;
    --accent-glow: rgba(34, 197, 94, 0.15);
    --border: rgba(148, 163, 184, 0.08);
    --border-hover: rgba(148, 163, 184, 0.2);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --radius: 12px;
    --radius-lg: 16px;
    --transition: 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content { flex: 1; }

/* Navbar */
.navbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.nav-container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 20px;
    height: 64px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    line-height: 0;
}

.nav-search {
    flex: 1;
    max-width: 580px;
}

.nav-search form {
    display: flex;
    position: relative;
}

.search-input {
    width: 100%;
    height: 38px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0 40px 0 16px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: border var(--transition);
}

.search-input:focus { border-color: var(--accent); }

.search-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    font-size: 16px;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    line-height: 0;
}

.nav-menu {
    display: flex;
    gap: 4px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition);
    white-space: nowrap;
}

.nav-link:hover { color: var(--text-primary); background: var(--bg-hover); }
.nav-link.active { color: var(--accent); background: var(--accent-glow); }

/* Container */
.container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 24px 20px;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, #0d1a2e 100%);
    border-bottom: 1px solid var(--border);
    padding: 48px 20px;
    text-align: center;
}

.hero-title {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 12px;
}

.hero-title span { color: var(--accent); }

.hero-desc {
    color: var(--text-secondary);
    font-size: 16px;
    max-width: 500px;
    margin: 0 auto;
}

/* Section */
.section {
    margin-bottom: 40px;
}

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

.section-title {
    font-size: 22px;
    font-weight: 700;
}

.section-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.section-link:hover { text-decoration: underline; }

/* Komik Grid */
.komik-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.komik-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.komik-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.komik-card-thumb {
    position: relative;
    aspect-ratio: 3/4;
    overflow: hidden;
    background: var(--bg-secondary);
}

.komik-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.komik-card:hover .komik-card-thumb img { transform: scale(1.05); }

.komik-card-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

.komik-card-views {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

.komik-card-body {
    padding: 10px 12px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.komik-card-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
}

.komik-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: auto;
}

/* Genre Pills */
.genre-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.genre-pill {
    display: inline-block;
    padding: 4px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: all var(--transition);
}

.genre-pill:hover {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--accent);
}

/* Komik Detail Page */
.detail-header {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, #0d1a2e 100%);
    border-bottom: 1px solid var(--border);
    padding: 32px 20px;
}

.detail-container {
    max-width: 1320px;
    margin: 0 auto;
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

.detail-cover {
    width: 260px;
    flex-shrink: 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.detail-cover img {
    width: 100%;
    display: block;
    aspect-ratio: 3/4;
    object-fit: cover;
}

.detail-info { flex: 1; min-width: 0; }

.detail-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 12px;
    line-height: 1.3;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--text-secondary);
}

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

.detail-desc {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 20px;
    max-width: 720px;
}

.detail-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all var(--transition);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }

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

.btn-secondary:hover { background: var(--bg-hover); }

/* Reader Page */
.reader-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 12px;
}

.reader-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.reader-title {
    font-size: 16px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reader-nav {
    display: flex;
    gap: 8px;
    align-items: center;
}

.reader-scroll {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 40px;
}

.reader-page-image {
    width: 100%;
    display: flex;
    justify-content: center;
}

.reader-page-image img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    display: block;
}

.reader-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 20px 0;
}

/* Genre Listing Page */
.genre-page-header {
    margin-bottom: 24px;
}

.genre-page-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
}

/* Search Page */
.search-page-header {
    margin-bottom: 24px;
}

.search-page-title {
    font-size: 22px;
    font-weight: 700;
}

.search-page-count {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 32px 0;
    flex-wrap: wrap;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition);
}

.page-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.page-dots { display: flex; align-items: center; color: var(--text-muted); padding: 0 4px; }

/* Footer */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 32px 20px;
    text-align: center;
    margin-top: 48px;
}

.footer-container {
    max-width: 1320px;
    margin: 0 auto;
}

.footer-brand {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.footer-desc {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 12px;
}

.footer-copy {
    color: var(--text-muted);
    font-size: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-container { justify-content: space-between; }

    .nav-search { display: none; }

    .nav-toggle { display: block; }

    .nav-search-mobile { display: block; padding-bottom: 12px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }

    .nav-search-mobile form { display: flex; }

    .nav-search-mobile .search-input { width: 100%; }

    .nav-menu {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 12px;
    }

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

    .hero-title { font-size: 26px; }

    .detail-container { flex-direction: column; align-items: center; }

    .detail-cover { width: 200px; }

    .detail-title { font-size: 22px; text-align: center; }

    .detail-meta { justify-content: center; }

    .detail-desc { text-align: center; }

    .detail-actions { justify-content: center; }

    .komik-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
}

@media (max-width: 480px) {
    .komik-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

    .hero { padding: 32px 16px; }

    .hero-title { font-size: 22px; }

    .container { padding: 16px 12px; }

    .detail-cover { width: 160px; }
}

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

.empty-state-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state-title { font-size: 18px; font-weight: 600; margin-bottom: 8px; color: var(--text-secondary); }
.empty-state-desc { font-size: 14px; }

/* Loading Spinner */
.loading { text-align: center; padding: 40px; color: var(--text-muted); }
.spinner { display: inline-block; width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Button Small */
.btn-sm { padding: 8px 16px; font-size: 13px; }

/* Section Header Center */
.section-header--center { justify-content: center; }

/* Section Title Small */
.section-title--sm { font-size: 16px; }

/* Page Jump (reader page navigation) */
.page-jump { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; padding-bottom: 24px; }

/* Page List (komik detail page list) */
.page-list { display: flex; flex-wrap: wrap; gap: 8px; }

/* Search Input Large */
.search-input-lg {
    flex: 1; min-width: 200px; height: 44px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 10px; padding: 0 16px;
    color: var(--text-primary); font-size: 14px; outline: none;
    transition: border var(--transition);
}
.search-input-lg:focus { border-color: var(--accent); }

/* Search Select */
.search-select {
    height: 44px; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 10px; padding: 0 12px;
    color: var(--text-primary); font-size: 14px; outline: none; cursor: pointer;
    transition: border var(--transition);
}
.search-select:focus { border-color: var(--accent); }

/* Genre Page Count */
.genre-page-count { color: var(--text-secondary); font-size: 14px; }

/* Empty State Action */
.empty-state-action { margin-top: 20px; }

/* Genre Pills with margin bottom */
.genre-pills--mb { margin-bottom: 16px; }

/* Nav Logo */
.nav-logo { height: 32px; width: auto; display: block; }

/* SVG Icon base */
.icon { display: inline-block; vertical-align: middle; flex-shrink: 0; }
.icon--sm { width: 16px; height: 16px; }
.icon--md { width: 20px; height: 20px; }
.icon--lg { width: 24px; height: 24px; }

/* Mobile Search inside nav menu */
.nav-search-mobile { display: none; }

/* Nav Toggle hover state */
.nav-toggle { padding: 8px; border-radius: 8px; transition: background var(--transition); }
.nav-toggle:hover { background: var(--bg-hover); }

/* Detail Meta Item with icon alignment */
.detail-meta-item { display: inline-flex; align-items: center; gap: 6px; }

/* Search Form (cari page) */
.search-form { display: flex; gap: 12px; flex-wrap: wrap; }
