/* ================================
   NOVELYRA - COMPLETE STYLESHEET
   Modern, Responsive, Professional
   ================================ */

/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --text-dark: #1f2937;
    --text-gray: #6b7280;
    --text-light: #9ca3af;
    --bg-white: #ffffff;
    --bg-gray: #f9fafb;
    --bg-gray-dark: #f3f4f6;
    --border: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 8px;
    --radius-sm: 4px;
    --radius-lg: 12px;
}

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

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

a:hover {
    color: var(--primary-dark);
}

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

/* === CONTAINER === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* === NAVBAR === */
.navbar {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.nav-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
}

.logo:hover {
    color: var(--primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-links a {
    color: var(--text-gray);
    font-weight: 500;
    font-size: 15px;
}

.nav-links a:hover {
    color: var(--primary);
}

.user-menu {
    position: relative;
}

.user-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-gray);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    color: var(--text-dark);
    transition: all 0.2s;
}

.user-button:hover {
    background: var(--bg-gray-dark);
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    min-width: 180px;
    z-index: 10;
}

.user-menu:hover .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 12px 16px;
    color: var(--text-gray);
    transition: background 0.2s;
}

.dropdown-menu a:hover {
    background: var(--bg-gray);
    color: var(--text-dark);
}

.btn-login,
.btn-register {
    padding: 8px 20px;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 14px;
}

.btn-login {
    color: var(--text-dark);
    border: 1px solid var(--border);
}

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

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

.btn-register:hover {
    background: var(--primary-dark);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-dark);
    padding: 8px;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 65px;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    padding: 16px;
    z-index: 99;
}

.mobile-menu.active {
    display: block;
}

.mobile-menu a {
    display: block;
    padding: 12px 16px;
    color: var(--text-gray);
    font-weight: 500;
    border-radius: var(--radius-sm);
}

.mobile-menu a:hover {
    background: var(--bg-gray);
    color: var(--text-dark);
}

/* === MAIN CONTENT === */
.main-content {
    flex: 1;
}

/* === HERO === */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 80px 0;
    text-align: center;
}

.hero-content h1 {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 16px;
    line-height: 1.2;
}

.hero-content p {
    font-size: 20px;
    margin-bottom: 40px;
    opacity: 0.95;
}

.search-box {
    max-width: 600px;
    margin: 0 auto;
}

.search-form {
    display: flex;
    gap: 12px;
    background: white;
    padding: 8px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: none;
    outline: none;
    font-size: 16px;
    color: var(--text-dark);
}

.search-btn {
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.search-btn:hover {
    background: var(--primary-dark);
}

/* === BREADCRUMB === */
.breadcrumb {
    background: var(--bg-gray);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
}

.breadcrumb .container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 14px;
    color: var(--text-gray);
}

.breadcrumb .separator {
    color: var(--text-light);
}

/* === SECTION === */
.section {
    padding: 60px 0;
}

.section-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 32px;
    color: var(--text-dark);
}

.section-subtitle {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--text-dark);
}

/* === NOVELS GRID === */
.novels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.novel-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.novel-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.novel-cover {
    position: relative;
    aspect-ratio: 2/3;
    overflow: hidden;
    background: var(--bg-gray);
}

.novel-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.novel-card:hover .novel-cover img {
    transform: scale(1.05);
}

.novel-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-gray);
}

.novel-cover-placeholder svg {
    width: 48px;
    height: 48px;
}

.novel-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: 600;
    z-index: 2;
}

/* Novel Overlay Title (like NovelBin) */
.novel-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.7) 70%, transparent 100%);
    padding: 24px 8px 8px 8px;
    z-index: 1;
}

.novel-overlay-title {
    color: white;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.novel-info {
    padding: 8px 12px;
}

.novel-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 36px;
}

.novel-title a {
    color: var(--text-dark);
    display: block;
}

.novel-title a:hover {
    color: var(--primary);
}

.novel-genre {
    font-size: 11px;
    color: var(--primary);
    font-weight: 500;
    margin-bottom: 6px;
}

.novel-description {
    font-size: 12px;
    color: var(--text-gray);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* === NOVEL DETAIL === */
.novel-detail {
    padding: 40px 0;
}

.novel-header {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.novel-cover-large {
    width: 300px;
    height: 450px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    flex-shrink: 0;
}

.novel-cover-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.novel-cover-placeholder-large {
    width: 100%;
    height: 100%;
    background: var(--bg-gray);
    display: flex;
    align-items: center;
    justify-content: center;
}

.novel-meta h1 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 16px;
    line-height: 1.2;
}

.novel-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-gray);
    font-size: 14px;
}

