/* Custom Premium Design System for DocTruyen.us */

:root {
    --primary-color: #8b5cf6; /* Indigo / Purple Accent */
    --primary-hover: #a78bfa;
    --secondary-color: #ec4899; /* Pink Accent */
    --accent-glow: rgba(139, 92, 246, 0.45);
    
    --bg-dark: #090d16; /* Deepest Cosmic Black */
    --bg-surface: #121824; /* Dark Slate Surface */
    --bg-card: #182032; /* Glass-like Card Background */
    --bg-card-hover: #1e293b;
    --border-color: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(139, 92, 246, 0.3);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --glass-bg: rgba(18, 24, 36, 0.75);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    
    --transition-smooth: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    
    --font-primary: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
    
    --border-radius-md: 12px;
    --border-radius-lg: 12px;
}

/* Base resets and configuration */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Cosmic background glows */
.bg-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(140px);
    z-index: -1;
    opacity: 0.12;
    pointer-events: none;
}

.bg-glow-1 {
    background: radial-gradient(circle, var(--primary-color) 0%, transparent 70%);
    top: -150px;
    right: -150px;
}

.bg-glow-2 {
    background: radial-gradient(circle, var(--secondary-color) 0%, transparent 70%);
    bottom: -150px;
    left: -150px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 5px;
    border: 2px solid var(--bg-dark);
}

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

/* Typography elements */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-smooth);
}

/* App Header */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 76px;
    background-color: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
    box-shadow: var(--glass-shadow);
}

.header-container {
    max-width: 1400px;
    height: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

.logo span {
    color: var(--primary-color);
    text-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
}

/* Search Form */
.header-search-container {
    flex: 1;
    max-width: 500px;
}

.search-form {
    position: relative;
    width: 100%;
}

.search-form input {
    width: 100%;
    height: 44px;
    padding: 0 50px 0 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 30px;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 14px;
    transition: var(--transition-smooth);
}

.search-form input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.15);
}

.search-form button {
    position: absolute;
    right: 5px;
    top: 5px;
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.search-form button:hover {
    color: var(--primary-color);
    background: rgba(255, 255, 255, 0.05);
}

/* Nav Menu */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pc-only { display: flex; }
.mobile-only { display: none; }

.nav-link {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 500;
    padding: 10px 18px;
    border-radius: 20px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link i {
    font-size: 16px;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.nav-link.active {
    border: 1px solid rgba(139, 92, 246, 0.2);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.1);
    color: var(--primary-color);
}

.mobile-menu-btn {
    font-size: 26px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
}

/* Mobile Media Query */
@media (max-width: 768px) {
    .pc-only { display: none !important; }
    .mobile-only { display: block !important; }
    
    .header-container {
        padding: 0 15px;
    }
}

/* Mobile Drawer */
.mobile-drawer {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100vh;
    background-color: var(--bg-surface);
    z-index: 2000;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.mobile-drawer.active {
    right: 0;
}

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

.drawer-close {
    font-size: 20px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
}

.drawer-nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.drawer-link {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 500;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.drawer-link:hover, .drawer-link.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary-color);
}

.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1999;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
}

.drawer-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* App Main Grid */
.app-main {
    margin-top: 76px;
    padding: 30px 24px 60px 24px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    min-height: calc(100vh - 300px);
    position: relative;
}

/* Global Loader */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-dark);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.loading-overlay.active {
    opacity: 0.95;
    pointer-events: all;
}

.spinner-container {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(139, 92, 246, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s infinite linear;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* SPA Views */
.app-view {
    display: none;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.app-view.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Hero Banner */
.hero-banner {
    width: 100%;
    min-height: 280px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(236, 72, 153, 0.05) 100%), 
                radial-gradient(ellipse at bottom, var(--bg-surface) 0%, var(--bg-dark) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 48px 48px;
    display: flex;
    align-items: center;
    margin-bottom: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.hero-banner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 80% 30%, rgba(139, 92, 246, 0.18) 0%, transparent 60%);
    pointer-events: none;
}

.hero-content {
    max-width: 650px;
    position: relative;
    z-index: 2;
}

.hero-tag {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--secondary-color);
    background: rgba(236, 72, 153, 0.1);
    padding: 6px 14px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 18px;
    border: 1px solid rgba(236, 72, 153, 0.2);
}

.hero-title {
    font-size: 38px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 14px;
    background: linear-gradient(to right, #ffffff, #e2e8f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-desc {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* Buttons */
.btn {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-smooth);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #7c3aed 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
    background: linear-gradient(135deg, #9b6eff 0%, var(--primary-hover) 100%);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.btn-icon:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(139, 92, 246, 0.05);
}

.btn-icon:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Sections */
.section-container {
    margin-bottom: 48px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    padding-bottom: 12px;
}

.section-title {
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    color: var(--primary-color);
}

.section-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-indicator {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.pagination-buttons {
    display: flex;
    gap: 6px;
}

/* Genre chips */
.genres-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.genre-chip {
    font-size: 13px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
}

.genre-chip:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.1);
}

.genre-chip.active {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.genre-chip-skeleton {
    width: 90px;
    height: 34px;
    border-radius: 20px;
    background: var(--bg-card);
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 0.3; }
    100% { opacity: 0.6; }
}

/* Comic Grid & Cards */
.comics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 24px;
}

.comic-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.comic-card:hover {
    transform: translateY(-8px);
    border-color: var(--border-hover);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), 0 0 15px rgba(139, 92, 246, 0.15);
}

