/*
Theme Name: MangaReader Premium
Description: Custom Premium Arabic Theme (Lava Scans Edition)
Version: 4.4 (Performance Optimized & Sci-Fi Grid)
Author: Eva Scans
*/

:root {
    --bg-dark: #000000;
    --bg-card: #0a0a0a;
    --bg-card-hover: #151515;
    --bg-lighter: #1a1a1a;
    --nav-bg: rgba(0, 0, 0, 0.95);

    --primary: #FFD700;
    /* Gold */
    --accent: #FFD700;
    --secondary: #FFA500;
    /* Darker Gold/Orange */

    --text-primary: #ffffff;
    --text-muted: #888888;
    --text-dark: #000000;

    --border: 1px solid rgba(255, 255, 255, 0.08);
    --radius-md: 12px;
    --radius-lg: 16px;

    --bg-void: #000000;
    --bg-deep: #050505;
    --accent-glow: rgba(255, 215, 0, 0.4);
    --glass: rgba(255, 255, 255, 0.05);

    /* New Variables for Manga Page */
    --accent-gold: #FFD700;
    --accent-orange: #FFA500;
    --accent-red: #FF0055;
    --bg-secondary: #111111;
    --text-secondary: #bbbbbb;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* Mobile Touch Glow Effect */
.lux-card:active,
.pop-card:active,
.nav-item:active,
.btn-main:active,
.filter-btn:active,
.icon-btn:active,
.s-badge:active {
    transform: scale(0.97);
    filter: brightness(1.2);
    transition: all 0.1s;
    outline: none !important;
}

*:focus {
    outline: none !important;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    width: 100%;
}

body {
    background: var(--bg-void);
    color: var(--text-primary);
    font-family: 'Cairo', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
    position: relative;
    font-size: 14px;
}

a {
    text-decoration: none;
    color: inherit;
}

::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 10px;
}

/* HEADER STYLES (From Theme Preview) */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: rgba(0, 0, 0, 0.95);
    /* var(--nav-bg) */
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    /* var(--border) */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4%;
}

.logo {
    font-size: 22px;
    font-weight: 900;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    color: var(--accent);
    /* var(--secondary) in preview was red/gold, using accent */
}

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

.nav-item {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    transition: 0.3s;
}

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

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.search-input {
    display: none;
    /* Hide standard search input for now as per mobile-first/icon-only in preview, or style it if needed */
}

/* Show search input on desktop if needed, matching preview logic which seems to imply just icons or simple actions */
@media (min-width: 769px) {
    .search-input {
        display: flex;
        align-items: center;
        background: rgba(255, 255, 255, 0.05);
        padding: 5px 15px;
        border-radius: 20px;
    }

    .search-input input {
        background: transparent;
        border: none;
        color: #fff;
        margin-left: 10px;
    }

    #mobile-search-btn {
        display: none;
    }
}

/* SIDEBAR DRAWER */
.side-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

.side-drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.side-drawer {
    position: fixed;
    top: 0;
    right: -320px;
    /* Hidden */
    width: 300px;
    height: 100%;
    background: rgba(10, 5, 5, 0.95);
    backdrop-filter: blur(15px);
    z-index: 1002;
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.5);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
}

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

.drawer-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.drawer-header h3 {
    margin: 0;
    color: #fff;
    font-size: 1.2rem;
}

.close-btn {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
}

.drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.user-profile-card {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
}

.u-avatar img {
    border-radius: 50%;
    width: 50px;
    height: 50px;
}

.u-info strong {
    display: block;
    color: #fff;
    font-size: 1rem;
}

.u-info span {
    color: var(--primary);
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 700;
}

.drawer-links a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    color: #ccc;
    text-decoration: none;
    transition: 0.2s;
    border-radius: 6px;
    margin-bottom: 5px;
}

.drawer-links a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    transform: translateX(5px);
}

.drawer-links a i {
    width: 20px;
    text-align: center;
    color: var(--primary);
}

.special-link {
    color: #fff !important;
}

.logout {
    margin-top: 20px;
    color: #ff4444 !important;
    border: 1px solid rgba(255, 68, 68, 0.2);
}