.novel-description {
    margin-bottom: 24px;
    line-height: 1.7;
    color: var(--text-gray);
}

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

/* === CHAPTER LIST === */
.chapter-section {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

/* Mobile: chapter-section tanpa border/radius agar full width */
@media (max-width: 768px) {
    .chapter-section {
        border: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
        background: transparent !important;
    }

    /* Hapus semua container padding di halaman chapter */
    section.chapter-section > .container {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .chapter-container {
        max-width: 100% !important;
        padding: 12px 0 !important;
        width: 100% !important;
    }

    .chapter-content {
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
        padding: 16px 14px !important;
        margin-bottom: 0 !important;
        font-size: 16px !important;
        line-height: 2 !important;
    }

    .chapter-header {
        margin-bottom: 12px !important;
        padding: 12px 14px 12px !important;
        text-align: left !important;
        border-bottom: 1px solid var(--border) !important;
    }

    .chapter-nav {
        display: grid !important;
        grid-template-columns: 1fr auto 1fr !important;
        gap: 6px !important;
        margin-bottom: 0 !important;
        padding: 10px 14px !important;
        flex-direction: unset !important;
        flex-wrap: unset !important;
        background: var(--bg-white);
        border-bottom: 1px solid var(--border);
    }

    .btn-nav {
        justify-content: center !important;
        padding: 10px 6px !important;
        font-size: 13px !important;
        width: auto !important;
    }

    .comments-wrapper {
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
        padding: 16px 14px !important;
    }
}

.chapter-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chapter-item {
    display: grid;
    grid-template-columns: 100px 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 16px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.2s;
}

.chapter-item:hover {
    background: var(--bg-gray);
    border-color: var(--primary);
    transform: translateX(4px);
}

.chapter-number {
    font-weight: 600;
    color: var(--primary);
}

.chapter-title {
    color: var(--text-dark);
    font-weight: 500;
}

.chapter-date {
    color: var(--text-light);
    font-size: 14px;
}

/* === CHAPTER READING === */
.chapter-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.chapter-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--border);
}

.chapter-header .novel-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
}

.chapter-header .novel-title a {
    color: var(--primary);
}

.chapter-header .chapter-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
}

.chapter-nav {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 32px;
}

.btn-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-weight: 500;
    color: var(--text-dark);
    transition: all 0.2s;
}