.comic-cover-container {
    position: relative;
    width: 100%;
    padding-top: 135%; /* 3:4 aspect ratio */
    overflow: hidden;
    background: var(--bg-surface);
}

.comic-cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.comic-card:hover .comic-cover {
    transform: scale(1.08);
}

.comic-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 3;
}

.badge {
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

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

.badge-ongoing {
    background: #10b981;
    color: white;
}

.badge-completed {
    background: #3b82f6;
    color: white;
}

.badge-coming {
    background: #f59e0b;
    color: white;
}

.comic-card-info {
    padding: 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between;
    gap: 8px;
}

.comic-card-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    height: 38px;
    transition: var(--transition-smooth);
}

.comic-card:hover .comic-card-title {
    color: var(--primary-color);
}

.comic-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
}

.comic-card-chapter {
    font-weight: 500;
    color: var(--secondary-color);
    background: rgba(236, 72, 153, 0.08);
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid rgba(236, 72, 153, 0.15);
}

/* Skeletons */
.comic-skeleton {
    border-radius: var(--border-radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    overflow: hidden;
    height: 310px;
    display: flex;
    flex-direction: column;
}

.skeleton-cover {
    width: 100%;
    height: 220px;
    background: linear-gradient(90deg, var(--bg-surface) 25%, #1b2438 50%, var(--bg-surface) 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
}

.skeleton-text {
    height: 16px;
    background: var(--bg-surface);
    margin: 12px 14px 6px 14px;
    border-radius: 4px;
}

.skeleton-text-short {
    width: 60%;
    height: 12px;
    background: var(--bg-surface);
    margin: 0 14px 14px 14px;
    border-radius: 4px;
}

@keyframes loading-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.empty-state i {
    font-size: 64px;
    color: var(--text-muted);
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 600;
}

.empty-state p {
    color: var(--text-secondary);
    max-width: 400px;
    margin-bottom: 8px;
}

/* Back Nav */
.back-nav {
    margin-bottom: 20px;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 8px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 20px;
}

.btn-back:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Detail view styling */
.detail-banner-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 380px;
    background-size: cover;
    background-position: center;
    filter: blur(40px) brightness(0.18);
    opacity: 0.7;
    z-index: 1;
    mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
    pointer-events: none;
}

.detail-container {
    position: relative;
    z-index: 2;
}

.detail-header-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--border-radius-lg);
    padding: 30px;
    box-shadow: var(--glass-shadow);
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
}

.detail-cover-wrapper {
    flex-shrink: 0;
    width: 200px;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 2px solid rgba(255, 255, 255, 0.08);
}

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

.detail-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.detail-title {
    font-size: 32px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 8px;
}

.detail-origin {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.detail-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.meta-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.meta-value {
    font-size: 14px;
    font-weight: 500;
}

.detail-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 28px;
}

.genre-badge {
    font-size: 12px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
}

.genre-badge:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

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

.detail-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 30px;
    margin-bottom: 30px;
}

.detail-section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.detail-section-title i {
    color: var(--primary-color);
}

.detail-summary-content {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-line;
}

/* Detail Chapters List Drawer */
.detail-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.chapters-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chapters-search-input {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 8px 16px;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 13px;
    width: 180px;
}

.chapters-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

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

.chapter-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.chapter-btn:hover {
    border-color: var(--primary-color);
    background: rgba(139, 92, 246, 0.05);
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* Reader Mode Style */
.read-mode {
    padding-top: 0;
    margin-top: -30px; /* offset standard view margin */
}

.reader-top-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 64px;
    background-color: rgba(9, 13, 22, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1001;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.reader-bar-left {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 30%;
}

.reader-logo {
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: 16px;
    background: rgba(255,255,255,0.05);
}

.reader-logo:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.1);
}

