/**
 * MangaTok - Master Responsive Dark Theme Design System
 * Version 5.0 - Ultra Responsive (Mobile & Desktop)
 * Colors: #0f0f0f (Dark), #1a1a2e (Panel), #16213e (Card), #7c3aed (Violet), #06b6d4 (Cyan)
 */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800;900&display=swap');

:root {
    --bg-main: #0a0a0f;
    --bg-dark: #0f0f0f;
    --bg-panel: #141424;
    --bg-card: #181830;
    --bg-card-hover: #202042;
    --bg-input: #0b0b14;
    
    --primary: #7c3aed;
    --primary-light: #905cf6;
    --primary-dark: #5b21b6;
    --primary-glow: rgba(124, 58, 237, 0.35);
    
    --secondary: #06b6d4;
    --secondary-glow: rgba(6, 182, 212, 0.3);
    --accent: #f43f5e;
    
    --text-main: #f3f4f6;
    --text-sub: #9ca3af;
    --text-muted: #6b7280;
    
    --border: #262645;
    --border-light: #373760;
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.45);
    --shadow-lg: 0 16px 40px rgba(0,0,0,0.6);
    --shadow-glow: 0 0 20px var(--primary-glow);
    
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   1. RESET & BASE STYLES
   ============================================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    direction: rtl;
    text-align: right;
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.6;
    padding-bottom: 70px; /* Space for mobile bottom nav on phones */
}

@media (min-width: 1024px) {
    body { padding-bottom: 0; }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Selection */
::selection {
    background: var(--primary);
    color: #ffffff;
}

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

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

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

/* ============================================================
   2. LAYOUT & CONTAINERS
   ============================================================ */
.container {
    width: 100%;
    max-width: 1320px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 640px) {
    .container { padding-left: 1.5rem; padding-right: 1.5rem; }
}

@media (min-width: 1280px) {
    .container { padding-left: 2rem; padding-right: 2rem; }
}

.main-content {
    flex: 1;
    padding: 1.5rem 0 3rem;
}

/* ============================================================
   3. RESPONSIVE TOP NAVBAR
   ============================================================ */
.header-navbar {
    background: rgba(20, 20, 36, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 990;
    transition: var(--transition);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 1rem;
}

@media (min-width: 1024px) {
    .nav-container { height: 72px; gap: 2rem; }
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.35rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: -0.5px;
}

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

.nav-links-desktop {
    display: none;
    align-items: center;
    gap: 1.5rem;
    list-style: none;
}

@media (min-width: 1024px) {
    .nav-links-desktop { display: flex; }
}

.nav-link {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-sub);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
    color: #fff;
    background: rgba(124, 58, 237, 0.12);
}

.nav-search-bar {
    display: none;
    position: relative;
    flex: 1;
    max-width: 320px;
}

@media (min-width: 768px) {
    .nav-search-bar { display: block; }
}

.nav-search-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    padding: 0.55rem 2.2rem 0.55rem 1rem;
    border-radius: var(--radius-full);
    color: #fff;
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}

.nav-search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: var(--bg-card);
}

.nav-search-icon {
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* User Avatar & Dropdown */
.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    cursor: pointer;
    color: #fff;
    transition: var(--transition);
}

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

.user-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    object-fit: cover;
    background: var(--primary);
}

/* ============================================================
   4. MOBILE BOTTOM NAVIGATION (Native App Feel)
   ============================================================ */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(20, 20, 36, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 999;
}

@media (min-width: 1024px) {
    .mobile-bottom-nav { display: none; }
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    gap: 3px;
    flex: 1;
    height: 100%;
    transition: var(--transition);
}

.mobile-nav-item.active, .mobile-nav-item:hover {
    color: var(--primary);
}

.mobile-nav-item svg {
    width: 22px;
    height: 22px;
}

/* ============================================================
   5. RESPONSIVE GRID SYSTEMS
   ============================================================ */
.grid { display: grid; gap: 1rem; }

/* Series Cards Responsive Grid: 2 cols mobile, 3 tablet, 4-6 desktop */
.series-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .series-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1rem;
    }
}

@media (min-width: 768px) {
    .series-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 1.25rem;
    }
}

@media (min-width: 1024px) {
    .series-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 1.5rem;
    }
}

@media (min-width: 1280px) {
    .series-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

/* 2-Column Responsive Layout (Main Content + Sidebar) */
.layout-with-sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .layout-with-sidebar {
        flex-direction: row;
    }
    .layout-main-col {
        flex: 1;
        min-width: 0;
    }
    .layout-sidebar-col {
        width: 320px;
        flex-shrink: 0;
    }
}