.btn-nav:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-nav.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.chapter-content {
    font-size: 18px;
    line-height: 1.8;
    color: var(--text-dark);
    margin-bottom: 40px;
    padding: 32px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

/* === COMMENTS === */
.comments-wrapper {
    margin-top: 40px;
    padding: 32px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.comments-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
}

.comment-form {
    margin-bottom: 32px;
}

.comment-textarea {
    width: 100%;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.6;
    resize: vertical;
    min-height: 120px;
}

.comment-textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.comment-item {
    padding: 20px;
    background: var(--bg-gray);
    border-radius: var(--radius);
}

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

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

.comment-date,
.comment-meta {
    font-size: 13px;
    color: var(--text-light);
}

.comment-meta a {
    color: var(--primary);
    font-weight: 500;
}

.comment-content {
    color: var(--text-dark);
    line-height: 1.6;
}

.comment-footer {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.no-comments {
    text-align: center;
    color: var(--text-light);
    padding: 32px;
}

.login-prompt {
    text-align: center;
    padding: 24px;
    background: var(--bg-gray);
    border-radius: var(--radius);
}

/* === BUTTONS === */
.btn-primary,
.btn-secondary,
.btn-success,
.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    justify-content: center;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    color: white;
}

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

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

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

.btn-success:hover {
    background: #059669;
}

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

.btn-danger:hover {
    background: #dc2626;
}

.btn-block {
    width: 100%;
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

/* === AUTH PAGES === */
.auth-section {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    padding: 60px 0;
    background: var(--bg-gray);
}

.auth-container {
    max-width: 480px;
    margin: 0 auto;
}

.auth-card {
    background: var(--bg-white);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.auth-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    text-align: center;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-gray);
    margin-bottom: 32px;
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-footer {
    margin-top: 24px;
    text-align: center;
    color: var(--text-gray);
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
}

.form-group small {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    color: var(--text-gray);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.content-editor {
    min-height: 400px;
    font-family: 'Courier New', monospace;
}

/* === ALERTS === */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

/* === ADMIN === */
.admin-section {
    padding: 40px 0;
    min-height: calc(100vh - 200px);
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 32px;
}

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

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

.stat-card {
    background: var(--bg-white);
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-info h3 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-info p {
    color: var(--text-gray);
    font-size: 14px;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.action-card {
    background: var(--bg-white);
    padding: 32px;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all 0.2s;
}

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

.action-card svg {
    margin: 0 auto 16px;
    color: var(--primary);
}

.action-card h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.action-card p {
    color: var(--text-gray);
    font-size: 14px;
}

.admin-card {
    background: var(--bg-white);
    padding: 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    max-width: 900px;
}

.admin-form {
    margin-top: 24px;
}

.table-responsive {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.admin-table thead {
    background: var(--bg-gray);
}

.admin-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-dark);
    border-bottom: 2px solid var(--border);
}

.admin-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.admin-table tbody tr:hover {
    background: var(--bg-gray);
}

.table-thumbnail {
    width: 60px;
    height: 90px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.table-thumbnail-placeholder {
    width: 60px;
    height: 90px;
    background: var(--bg-gray);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
}

.admin-table .actions {
    display: flex;
    gap: 8px;
}

/* === FEATURES === */
.features-section {
    background: var(--bg-gray);
    padding: 80px 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
}

.feature-card {
    background: var(--bg-white);
    padding: 32px;
    border-radius: var(--radius-lg);
    text-align: center;
}

.feature-icon {
    margin: 0 auto 20px;
    width: 48px;
    height: 48px;
}

.feature-card h3 {
    font-size: 20px;
    margin-bottom: 12px;
}

.feature-card p {
    color: var(--text-gray);
    line-height: 1.6;
}

/* === FOOTER === */
.footer {
    background: var(--text-dark);
    color: white;
    padding: 60px 0 20px;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h3 {
    font-size: 18px;
    margin-bottom: 16px;
}

.footer-section h4 {
    font-size: 16px;
    margin-bottom: 12px;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 8px;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.2s;
}

.footer-section a:hover {
    color: white;
}

.social-links {
    display: flex;
    gap: 12px;
}

.social-links a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: background 0.2s;
}

.social-links a:hover {
    background: var(--primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
}

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-gray);
}

.empty-state p {
    margin-bottom: 20px;
    font-size: 18px;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
    
    .nav-links {
        display: none;
    }
    
    .hero-content h1 {
        font-size: 32px;
    }
    
    .hero-content p {
        font-size: 16px;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    /* novels-grid, novel-cover-large, chapter-nav, btn-nav, chapter-content
       handled by mobile fix block at bottom of file */
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .admin-table {
        font-size: 14px;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 12px 8px;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 40px 0;
    }
    
    .hero-content h1 {
        font-size: 24px;
    }
    
    .section {
        padding: 40px 0;
    }
    
    .section-title {
        font-size: 24px;
    }
    
    .chapter-header .chapter-title {
        font-size: 20px;
    }
    
    .auth-card {
        padding: 24px;
    }
}

/* === BROWSE & FILTER === */
.browse-header {
    margin-bottom: 32px;
}

.browse-count {
    color: var(--text-gray);
    font-size: 15px;
    margin-top: 8px;
}

.genre-filter {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 32px;
}

.filter-label {
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-dark);
}

.genre-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.genre-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-gray);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-dark);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.genre-tag:hover {
    background: var(--bg-gray-dark);
    border-color: var(--primary);
}

.genre-tag.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.genre-tag .count {
    opacity: 0.7;
    font-size: 12px;
}

/* === PAGINATION === */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 48px;
    padding: 24px 0;
}

.pagination-btn,
.pagination-number {
    padding: 10px 16px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-dark);
    font-weight: 500;
    transition: all 0.2s;
}

.pagination-btn:hover,
.pagination-number:hover {
    background: var(--bg-gray);
    border-color: var(--primary);
}

.pagination-number.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination-numbers {
    display: flex;
    gap: 8px;
}

.pagination-ellipsis {
    padding: 10px 8px;
    color: var(--text-light);
}