.guest-card {
    text-align: center;
    padding: 30px 0;
}

.guest-card i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 10px;
}

/* ARYA SCANS HOME CSS */

/* SLIDER SECTION */
.slider-section {
    padding-top: 100px;
    padding-bottom: 40px;
    width: 100%;
    overflow: hidden;
    position: relative;
    direction: ltr;
}

.swiper-container-hero {
    width: 100%;
    padding: 20px 4%;
    overflow: visible !important;
}

.swiper-slide-hero {
    width: 250px;
    height: 380px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    transition: 0.3s;
    filter: brightness(0.5);
    transform: scale(0.9);
    border: 1px solid transparent;
}

.swiper-slide-active.swiper-slide-hero {
    filter: brightness(1);
    transform: scale(1.05);
    z-index: 10;
    border-color: var(--primary);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.15);
}

.hero-card {
    display: block;
    width: 100%;
    height: 100%;
}

.hero-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95), transparent);
    padding: 20px;
    transform: translateY(100%);
    transition: 0.3s;
    text-align: right;
}

.swiper-slide-active .hero-overlay {
    transform: translateY(0);
}

.hero-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.hero-meta {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 700;
}

.slider-nav-btn {
    position: absolute;
    top: 55%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    cursor: pointer;
    transition: 0.3s;
}

.slider-nav-btn:hover {
    background: var(--primary);
    color: #000;
    box-shadow: 0 0 20px var(--primary);
}

.prev-btn {
    left: 2%;
}

.next-btn {
    right: 2%;
}

/* SCROLL ROW (POPULAR) */
.scroll-row {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 15px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    direction: rtl;
}

.scroll-row::-webkit-scrollbar {
    display: none;
}

.manga-card-sm {
    min-width: 150px;
    width: 150px;
    scroll-snap-align: start;
    position: relative;
    display: block;
    text-decoration: none;
}

.cover-sm {
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 8px;
    position: relative;
}

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

.manga-card-sm:hover .cover-sm img {
    transform: scale(1.1);
}

.rank-tag {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--secondary);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.info-sm {
    text-align: right;
}

.info-sm h3 {
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
    margin-bottom: 2px;
}

.info-sm span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* UPDATES GRID */
/* UPDATES GRID */
.updates-grid {
    display: grid;
    /* 3 columns on desktop as per preview image */
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    direction: ltr;
    /* Reset to LTR for grid, handle RTL inside */
    padding: 10px 0;
}

/* UPDATES GRID - VERTICAL LAYOUT */
.updates-grid {
    display: grid;
    /* Responsive vertical grid */
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 25px;
    direction: rtl;
    padding: 20px 0;
}

/* LEGENDARY CRYSTAL MOTION HOVER EFFECT */
.update-card {
    background: transparent;
    border: none;
    border-radius: 12px;
    /* Smooth corners */
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    /* Ultra smooth ease */
    height: auto;
    position: relative;
    overflow: visible;
    transform-style: preserve-3d;
    /* Enable 3D space */
}

/* 1. 3D Lift */
.update-card:hover {
    transform: translateY(-8px) scale(1.02);
    z-index: 5;
}

.u-poster {
    width: 100%;
    aspect-ratio: 2/3;
    height: auto;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    /* Deep premium shadow, no color glow */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* 2. Shadow Depth on Hover */
.update-card:hover .u-poster {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    /* Deeper shadow */
}

/* 3. The 'Sheen' (Light Reflection) */
.u-poster::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.15) 50%,
            rgba(255, 255, 255, 0) 100%);
    transform: skewX(-25deg);
    transition: none;
    pointer-events: none;
    z-index: 2;
}

.update-card:hover .u-poster::after {
    left: 150%;
    /* Move reflection across */
    transition: left 0.7s ease-in-out;
}

.u-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    filter: brightness(0.95);
    /* Slightly dim natively */
}

/* 4. Crystal Clarity on Hover */
.update-card:hover .u-poster img {
    transform: scale(1.08);
    /* Gentle zoom */
    filter: brightness(1.1) saturate(1.1);
    /* Crystal clear pop */
}

.u-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    text-align: right;
    /* RTL text */
}

.u-title {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    /* Show 2 lines max */
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
}