/* ============================================================
   6. SERIES CARD COMPONENT (Ultra Sleek)
   ============================================================ */
.series-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: var(--transition);
    height: 100%;
}

.series-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 12px 30px rgba(0,0,0,0.5), var(--shadow-glow);
}

.series-card-cover-wrap {
    position: relative;
    width: 100%;
    padding-top: 140%; /* Aspect ratio 1:1.4 */
    overflow: hidden;
    background: var(--bg-dark);
}

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

.series-card:hover .series-card-cover {
    transform: scale(1.06);
}

.series-card-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    background: rgba(15, 15, 15, 0.85);
    backdrop-filter: blur(6px);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.15);
    z-index: 2;
}

.badge-manhwa { background: rgba(124, 58, 237, 0.9); border-color: var(--primary-light); }
.badge-manga { background: rgba(6, 182, 212, 0.9); border-color: var(--secondary); }
.badge-manhua { background: rgba(244, 63, 94, 0.9); border-color: var(--accent); }

.series-card-rating {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(6px);
    padding: 2px 7px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    color: #fbbf24;
    display: flex;
    align-items: center;
    gap: 3px;
    z-index: 2;
}

.series-card-info {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between;
}

.series-card-title {
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.4;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.4rem;
}

.series-card-latest {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    padding-top: 0.5rem;
    margin-top: 0.4rem;
}

.series-card-latest-num {
    color: var(--primary-light);
    font-weight: 700;
}

/* ============================================================
   7. BUTTONS & CONTROLS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    outline: none;
    text-align: center;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.45);
    color: #fff;
}

.btn-secondary {
    background: var(--bg-card);
    border-color: var(--border);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
    color: #fff;
}

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

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

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.82rem;
}

.btn-lg {
    padding: 0.85rem 1.75rem;
    font-size: 1.1rem;
}

.btn-block { width: 100%; }

/* ============================================================
   8. FORMS & INPUTS
   ============================================================ */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-sub);
    margin-bottom: 0.4rem;
}

.form-control {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    color: #fff;
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: var(--bg-card);
}

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

/* ============================================================
   9. CARDS & SECTIONS
   ============================================================ */
.card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}

@media (min-width: 768px) {
    .card { padding: 1.75rem; }
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.75rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background: var(--primary);
    border-radius: var(--radius-full);
}

/* ============================================================
   10. RESPONSIVE TABLES
   ============================================================ */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: right;
    font-size: 0.9rem;
}

.table th {
    background: var(--bg-card);
    color: var(--text-sub);
    font-weight: 700;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
}

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

.table tr:hover td {
    background: rgba(124, 58, 237, 0.04);
}