/* === POPULAR NOVELS === */
.period-filter {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    background: var(--bg-white);
    padding: 16px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.period-btn {
    flex: 1;
    padding: 12px 24px;
    background: var(--bg-gray);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-dark);
    font-weight: 600;
    text-align: center;
    transition: all 0.2s;
}

.period-btn:hover {
    background: var(--bg-gray-dark);
    transform: translateY(-2px);
}

.period-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.popular-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.popular-item {
    display: grid;
    grid-template-columns: 60px 100px 1fr auto auto;
    gap: 20px;
    align-items: center;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all 0.2s;
}

.popular-item:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.popular-rank {
    text-align: center;
}

.rank-medal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 20px;
    font-weight: 700;
    color: white;
}

.rank-medal.rank-1 {
    background: linear-gradient(135deg, #FFD700, #FFA500);
}

.rank-medal.rank-2 {
    background: linear-gradient(135deg, #C0C0C0, #808080);
}

.rank-medal.rank-3 {
    background: linear-gradient(135deg, #CD7F32, #8B4513);
}

.rank-number {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-light);
}

.popular-cover {
    width: 100px;
    height: 140px;
    border-radius: var(--radius);
    overflow: hidden;
}

.popular-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.novel-cover-placeholder-small {
    width: 100%;
    height: 100%;
    background: var(--bg-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.popular-info {
    flex: 1;
}

.popular-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.popular-title a {
    color: var(--text-dark);
}

.popular-title a:hover {
    color: var(--primary);
}

.popular-genre {
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
}

.popular-description {
    color: var(--text-gray);
    font-size: 14px;
    line-height: 1.5;
}

.popular-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-gray);
    font-size: 14px;
    font-weight: 500;
}

.stat-item svg {
    color: var(--primary);
}

/* === LEGAL PAGES === */
.legal-section {
    padding: 60px 0;
    background: var(--bg-gray);
}

.legal-content {
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-white);
    padding: 48px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.legal-content h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-dark);
}

.legal-date {
    color: var(--text-gray);
    font-size: 14px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--border);
}

.legal-text h2 {
    font-size: 24px;
    font-weight: 700;
    margin-top: 32px;
    margin-bottom: 16px;
    color: var(--text-dark);
}

.legal-text h3 {
    font-size: 18px;
    font-weight: 600;
    margin-top: 24px;
    margin-bottom: 12px;
    color: var(--text-dark);
}

.legal-text p {
    margin-bottom: 16px;
    line-height: 1.7;
    color: var(--text-gray);
}

.legal-text ul {
    margin: 16px 0;
    padding-left: 24px;
}

.legal-text li {
    margin-bottom: 12px;
    line-height: 1.6;
    color: var(--text-gray);
}

.legal-text strong {
    color: var(--text-dark);
    font-weight: 600;
}

.legal-footer {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 2px solid var(--border);
    text-align: center;
}

.legal-footer p {
    margin-bottom: 20px;
    color: var(--text-gray);
}

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

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .popular-item {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .popular-rank,
    .popular-cover {
        justify-self: center;
    }
    
    .popular-stats {
        flex-direction: row;
        justify-content: center;
    }
    
    .popular-action {
        width: 100%;
    }
    
    .popular-action .btn-primary {
        width: 100%;
    }
    
    .period-filter {
        flex-direction: column;
    }
    
    .legal-content {
        padding: 24px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
}

/* === GENRE BADGES === */
.novel-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}

.genre-badge {
    display: inline-block;
    padding: 2px 6px;
    background: var(--primary);
    color: white;
    font-size: 9px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.4;
}

.genre-badge.more {
    background: var(--text-light);
}

/* === GENRE CHECKBOX GRID === */
.genre-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
    padding: 16px;
    background: var(--bg-gray);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.genre-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.genre-checkbox-item:hover {
    background: var(--bg-gray-dark);
    border-color: var(--primary);
}

.genre-checkbox-item input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.genre-checkbox-item input[type="checkbox"]:checked + span {
    color: var(--primary);
    font-weight: 600;
}

.genre-checkbox-item span {
    font-size: 14px;
    color: var(--text-dark);
    flex: 1;
}

/* === SECTION GRAY BACKGROUND === */
.section-gray {
    background: var(--bg-gray);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .genre-checkbox-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        max-height: 300px;
    }
    
    .genre-checkbox-item {
        padding: 8px 10px;
        font-size: 13px;
    }
}