.btn-view-more {
    display: block;
    width: 100%;
    max-width: 200px;
    margin: 30px auto 0;
    padding: 12px 0;
    text-align: center;
    background: var(--primary);
    /* Gold */
    color: #000;
    font-weight: 700;
    border-radius: 30px;
    transition: 0.3s;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2);
}

.btn-view-more:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
    background: #fff;
    color: #000;
}



.chapter-chip {
    background: #0f0f0f;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 6px 10px;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #aaa;
    transition: 0.2s;
}

.chapter-chip:hover {
    background: #1a1a1a;
    border-color: var(--primary);
    color: #fff;
}

.chapter-chip span:first-child {
    color: #fff;
    font-weight: 600;
}

.no-chapters {
    text-align: right;
    color: #666;
    font-size: 0.8rem;
    padding: 5px 0;
}

/* RESPONSIVE UPDATES */
@media (max-width: 1100px) {
    .updates-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

.chapter-chip .time {
    font-size: 0.7rem;
    opacity: 0.7;
}

.no-chapters {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.8rem;
    padding: 5px;
    opacity: 0.6;
}

/* SECTION HEAD */
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 15px;
    direction: rtl;
}

.section-head h2 {
    font-size: 1.4rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
}

.section-head h2 i {
    color: var(--primary);
    margin-left: 10px;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .swiper-slide-hero {
        width: 200px;
        height: 300px;
    }

    .slider-nav-btn {
        width: 40px;
        height: 40px;
    }

    .updates-grid {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }

    .update-card {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
        text-align: center;
        background: #0f0f0f;
    }

    .u-poster {
        width: 100%;
        height: auto;
        aspect-ratio: 2/3;
        margin: 0 auto;
        border-radius: 8px;
    }

    .u-info {
        justify-content: flex-start;
        width: 100%;
        text-align: center;
    }

    .u-title {
        font-size: 0.9rem;
        margin-bottom: 10px;
    }

    .chapter-chip {
        justify-content: center;
        gap: 5px;
        background: rgba(255, 255, 255, 0.08);
    }

    .section-head h2 {
        font-size: 1.2rem;
    }
}

/* SYSTEM CLEANUP */
#wpadminbar {
    display: none !important;
}

html {
    margin-top: 0 !important;
}

/* ARYA SCANS SINGLE MANGA CSS */

/* HERO SECTION */
.manga-header {
    position: relative;
    width: 100%;
    min-height: 500px;
    padding-top: 100px;
    padding-bottom: 40px;
    background: #050505;
    overflow: hidden;
}

.header-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.3;
}

.header-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(20px);
}

.header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, var(--bg-void), transparent 50%, var(--bg-void));
    /* var(--bg-dark) is bg-void in style.css */
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.manga-poster {
    width: 280px;
    flex-shrink: 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.manga-poster img {
    width: 100%;
    height: auto;
    display: block;
}

.manga-info {
    flex: 1;
    padding-top: 10px;
}

.manga-badges {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.badge {
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge.hot {
    background: var(--secondary);
    /* Note: check if secondary is defined, style.css has accent. Preview uses secondary=red. Define secondary if missing or use accent */
    background: var(--accent);
    color: #fff;
}

.badge.type {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.badge.status {
    background: var(--primary);
    color: #000;
}

.manga-title {
    font-size: 2.5rem;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 20px;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    color: #fff;
}

.manga-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

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

.meta-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.meta-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
}

.meta-value i {
    color: var(--primary);
    margin-left: 5px;
}

.manga-synopsis {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #ccc;
    margin-bottom: 30px;
    max-width: 800px;
}

.manga-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-action {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    font-size: 1rem;
    transition: 0.3s;
}

.btn-read {
    background: var(--gradient-btn, linear-gradient(135deg, #FFD700 0%, #FFA500 100%));
    /* Fallback to gold/orange if gradient-btn not defined */
    color: #000;
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.2);
}

.btn-read:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.4);
}

.btn-bookmark {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-bookmark:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #fff;
}

/* BODY CONTENT & CHAPTERS */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 80px 20px;
    display: grid;
    grid-template-columns: 1fr 320px;
    /* Sidebar layout */
    gap: 40px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
    color: #fff;
}

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

.toolbar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.search-chapter {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    /* var(--border) */
    padding: 10px 15px;
    border-radius: 8px;
    color: #fff;
    width: 100%;
    max-width: 300px;
}

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

.chapter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.03);
    padding: 15px 20px;
    border-radius: 10px;
    transition: 0.2s;
    cursor: pointer;
    text-decoration: none;
}