/* ============================================================
   11. TOASTS & ALERTS
   ============================================================ */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success { background: rgba(16, 185, 129, 0.15); border: 1px solid var(--success); color: #6ee7b7; }
.alert-danger { background: rgba(239, 68, 68, 0.15); border: 1px solid var(--danger); color: #fca5a5; }
.alert-warning { background: rgba(245, 158, 11, 0.15); border: 1px solid var(--warning); color: #fde68a; }
.alert-info { background: rgba(59, 130, 246, 0.15); border: 1px solid var(--info); color: #93c5fd; }

/* ============================================================
   12. HOMEPAGE - HERO SECTION
   ============================================================ */
.hero-section {
    position: relative;
    background: linear-gradient(135deg, rgba(124,58,237,0.08) 0%, rgba(10,10,15,0.95) 50%, rgba(6,182,212,0.06) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    margin-bottom: 2rem;
    overflow: hidden;
}

.hero-bg-glow {
    position: absolute;
    top: -60%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(124,58,237,0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
}

@media (min-width: 1024px) {
    .hero-section { padding: 3rem 2.5rem; }
    .hero-content {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.hero-text {
    flex: 1;
    text-align: center;
}

@media (min-width: 1024px) {
    .hero-text { text-align: right; max-width: 55%; }
}

.hero-title {
    font-size: 1.75rem;
    font-weight: 900;
    color: #fff;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

@media (min-width: 768px) {
    .hero-title { font-size: 2.25rem; }
}

@media (min-width: 1024px) {
    .hero-title { font-size: 2.5rem; justify-content: flex-start; }
}

.hero-title-icon {
    font-size: 2rem;
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--text-sub);
    font-weight: 500;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 1024px) {
    .hero-subtitle { font-size: 1.1rem; margin-right: 0; }
}

.hero-stats-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
}

@media (min-width: 1024px) {
    .hero-stats-row { justify-content: flex-start; }
}

.hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.hero-stat-num {
    font-size: 1.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

.hero-stat-divider {
    width: 1px;
    height: 30px;
    background: var(--border-light);
}

.hero-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

@media (min-width: 1024px) {
    .hero-actions { justify-content: flex-start; }
}

/* Hero Covers Showcase */
.hero-covers-showcase {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    width: 100%;
    max-width: 380px;
}

@media (max-width: 639px) {
    .hero-covers-showcase { max-width: 300px; }
}

@media (min-width: 1024px) {
    .hero-covers-showcase { max-width: 420px; }
}

.hero-cover-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 3/4;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 2px solid transparent;
}

.hero-cover-item:hover {
    transform: scale(1.05);
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

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

.hero-cover-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.5rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
}

.hero-cover-name {
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================================
   13. HOMEPAGE - SECTIONS & UTILITIES
   ============================================================ */
.home-section {
    margin-bottom: 2.5rem;
}

.section-more-link {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--secondary);
    white-space: nowrap;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 4px;
}

.section-more-link:hover {
    color: var(--primary-light);
}

.section-browse-more {
    text-align: center;
    margin-top: 2rem;
}

.btn-glow {
    box-shadow: 0 4px 20px rgba(124,58,237,0.35);
}

.btn-glow:hover {
    box-shadow: 0 6px 30px rgba(124,58,237,0.55);
}

/* Main content series grid (fewer cols when inside sidebar layout) */
.series-grid-main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 640px) {
    .series-grid-main { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1280px) {
    .series-grid-main { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ============================================================
   14. FEATURED SCROLL CAROUSEL
   ============================================================ */
.featured-scroll-container {
    position: relative;
}

.featured-scroll-track {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0.5rem 0;
}

.featured-scroll-track::-webkit-scrollbar {
    display: none;
}

.scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(20,20,36,0.9);
    border: 1px solid var(--border);
    color: #fff;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: var(--transition);
    backdrop-filter: blur(8px);
}

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

@media (min-width: 768px) {
    .scroll-btn { display: flex; }
}

.scroll-btn-right { right: -8px; }
.scroll-btn-left { left: -8px; }

.featured-card {
    flex-shrink: 0;
    width: 160px;
    scroll-snap-align: start;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
}

@media (min-width: 640px) {
    .featured-card { width: 180px; }
}

@media (min-width: 1024px) {
    .featured-card { width: 200px; }
}

.featured-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 8px 25px rgba(0,0,0,0.4), var(--shadow-glow);
}

.featured-card-cover {
    position: relative;
    aspect-ratio: 3/4;
    overflow: hidden;
    background: var(--bg-dark);
}

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

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

.featured-card-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    pointer-events: none;
}

.featured-card-type {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 800;
    z-index: 2;
}

.featured-card-info {
    padding: 0.75rem;
}

.featured-card-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    margin-bottom: 0.4rem;
}

.featured-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
}

.featured-card-rating {
    display: flex;
    align-items: center;
    gap: 3px;
    color: #fbbf24;
    font-weight: 700;
}

.featured-card-chapter {
    color: var(--primary-light);
    font-weight: 700;
}

/* ============================================================
   15. SIDEBAR WIDGETS
   ============================================================ */
.sidebar-widget {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.sidebar-widget-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
}

.sidebar-widget-title {
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    background: rgba(255,255,255,0.02);
}

.ranking-item:hover {
    background: rgba(124,58,237,0.1);
}

.ranking-number {
    font-weight: 900;
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
    color: var(--text-muted);
    flex-shrink: 0;
}

.ranking-number.rank-1 { color: #fbbf24; }
.ranking-number.rank-2 { color: #94a3b8; }
.ranking-number.rank-3 { color: #b45309; }

.ranking-cover {
    width: 46px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    border: 1px solid var(--border);
}

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

.ranking-title {
    font-weight: 700;
    font-size: 0.88rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.ranking-views {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.ranking-rating {
    font-size: 0.75rem;
    color: #fbbf24;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.sidebar-empty {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    padding: 1rem 0;
}

.genre-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.genre-pill {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 5px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--text-sub);
    transition: var(--transition);
    white-space: nowrap;
}

.genre-pill:hover {
    border-color: var(--primary);
    color: #fff;
    background: rgba(124,58,237,0.12);
}

.stats-mini-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stats-mini-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: rgba(255,255,255,0.02);
    border-radius: var(--radius-sm);
}

.stats-mini-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.stats-mini-data {
    display: flex;
    flex-direction: column;
}

.stats-mini-num {
    font-size: 1.15rem;
    font-weight: 900;
    color: #fff;
}

.stats-mini-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* ============================================================
   16. GENRES SHOWCASE GRID
   ============================================================ */
.genres-showcase-section {
    margin-top: 1rem;
}

.genres-showcase-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (min-width: 480px) {
    .genres-showcase-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 768px) {
    .genres-showcase-grid { grid-template-columns: repeat(4, 1fr); gap: 1rem; }
}

@media (min-width: 1024px) {
    .genres-showcase-grid { grid-template-columns: repeat(5, 1fr); }
}

.genre-showcase-card {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: var(--transition);
    color: var(--text-main);
}

.genre-showcase-card:hover {
    border-color: var(--primary);
    background: rgba(124,58,237,0.1);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.genre-showcase-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.genre-showcase-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================================
   17. EMPTY STATE
   ============================================================ */
.empty-state {
    grid-column: 1 / -1;
    padding: 3rem 1.5rem;
    text-align: center;
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-state-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.5rem;
}

.empty-state-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.ad-slot-banner {
    margin-bottom: 1.5rem;
    text-align: center;
}

.ad-slot-sidebar {
    margin-bottom: 1.25rem;
    text-align: center;
}

/* ============================================================
   18. FOOTER
   ============================================================ */
.site-footer {
    background: var(--bg-panel);
    border-top: 1px solid var(--border);
    padding: 2.5rem 0 1.5rem;
    margin-top: 3rem;
}

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

@media (min-width: 768px) {
    .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.35rem;
    font-weight: 900;
    color: #fff;
    margin-bottom: 0.75rem;
}

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

.footer-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.7;
    max-width: 350px;
}

.footer-heading {
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 1rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-links a {
    font-size: 0.88rem;
    color: var(--text-sub);
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
}

@media (min-width: 768px) {
    .footer-bottom { flex-direction: row; justify-content: space-between; }
}

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

.footer-social {
    display: flex;
    gap: 0.75rem;
}

.footer-social a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-sub);
    transition: var(--transition);
}

.footer-social a:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ============================================================
   19. UTILITY CLASSES
   ============================================================ */
.desktop-only { display: none !important; }
.desktop-only-inline { display: none !important; }

@media (min-width: 1024px) {
    .desktop-only { display: block !important; }
    .desktop-only-inline { display: inline !important; }
}

.mobile-only { display: block; }
@media (min-width: 1024px) {
    .mobile-only { display: none !important; }
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================================
   20. AUTHENTICATION & SECURITY (Login / Register / Recovery)
   ============================================================ */
.auth-page-container {
    animation: authFadeIn 0.35s ease-out;
}

@keyframes authFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.google-auth-btn {
    cursor: pointer;
    user-select: none;
}

.google-auth-btn:hover {
    background: #f8fafc !important;
}

.google-auth-btn:active {
    transform: scale(0.98) !important;
}

.form-control:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px var(--primary-glow) !important;
    background: var(--bg-card) !important;
}

.form-control::placeholder {
    color: var(--text-muted);
    font-size: 0.88rem;
}

/* ============================================================
   21. MASTER RESPONSIVE ADAPTATIONS (Mobile / Tablet / Desktop)
   ============================================================ */
.md-row {
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .md-row {
        flex-direction: row !important;
        align-items: flex-start !important;
    }
}

.genre-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(124, 58, 237, 0.12);
    border: 1px solid rgba(124, 58, 237, 0.3);
    color: var(--primary-light);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
    transition: var(--transition);
    text-decoration: none;
}

.genre-pill:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--primary-glow);
}

/* Mobile Friendly Touch Targets */
@media (max-width: 767px) {
    .btn {
        min-height: 42px;
    }
    
    .hero-title {
        font-size: 1.5rem !important;
    }
    
    .hero-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .hero-actions .btn {
        width: 100%;
    }
    
    .nav-container {
        padding: 0 0.75rem;
    }
    
    .series-card-cover-wrap {
        padding-top: 142%;
    }
    
    .chapter-list-item {
        padding: 0.75rem 0.85rem !important;
        min-height: 48px;
    }

    #reader-container {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    #reader-pages-wrap {
        width: 100% !important;
        max-width: 100% !important;
    }
}