/* === LARGER SCREENS === */
@media (min-width: 1400px) {
    .novels-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (min-width: 1600px) {
    .novels-grid {
        grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    }
}

/* === CHAPTER ITEM WRAPPER === */
.chapter-item-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chapter-item-wrapper .chapter-item {
    flex: 1;
}

.chapter-actions {
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.2s;
}

.chapter-item-wrapper:hover .chapter-actions {
    opacity: 1;
}

.btn-small {
    padding: 6px 10px;
    font-size: 14px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

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

.btn-small.btn-primary:hover {
    background: var(--primary-dark);
}

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

.btn-small.btn-danger:hover {
    background: #dc2626;
}

/* === SCROLLABLE CHAPTER LIST === */
.chapter-list-scrollable {
    max-height: 600px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-white);
}

.chapter-list-scrollable::-webkit-scrollbar {
    width: 8px;
}

.chapter-list-scrollable::-webkit-scrollbar-track {
    background: var(--bg-gray);
}

.chapter-list-scrollable::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

.chapter-list-scrollable::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* === CHAPTER VIEWS === */
.chapter-views {
    display: inline-block;
    margin-left: 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light);
    background: var(--bg-gray);
    padding: 4px 12px;
    border-radius: var(--radius-sm);
}

/* === NOVEL DETAIL PAGE — Genre & Description overrides === */

/* Genre badges di halaman detail: lebih besar dan bisa diklik */
.genre-badge-detail {
    display: inline-block;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 700;
    border-radius: var(--radius);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s;
    cursor: pointer;
}

.genre-badge-detail:hover {
    filter: brightness(0.85);
    transform: translateY(-1px);
    text-decoration: none;
}

/* Deskripsi di halaman detail: tampil penuh, tidak terpotong */
.novel-description-detail {
    display: block !important;
    -webkit-box-orient: unset !important;
    -webkit-line-clamp: unset !important;
    overflow: visible !important;
    max-height: none !important;
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-gray);
    margin-bottom: 24px;
    white-space: pre-line;
}

.novel-description-detail p {
    margin: 0;
}

/* =====================================================
   MOBILE RESPONSIVE FIX - Comprehensive
   ===================================================== */

@media (max-width: 768px) {

    /* --- NOVEL GRID: 2 kolom di mobile --- */
    .novels-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    /* --- NOVEL DETAIL - COVER: kecil dan di kiri --- */
    .novel-header {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    .novel-cover-large {
        width: 150px !important;
        height: 225px !important;
        max-width: 150px !important;
        max-height: 225px !important;
        margin: 0 auto !important;
    }

    .novel-meta h1 {
        font-size: 22px !important;
    }

    .novel-stats {
        flex-wrap: wrap;
        gap: 12px;
    }

    .novel-actions {
        flex-direction: column;
        gap: 10px;
    }

    .novel-actions .btn-primary,
    .novel-actions .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    /* chapter-section, chapter-container, chapter-nav, chapter-content:
       handled by mobile block directly after .chapter-section definition */

    /* --- CHAPTER LIST di novel detail --- */
    .chapter-item {
        grid-template-columns: 70px 1fr !important;
        gap: 6px !important;
        padding: 10px 12px !important;
    }

    .chapter-date {
        display: none !important;
    }

    /* --- COMMENTS --- */
    .comments-wrapper {
        padding: 16px !important;
        margin-top: 16px !important;
    }

    /* --- HERO --- */
    .hero-content h1 {
        font-size: 24px !important;
    }

    /* --- GENRE DETAIL --- */
    .novel-genres-detail {
        justify-content: flex-start;
    }
}

@media (max-width: 480px) {

    .novels-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }

    .novel-cover-large {
        width: 120px !important;
        height: 180px !important;
        max-width: 120px !important;
        max-height: 180px !important;
    }

    .novel-overlay-title {
        font-size: 11px !important;
    }

    .novel-badge {
        font-size: 9px !important;
        padding: 2px 6px !important;
    }

    .chapter-nav {
        grid-template-columns: 1fr auto 1fr !important;
        gap: 4px !important;
    }

    .btn-nav {
        padding: 10px 4px !important;
        font-size: 12px !important;
    }

    .chapter-content {
        font-size: 15px !important;
        padding: 14px 10px !important;
    }
}