.chapter-row:hover {
    background: var(--bg-card-hover);
    /* Check var def */
    background: #151515;
    border-color: var(--primary);
    transform: translateX(-5px);
}

.chap-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.chap-num {
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
}

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

.chap-actions {
    display: flex;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.chap-actions i:hover {
    color: var(--primary);
}

/* SIDEBAR WIDGETS */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.widget {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.widget-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    color: var(--primary);
}

.suggestion-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.suggestion-item:last-child {
    margin-bottom: 0;
}

.s-poster {
    width: 60px;
    height: 90px;
    border-radius: 6px;
    overflow: hidden;
}

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

.s-info h4 {
    font-size: 0.9rem;
    margin-bottom: 5px;
    color: #fff;
}

.s-info span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.genres-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.genre-tag {
    background: rgba(255, 255, 255, 0.05);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: 0.2s;
}

.genre-tag:hover {
    background: var(--accent);
    color: #fff;
}

/* RESPONSIVE SINGLE */
@media (max-width: 900px) {
    .hero-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .manga-info {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .manga-title {
        font-size: 2rem;
    }

    .manga-meta-grid {
        grid-template-columns: 1fr 1fr;
        width: 100%;
        justify-items: center;
    }

    .manga-actions {
        justify-content: center;
        width: 100%;
    }

    .main-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }
}

/* =========================================
   LIBRARY / BOOKMARKS PAGE STYLES
   ========================================= */
.library-header-section {
    background: linear-gradient(to bottom, rgba(21, 22, 28, 0.8), var(--bg-dark)), url('https://w.wallhaven.cc/full/wq/wallhaven-wqve6r.jpg');
    background-size: cover;
    background-position: center 30%;
    padding: 60px 0 40px;
    margin-bottom: 40px;
    position: relative;
    border-bottom: 1px solid var(--glass-border);
}

.user-library-info {
    display: flex;
    align-items: center;
    gap: 25px;
    position: relative;
    z-index: 2;
}

.user-avatar-large {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid var(--accent-gold);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    overflow: hidden;
}

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

.library-title h1 {
    font-size: 2.5rem;
    color: #fff;
    margin-bottom: 10px;
    font-weight: 900;
}

.library-stats {
    display: flex;
    gap: 20px;
    color: var(--text-secondary);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 15px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item i {
    color: var(--accent-gold);
}

/* Library Tabs */
.library-tabs-container {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
    position: sticky;
    top: 60px;
    z-index: 900;
    background: var(--bg-dark);
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.library-tabs {
    display: flex;
    background: var(--bg-secondary);
    padding: 5px;
    border-radius: 40px;
    overflow-x: auto;
    max-width: 100%;
    gap: 5px;
}

.tab-btn {
    padding: 10px 25px;
    border-radius: 30px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.tab-btn.active {
    background: #ffd700 !important;
    /* Force Gold */
    color: #000 !important;
    /* Force Black Text */
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.tab-btn:hover:not(.active) {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

/* Library Grid Overrides */
.library-grid {
    margin-bottom: 60px;
}

/* Progress Bar on Card */
.reading-progress-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.6);
    z-index: 5;
}

.reading-progress-bar {
    height: 100%;
    background: var(--accent-orange);
    box-shadow: 0 0 10px var(--accent-orange);
}

.card-progress-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 5px;
    display: flex;
    justify-content: space-between;
}

.progress-count {
    color: var(--accent-gold);
    font-weight: bold;
}

/* Edit Actions */
.library-actions {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    opacity: 0;
    transition: 0.3s;
}

.manga-card:hover .library-actions {
    opacity: 1;
}

.action-round-btn {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: 0.3s;
}

.action-round-btn:hover {
    background: var(--accent-red);
    border-color: var(--accent-red);
}

/* Section divider */
.status-divider {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 40px 0 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.status-divider span {
    color: var(--accent-gold);
    font-size: 1rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.05);
}

/* Load More Btn (Global or Library specific) */
.load-more-btn {
    background: transparent;
    border: 2px solid var(--accent-gold);
    color: var(--accent-gold);
    padding: 12px 40px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition-fast);
}

.load-more-btn:hover {
    background: var(--accent-gold);
    color: #000;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

@media (max-width: 768px) {
    .library-header-section {
        padding: 40px 0 20px;
        text-align: center;
    }

    .user-library-info {
        flex-direction: column;
        gap: 15px;
    }

    .library-title h1 {
        font-size: 2rem;
    }

    .library-tabs-container {
        justify-content: flex-start;
        padding: 10px 0;
    }
}

/* =========================================
   MOBILE MENU DROPDOWN STYLES
   ========================================= */
.mobile-dropdown-menu {
    display: none;
    position: absolute;
    top: 50px;
    left: 0;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    width: 200px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    padding: 10px;
    flex-direction: column;
}

.mobile-dropdown-menu.active {
    display: flex;
}

.dropdown-item {
    padding: 10px;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
}

.dropdown-item:hover {
    background: var(--bg-secondary);
    color: var(--accent-gold);
}

.mobile-dropdown-menu hr {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 5px 0;
}

/* Hide standard nav on mobile */
@media (max-width: 768px) {
    .nav-menu {
        display: none !important;
    }
}

/* Hide dropdown navigation links on desktop */
/* Hide dropdown navigation links on desktop */
@media (min-width: 769px) {

    .mobile-dropdown-menu hr,
    .mobile-dropdown-menu .dropdown-item:nth-child(n+3) {
        display: none;
    }

    .mobile-dropdown-menu {
        width: 180px;
    }
}

/* =========================================
   SEARCH BAR STYLES (Desktop & Mobile)
   ========================================= */

/* Desktop Search Form */
.desktop-search {
    display: flex;
    align-items: center;
}

.desktop-search form {
    display: flex;
    background: var(--bg-secondary);
    border-radius: 30px;
    padding: 5px 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: 0.3s;
    width: 300px;
}

.desktop-search form:focus-within {
    border-color: var(--accent-gold);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

.desktop-search input {
    background: transparent;
    border: none;
    color: #fff;
    width: 100%;
    outline: none;
    font-family: inherit;
}

.desktop-search button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: 0.3s;
}

.desktop-search button:hover {
    color: var(--accent-gold);
}

/* Mobile Search Icon visibility rules */
.mobile-only {
    display: none;
}

/* Mobile Search Overlay */
.mobile-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 11, 15, 0.95);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-search-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    transition: 0.3s;
}

.mobile-search-close:hover {
    background: var(--accent-red);
    color: #fff;
    transform: rotate(90deg);
}

.mobile-search-form {
    width: 80%;
    max-width: 500px;
    position: relative;
    transform: translateY(30px);
    transition: 0.4s ease;
}

.mobile-search-overlay.active .mobile-search-form {
    transform: translateY(0);
}

.mobile-search-form input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--accent-gold);
    font-size: 1.5rem;
    color: #fff;
    padding: 10px 0;
    text-align: center;
    outline: none;
}