.reader-manga-info {
    overflow: hidden;
}

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

.reader-chapter-title {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.reader-bar-center {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-icon-reader {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.btn-icon-reader:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

.reader-select {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 13px;
    padding: 8px 16px;
    border-radius: 20px;
    max-width: 200px;
    cursor: pointer;
}

.reader-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

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

/* Images Container */
.reader-images-container {
    max-width: 800px;
    margin: 84px auto 30px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 80vh;
    transition: var(--transition-smooth);
}

.reader-images-container.wide {
    max-width: 1100px;
}

.reader-img-wrapper {
    width: 100%;
    position: relative;
    background: var(--bg-surface);
    display: flex;
    justify-content: center;
    align-items: center;
}

.reader-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.5s ease-in;
}

.reader-img.loaded {
    opacity: 1;
}

/* Reader image loader placeholder */
.reader-img-loader {
    position: absolute;
    width: 50px;
    height: 50px;
    border: 3px solid rgba(139, 92, 246, 0.05);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s infinite linear;
    z-index: 1;
}

.reader-bottom-nav {
    max-width: 800px;
    margin: 0 auto 50px auto;
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.reader-nav-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.btn-nav-read {
    flex: 1;
}

/* Dark mode adjustment for reading */
.reader-dark-mode {
    background-color: #03070c !important;
}
.reader-dark-mode .reader-img-wrapper {
    background-color: #03070c !important;
}

/* Static Page Styling */
.static-page {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 40px;
    max-width: 900px !important;
    margin: 0 auto;
}

.static-title {
    font-size: 28px;
    margin-bottom: 24px;
    text-align: center;
}

.static-content {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.static-content p {
    margin-bottom: 18px;
}

.static-content h3 {
    font-size: 20px;
    color: var(--text-primary);
    margin-top: 32px;
    margin-bottom: 16px;
}

.static-list {
    list-style: none;
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.static-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.static-list i {
    font-size: 18px;
    margin-top: 2px;
}

.alert-box {
    display: flex;
    gap: 14px;
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 14px;
}

.alert-box.info {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.15);
    color: #93c5fd;
}

.alert-box i {
    font-size: 20px;
    flex-shrink: 0;
}

.contact-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 16px;
    margin-top: 20px;
}

.contact-card i {
    font-size: 32px;
    color: var(--primary-color);
}

.contact-card h4 {
    font-size: 16px;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.contact-card a {
    color: var(--primary-color);
    font-weight: 600;
}

.contact-card a:hover {
    text-decoration: underline;
}

/* App Footer */
.app-footer {
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    padding: 60px 24px 30px 24px;
    margin-top: 40px;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.footer-brand p {
    color: var(--text-secondary);
    font-size: 14px;
    max-width: 320px;
}

.footer-links, .footer-contact {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.footer-links h4, .footer-contact h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.footer-links a {
    font-size: 14px;
    color: var(--text-secondary);
}

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

.footer-contact p {
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-bottom {
    max-width: 1400px;
    margin: 0 auto;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

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

/* Scroll To Top Button */
.scroll-top-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: var(--transition-smooth);
    z-index: 99;
}

.scroll-top-btn.active {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

.scroll-top-btn:hover {
    background: #7c3aed;
    transform: scale(1.05);
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
    .app-main {
        padding: 24px 16px 40px 16px;
    }
    
    .footer-container {
        grid-template-columns: 1fr 1fr;
    }
    
    .footer-brand {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .hero-banner {
        padding: 30px;
        min-height: 200px;
    }
    
    .hero-title {
        font-size: 28px;
    }
    
    .detail-header-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 20px;
    }
    
    .detail-cover-wrapper {
        width: 160px;
    }
    
    .detail-info {
        align-items: center;
    }
    
    .detail-title {
        font-size: 24px;
    }
    
    .detail-meta-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        width: 100%;
    }
    
    .detail-genres {
        justify-content: center;
    }
    
    .detail-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .reader-top-bar {
        padding: 0 12px;
    }
    
    .reader-logo {
        padding: 6px 10px;
    }
    
    .reader-logo span {
        display: none;
    }
    
    .reader-manga-title {
        max-width: 100px;
    }
    
    .reader-select {
        max-width: 120px;
        padding: 6px 10px;
    }
    
    .reader-bar-right {
        display: none; /* Hide setting buttons on mobile to save space */
    }
    
    .reader-bottom-nav {
        padding: 16px 10px;
    }
    
    .reader-nav-buttons {
        flex-direction: column;
    }
    
    .btn-nav-read {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .header-container {
        padding: 0 16px;
    }
    
    .logo {
        font-size: 20px;
    }
    
    .header-search-container {
        max-width: 140px;
    }
    
    .search-form input {
        height: 38px;
        font-size: 12px;
        padding: 0 35px 0 12px;
    }
    
    .search-form button {
        top: 3px;
        right: 3px;
        width: 30px;
        height: 30px;
    }
    
    .comics-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 14px;
    }
    
    .comic-card-info {
        padding: 10px;
    }
    
    .comic-card-title {
        font-size: 13px;
        height: 36px;
    }
    
    .detail-section {
        padding: 20px;
    }
    
    .static-page {
        padding: 20px;
    }
    
    .footer-container {
        grid-template-columns: 1fr;
    }
    
    .footer-brand {
        grid-column: span 1;
    }
}

/* Manga Detail Page Styles (NetTruyen Style Dark Mode) */
.manga-detail-container {
    max-width: 1100px;
    margin: 0 auto;
}

.breadcrumb {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
}
.breadcrumb a {
    color: var(--text-muted);
}
.breadcrumb a:hover {
    color: var(--primary-color);
}
.breadcrumb i {
    font-size: 10px;
    margin: 0 8px;
}

.manga-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
}

@media (max-width: 768px) {
    .manga-layout {
        grid-template-columns: 1fr;
    }
}

/* Left Sidebar */
.manga-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.manga-cover-wrapper {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.manga-cover-img {
    width: 100%;
    display: block;
}

.manga-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-manga {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    text-align: center;
    transition: var(--transition-smooth);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.btn-read-latest {
    background-color: #0ea5e9; /* Sky blue */
    color: white;
}
.btn-read-latest:hover {
    background-color: #0284c7;
}

.btn-read-first {
    background-color: #334155; /* Slate */
    color: white;
}
.btn-read-first:hover {
    background-color: #475569;
}

.action-row {
    display: flex;
    gap: 12px;
}

.btn-follow {
    flex: 1;
    background-color: #f1f5f9;
    color: #0f172a;
}
.btn-follow:hover {
    background-color: #e2e8f0;
}

.btn-share {
    width: 48px;
    background-color: #f1f5f9;
    color: #0f172a;
}

.manga-stats {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text-secondary);
}

.stat-value {
    color: var(--text-primary);
}

.status-ongoing {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
}
.status-completed {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
}

/* Right Content */
.manga-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.manga-title {
    font-size: 28px;
    font-weight: 700;
    color: white;
    margin: 0;
}

.manga-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.manga-cat-link {
    background: rgba(14, 165, 233, 0.1);
    color: #0ea5e9;
    border: 1px solid rgba(14, 165, 233, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}
.manga-cat-link:hover {
    background: rgba(14, 165, 233, 0.2);
}

.manga-description-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
}

.desc-heading {
    font-size: 16px;
    color: white;
    margin-bottom: 12px;
    position: relative;
    padding-left: 12px;
}

.desc-heading::before {
    content: '';
    position: absolute;
    left: 0;
    top: 2px;
    bottom: 2px;
    width: 4px;
    background-color: #0ea5e9;
    border-radius: 2px;
}

.desc-content {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

/* Chapters list */
.chapters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.chapters-title {
    font-size: 18px;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chapters-tabs {
    display: flex;
    background: #1e293b;
    border-radius: 6px;
    overflow: hidden;
}

.tab-btn {
    background: none;
    border: none;
    padding: 6px 16px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.tab-btn.active {
    background: #0ea5e9;
    color: white;
}

.chapters-list-header {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    background: #1e293b;
    border-radius: 6px 6px 0 0;
    font-size: 13px;
    font-weight: 600;
    color: white;
}

.chapters-list-body {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 400px;
    overflow-y: auto;
}

/* Webkit scrollbar for chapter list */
.chapters-list-body::-webkit-scrollbar {
    width: 6px;
}
.chapters-list-body::-webkit-scrollbar-track {
    background: #1e293b;
}
.chapters-list-body::-webkit-scrollbar-thumb {
    background: #0ea5e9;
    border-radius: 3px;
}

.chapter-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 14px;
    transition: background 0.2s;
}

.chapter-item:last-child {
    border-bottom: none;
}

.chapter-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.chap-name {
    color: white;
}
.chapter-item:hover .chap-name {
    color: #0ea5e9;
}

.chap-time {
    color: var(--text-secondary);
    font-size: 13px;
}