.mobile-search-form button {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--accent-gold);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Responsive Hide/Show Logic */
@media (max-width: 768px) {
    .desktop-search {
        display: none;
    }

    .mobile-only {
        display: inline-flex;
    }
}

/* =========================================
   SEARCH PAGE DESIGN (Legacy Preview)
   ========================================= */
.search-hero-section {
    background: linear-gradient(to bottom, rgba(10, 11, 15, 0.9), var(--bg-dark)), url('https://w.wallhaven.cc/full/wq/wallhaven-wqve6r.jpg');
    background-size: cover;
    background-position: center;
    padding: 80px 0 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* Animated Background Elements */
.hero-glow {
    position: absolute;
    width: 300px;
    height: 300px;
    background: var(--accent-red);
    filter: blur(150px);
    opacity: 0.2;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: pulse-glow 4s infinite alternate;
}

@keyframes pulse-glow {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.1;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.3;
    }
}

.search-container-large {
    width: 100%;
    max-width: 800px;
    position: relative;
    z-index: 10;
    padding: 20px;
}

.search-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 30px;
    color: #fff;
    text-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

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

.super-search-bar {
    background: rgba(30, 32, 41, 0.9);
    border: 2px solid rgba(255, 215, 0, 0.2);
    border-radius: 20px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.super-search-bar:focus-within {
    border-color: var(--accent-gold);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.2);
    transform: scale(1.02);
}

.super-search-bar i.search-icon {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-left: 15px;
}

.super-search-bar input {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    width: 100%;
    padding: 10px 0;
    outline: none;
    font-family: inherit;
}

.super-search-bar .filter-toggle-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: none;
    padding: 10px 15px;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.super-search-bar .filter-toggle-btn:hover,
.super-search-bar .filter-toggle-btn.active {
    background: var(--accent-gold);
    color: #000;
}

/* Filter Drawer */
.advanced-filters {
    max-height: 0;
    overflow: hidden;
    background: var(--bg-card);
    border-radius: 0 0 20px 20px;
    margin-top: -20px;
    padding-top: 30px;
    width: 100%;
    max-width: 780px;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-top: none;
    transition: max-height 0.5s cubic-bezier(0, 1, 0, 1), padding 0.3s;
    opacity: 0;
    position: relative;
    z-index: 5;
}

.advanced-filters.open {
    max-height: 500px;
    padding: 40px 25px 25px;
    opacity: 1;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.filter-col {
    flex: 1;
    min-width: 150px;
}

.filter-label {
    display: block;
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-size: 0.9rem;
    font-weight: 700;
}

/* Chip Groups */
.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-chip {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ccc;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: 0.2s;
}

.filter-chip:hover {
    border-color: var(--accent-gold);
    color: #fff;
}

/* Force Active Chip Style */
.search-hero-section .filter-chip.active,
.chip-group .filter-chip.active {
    background-color: #ffd700 !important;
    /* Gold */
    color: #000000 !important;
    /* Black */
    border-color: #ffd700 !important;
    font-weight: 800 !important;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5) !important;
}

/* Quick Tags / Trending */
.trending-searches {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    z-index: 10;
}

.trend-tag {
    color: var(--text-secondary);
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 5px 12px;
    border-radius: 8px;
    text-decoration: none;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.trend-tag:hover {
    color: var(--accent-orange);
    background: rgba(255, 140, 0, 0.1);
    transform: translateY(-2px);
}

.trend-tag i {
    color: var(--accent-red);
    font-size: 0.8rem;
}

/* Search Results Grid Header */
.results-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

.results-count {
    font-size: 1.1rem;
    color: #fff;
}

.results-count strong {
    color: var(--accent-gold);
}

/* Mobile Optimization */
@media (max-width: 768px) {
    .search-hero-section {
        padding: 40px 15px;
    }

    .search-title {
        font-size: 1.8rem;
    }

    .super-search-bar {
        padding: 8px 15px;
    }

    .super-search-bar input {
        font-size: 1rem;
    }

    .advanced-filters {
        max-width: 100%;
        border-radius: 15px;
    }

    .filter-row {
        flex-direction: column;
        gap: 15px;
    }

    .results-info {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
}

/* =========================================
   SEARCH RESULT IMAGE FIX
   ========================================= */
.manga-grid .manga-card .card-image img {
    height: 100%;
    width: 100%;
    object-fit: cover !important;
    aspect-ratio: 2/3;
    max-width: 100%;
    border-radius: 10px;
}

.manga-card {
    max-width: 100%;
}

/* Ensure grid layout for search results */
.search-results .magma-grid,
.manga-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    width: 100%;


}

/* =========================================
   GLOBAL FIXES
   ========================================= */

/* Fix Filter Button Hover - Force Gold Background via ID */
#magma-filter-btn:hover,
#magma-filter-btn:active,
#magma-filter-btn:focus {
    background: #ffd700 !important;
    background-color: #ffd700 !important;
    color: #000000 !important;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6) !important;
    border: 1px solid #ffd700 !important;
    opacity: 1 !important;
    transform: translateY(-2px);
}

/* =========================================
   LOAD MORE BUTTON (Search Page)
   ========================================= */
@keyframes floatY {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-6px);
    }

    100% {
        transform: translateY(0px);
    }
}

#magma-load-more-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #ffd700 !important;
    color: #000 !important;
    font-weight: 800;
    padding: 12px 35px;
    border-radius: 50px;
    text-decoration: none;
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.3) !important;
    border: 2px solid #ffd700;
    transition: all 0.3s ease;
    animation: floatY 2.5s ease-in-out infinite;
    cursor: pointer;
}

#magma-load-more-btn:hover {
    background: transparent !important;
    color: #ffd700 !important;
    box-shadow: 0 5px 30px rgba(255, 215, 0, 0.5) !important;
    transform: translateY(-5px) scale(1.05);
    animation-play-state: paused;
}

/* =========================================
   NEW MANGA PAGE DESIGN (Manga Preview)
   ========================================= */
/* =========================================
   NEW MANGA PAGE DESIGN (Manga Preview)
   ========================================= */
.manga-hero {
    position: relative;
    min-height: 550px;
    display: flex;
    align-items: flex-end;
    padding-top: 100px;
    /* Safe padding for PC header */
    padding-bottom: 60px;
    overflow: hidden;
    /* margin-top: -60px; REMOVED to stop overlap */
    overflow: visible !important;
    /* Allow dropdowns to spill out */
}

.hero-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(10px) brightness(0.3);
    z-index: 0;
    mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
}

.hero-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, var(--bg-dark), transparent 90%);
    z-index: 1;
}

.manga-header-content {
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    width: 100%;
    align-items: flex-end;
    overflow: visible !important;
    /* Critical for dropdowns */
}

/* Poster Area */
.manga-poster {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(255, 215, 0, 0.2);
    position: relative;
    aspect-ratio: 2/3;
}

.manga-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: 0.3s;
}

.manga-poster:hover img {
    transform: scale(1.05);
}

/* Info Area */
.manga-info-header {
    color: #fff;
    padding-bottom: 10px;
}

.manga-tags {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.meta-tag {
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
    color: #ddd;
}


.meta-tag.rank {
    background: linear-gradient(45deg, #FFD700, #FFA500) !important;
    color: #000 !important;
    font-weight: 800;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.manga-title-large {
    font-size: 3rem;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 20px;
    text-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.manga-rating-large {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.5rem;
    margin-bottom: 30px;
    color: #FFD700;
}

.rating-stars {
    display: flex;
    gap: 5px;
}

/* Action Buttons */
.action-buttons-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-large {
    padding: 12px 35px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary-glow {
    background: linear-gradient(135deg, #FFD700, #FFA500) !important;
    color: #000 !important;
    box-shadow: 0 0 20px rgba(255, 140, 0, 0.3) !important;
}

.btn-primary-glow:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 30px rgba(255, 140, 0, 0.5) !important;
    color: #000 !important;
}

.btn-secondary-glass {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
}

.btn-secondary-glass:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #fff;
    color: #fff;
}

/* Library Dropdown Wrapper */
.library-dropdown-wrapper {
    position: relative;
}

.library-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    width: 220px;
    background: #111;
    /* Solid dark background */
    border: 1px solid rgba(255, 215, 0, 0.2);
    /* Gold border */
    border-radius: 12px;
    padding: 10px;
    margin-top: 10px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.9);
    z-index: 9999;
    /* Ensure it stays on top */
}

.library-dropdown-wrapper:hover .library-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.lib-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
}

.lib-option:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.lib-option i {
    width: 20px;
    text-align: center;
}

/* Main Content Grid */
.manga-content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    padding: 40px 0;
}



/* Story/Synopsis */
.story-section {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 30px;
}

.section-heading {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--accent-gold);
    display: flex;
    align-items: center;
    gap: 10px;
}

.story-text {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 1.05rem;
}

/* Genres Tag Cloud */
.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-tag {
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 14px;
    border-radius: 20px;
    color: #ccc;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: 0.2s;
    text-decoration: none;
}

.filter-tag:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

/* Chapters List NEW DESIGN */
.chapters-container {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.chapter-search-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 15px;
    align-items: center;
}

.chapter-search {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 15px;
    color: #fff;
    outline: none;
}

.chapters-list {
    max-height: 600px;
    overflow-y: auto;
    padding-right: 5px;
    /* Adjust for scrollbar */
}

/* Scrollbar styling for chapters */
.chapters-list::-webkit-scrollbar {
    width: 5px;
}

.chapters-list::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 5px;
}

.chapter-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: 0.2s;
    text-decoration: none;
    color: #fff;
}

.chapter-item:hover {
    background: rgba(255, 215, 0, 0.05);
    padding-right: 20px;
    border-radius: 8px;
}

.chap-num {
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.chap-new-badge {
    background: var(--accent-red);
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 10px;
}

/* Sidebar Info */
.info-sidebar .info-box {
    background: var(--bg-card);
    border-radius: 15px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 20px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.95rem;
}

.info-row:last-child {
    border: none;
}

.info-label {
    color: var(--text-secondary);
}

.info-val {
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Comments Section Style (Manga Preview Match) */
.comments-section {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 30px;
}

.comment-input-area {
    background: var(--bg-secondary);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.comment-textarea {
    width: 100%;
    background: transparent;
    border: none;
    color: #fff;
    min-height: 80px;
    resize: vertical;
    outline: none;
    font-family: inherit;
    margin-bottom: 15px;
}

.comment-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.comment-submit-btn {
    background: var(--accent-gold);
    color: #000;
    border: none;
    padding: 8px 25px;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
}

.comment-submit-btn:hover {
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
    transform: translateY(-2px);
}

.comment-item {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 25px;
}

.comment-item:last-child {
    border: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.comment-avatar img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid var(--accent-gold);
}

.comment-content {
    flex: 1;
}

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

.comment-author {
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
}

.comment-author .badge {
    background: var(--accent-red);
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 5px;
}

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

.comment-text {
    color: #ddd;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 12px;
}

.comment-footer {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.comment-action {
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.comment-action:hover {
    color: var(--accent-gold);
}

.comment-replies {
    margin-right: 60px;
    /* Indent for RTL */
    margin-top: 20px;
    border-right: 2px solid rgba(255, 255, 255, 0.1);
    padding-right: 20px;
}

/* Mobile Responsive */
@media (max-width: 900px) {
    .manga-header-content {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
        align-items: center;
        gap: 20px;
    }

    .manga-poster {
        width: 200px;
        margin-top: 20px;
    }

    .manga-hero {
        align-items: center;
        padding-top: 120px;
    }

    .manga-tags,
    .manga-rating-large,
    .action-buttons-group {
        justify-content: center;
    }

    .manga-title-large {
        font-size: 2rem;
    }

    .manga-content-grid {
        grid-template-columns: 1fr;
        display: flex;
        flex-direction: column;
    }

    .main-column {
        order: 2;
    }

    .info-sidebar {
        order: 1;
        /* Keep info at top or adjust as needed */
        margin-bottom: 30px;
    }
}

/* =========================================
   PREMIUM SCROLL TO TOP (#totop)
   ========================================= */
#totop {
    position: fixed;
    bottom: 30px;
    right: 35px;
    /* Increased to 35px to clear the scrollbar comfortably */
    left: auto;
    width: 45px;
    height: 45px;
    background: var(--accent-gold, #FFD700);
    color: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform: translateY(20px) scale(0.8);
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.4);
    border: 2px solid rgba(0, 0, 0, 0.1);
}

#totop.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

#totop:hover {
    background: #fff;
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 30px rgba(255, 215, 0, 0.6);
}

#totop i {
    font-size: 1.2rem;
    transition: 0.3s;
}

#totop:hover i {
    transform: translateY(-2px);
}

/* Force it to stay on the right even in RTL if requested */
[dir="rtl"] #totop {
    right: 35px;
    left: auto;
}

/* Mobile Tweaks */
@media (max-width: 768px) {
    #totop {
        bottom: 80px;
        width: 40px;
        height: 40px;
        right: 20px;
    }

    [dir="rtl"] #totop {
        right: 20px;
        left: auto;
    }
}