/* Extracted from head.php */
:root {
    --primary-color: #28a745;
    --primary-hover: #218838;
    --accent-color: #28a745;
    --dark-bg: #121212;
    --dark-card: #1e1e1e;
    --text-primary: #e0e0e0;
    --text-muted: #b0b0b0;
    --border-radius: 8px;
    --border-radius-pill: 50px;
}

:root {
    --primary-color: #28a745;
    --primary-hover: #218838;
    --accent-color: #28a745;
    --dark-bg: #121212;
    --dark-card: #1e1e1e;
    --text-primary: #e0e0e0;
    --text-muted: #b0b0b0;
    --border-radius: 8px;
    --border-radius-pill: 50px;
}

.releases {
    /* Dynamic PHP values replaced with generic fallback or must be handled via inline style for variables only */
    /* Note: PHP variables $warna_background and $warna_text were used here.
       Use specific classes or CSS variables if dynamic.
       For now, we keep the structure but note that dynamic colors might need inline override or CSS vars. */
    background: #222;
    /* Fallback */
    color: #fff !important;
    /* Fallback */
    text-transform: uppercase;
}

.logo-resp img {
    height: 50px;
}

h1.mb-4.pt-2.text-2xl.text-center.font-bold.leading-none.tracking-tight.md\:text-3xl.lg\:text-6xl.text-white img {
    display: none !important;
}

h1.mb-4.pt-2.text-2xl.text-center.font-bold.leading-none.tracking-tight.md\:text-3xl.lg\:text-6xl.text-white {
    text-align: center;
    text-transform: uppercase;
}

nav.flex.z-50.w-full.h-auto.items-center.justify-center.top-0.translate-y-0.mt-0.mb-5.relative.inset-x-0.nav-transition.transition-all.duration-250.bg-transparent,
.ads-section,
div.w-full.ring-1.ring-primary\/75.bg-secoring-primary\/15.text-gray-100.h-64.flex.items-center.justify-center,
div.shrink-0.bg-secondary\/75.h-\[1px\].w-full.my-3,
nav.flex.z-50.w-full.h-auto.items-center.justify-center.top-0.translate-y-0.mt-0.mb-5.relative.inset-x-0.nav-transition.transition-all.duration-250.bg-primary\/80.backdrop-blur-md,
div.max-w-7xl.w-full.mx-auto,
.w-full.mx-auto.my-5,
#floatPopup,
.widget_text.widget.widget_custom_html,
.flex.justify-center.my-5.col-span-full.w-full,
.w-\[90\%\].mx-auto.h-0\.5.bg-secondary.flex.items-center.justify-center.my-5.md\:my-10.text-accent,
#search-chapter,
button[data-key="reviews"],
button[data-key="gallery"],
#chapter-control-button,
svg[data-lucide="search"],
.border-2.bg-secondary\/30.text-white.border-tertiary.h-10.aspect-square.flex.items-center.justify-center.transition-all.duration-200.ease-in-out.opacity-100.px-3.py-2.rounded-lg.text-sm.leading-4,
.w-full.sm\:w-\[80\%\].mx-auto.mt-2,
#search-novel-chapter {
    display: none !important;
}

.flex.items-center.gap-2.my-3.text-gray-50.opacity-0.transition-all.duration-300 {
    opacity: 1 !important;
    color: white;
    margin-top: 50px !important;
}

.item-center.overflow-hidden.text-ellipsis.whitespace-nowrap.w-30.text-xs.font-semibold p {
    margin-bottom: 0px;
}

h1,
h2,
.jdl,
.post-title,
.entry-title {
    font-size: 25px !important;
    margin-bottom: 0.5rem;
    margin-top: 0;
    color: white !important;
    text-align: center;
}

/* Force Center Alignment for Action Buttons in Header */
.header-content,
.spe,
.rt,
.bookmark-section,
.ts-breadcrumb {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    text-align: center;
}

/* Detail Page Real Estate */
/* STANDARD: Boostrap XL Container Override */
.container.detail,
.container#readerarea {
    width: 100% !important;
    max-width: 1200px !important;
    /* Standardize */
    margin: 0 auto;
    padding-left: 15px;
    padding-right: 15px;
}

/* Reader Specific: Allow wider but not full edge-to-edge unless immersive */
.container#readerarea {
    max-width: 1000px !important;
    /* Slightly narrower for reading focus */
}

/* Synopsis Visibility & Global Contrast Fix */
.entry-content,
.sinopsis,
.summary,
.container.detail p,
.container.detail span,
.container.detail div {
    color: var(--text-primary) !important;
    line-height: 1.8;
    /* Better breathing room */
    margin-bottom: 1rem;
    /* Spacing between paragraphs */
}

/* Fix narrow synopsis entry */
.entry-content {
    text-align: justify;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

/* Revert contrast for specific badges/buttons to keep them styled if needed */
.container.detail .btn,
.container.detail .badge {
    color: white !important;
}

div.flex.justify-between.gap-6.bg-white\/10.p-4.rounded-lg {
    display: none !important;
}

.header-manga {
    display: block !important;
    z-index: 99999;
    position: relative;
}

.hero-slider .swiper-slide {
    width: 33.5% !important;
    margin-right: 15px;
}

.card {
    padding-inline: 0px;
    background-color: #00000000;
}

.title.bottom-0.right-2 {
    position: absolute;
    bottom: -40px !important;
    left: 0;
}

.title.bottom-0.right-2 h4 {
    font-size: 16px;
    color: white;
}

.flex.details.justify-between.pt-2 {
    padding: 0px 15px;
    color: white;
}

.lucide.lucide-star.h-auto.w-4.text-amber-400 {
    margin-top: -15px;
}

.lucide.lucide-flame.h-5.w-5.ml-2.inline-block.align-middle {
    margin-top: -5px;
}

.swiper.max-h-lg.pb-7 {
    overflow: scroll;
}

.widget {
    max-width: 100%;
}

.text-\[15px\].text-gray-100.overflow-hidden.font-bold.text-center.line-clamp-2.capitalize.hover\:text-primary-500 {
    font-size: 12px !important;
}

.flex.items-center.gap-1.font-normal.text-xs p {
    margin-bottom: 0px;
}

.m-0.text-sm.text-white.overflow-hidden.text-left.capitalize.hover\:text-primary-500.line-clamp-2 {
    font-size: 14px !important;
}

.font-semibold.text-base.text-gray-100.flex.items-center.justify-start {
    font-size: 14px !important;
    margin: 0px;
    padding: 0px;
    display: flex;
    align-items: center;
    /* Vertical Center */
    height: 100%;
}

/* Fix Sidebar Ranking Number */
.font-semibold.text-base.text-gray-100.flex.items-center.justify-start span {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
}

.w-full.border-secondary\/75.bg-primary\/15.text-gray-100.h-64.flex.items-center.justify-center {
    position: relative;
}

/* Removed problematic absolute positioning for chapter list */
.mt-4.space-y-2.overflow-auto.max-h-\[512px\] {
    position: relative !important;
    top: auto !important;
    margin-top: 1rem !important;
    /* Restore mt-4 behavior */
    width: 100%;
}

.text-2xl.font-bold.transition-all.duration-300.ease-in-out.text-text {
    margin-bottom: 0px;
    font-size: 16px !important;
    color: white;
}

.flex.items-center.justify-between svg {
    width: 20px !important;
}

#heart-svg {
    width: 30px !important;
    color: white;
}

.page {
    padding: 0px;
}

.grow.container.mx-auto.flex.gap-0.lg\:gap-6.p-3.lg\:p-6 .lg\:py-6.lg\:block {
    display: none;
}

.w-full.flex.flex-col.text-white.grow {
    width: 100% !important;
}

.flex.justify-start.items-center.gap-2.sm\:justify-between {
    border-bottom: solid 1px #333;
    /* Darker grey border */
    padding: 5px;
}

#search-main-query {
    padding: 5px;
}

.grid.group.mb-6.data-\[mode\=horizontal\]\:grid-cols-1.data-\[mode\=horizontal\]\:lg\:grid-cols-2.grid-cols-2.md\:grid-cols-4.gap-x-4.lg\:gap-x-3.xl\:grid-cols-6.gap-y-4.min-h-\[350px\] {
    min-height: auto;
}

.adsban-manga img {
    margin-bottom: 10px;
    position: relative;
    z-index: 9999;
}

.ads-fixed-bottom {
    position: fixed;
    bottom: 0px;
    text-align: center;
    left: 0px;
    right: 0px;
    z-index: 99999;
    /* Ensure it doesn't overlap reader nav */
    pointer-events: none;
    /* Let clicks pass through if empty */
}

.ads-fixed-bottom img {
    margin: auto;
    width: 50%;
}

#floatPopup.ads-popup-fixed {
    display: block !important;
    position: fixed;
    top: 35%;
    left: 43% !important;
    z-index: 99999;
    width: 100%;
}


@media (max-width: 600px) {
    .hero-slider .swiper-slide {
        width: 100% !important;
        margin-right: 15px;
    }

    /* FIX: Popular Today / Project Updates Mobile Clipping */
    .title.bottom-0.right-2 {
        bottom: 0px !important;
        position: relative !important;
        padding: 5px;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    }

    .title.bottom-0.right-2 h4 {
        white-space: normal !important;
        /* Allow wrapping */
        font-size: 13px !important;
        line-height: 1.2;
        display: -webkit-box;
        line-clamp: 2;
        -webkit-line-clamp: 2;
        /* Limit to 2 lines */
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* Enhance Grid for Mobile */
    .grid.group {
        grid-template-columns: repeat(2, 1fr) !important;
        /* Force 2 columns */
        gap: 10px !important;
    }

    .project.group.rounded.text-gray-50.p-4,
    .latest.group.rounded.text-gray-50.group.p-4,
    .latest-novel.group.rounded.text-gray-50.group.p-4,
    .rounded-lg.text-white.p-4.md\:p-0,
    .p-4.md\:p-0 {
        padding: 0px !important;
    }

    .home,
    .detail,
    .terebody {
        margin-top: 5px !important;
    }

    .border-2.bg-secondary\/30.text-white.border-tertiary.ml-auto.h-10.flex.lg\:hidden.items-center.justify-center.transition-all.duration-200.ease-in-out.opacity-100.hover\:opacity-80.px-3.py-2.rounded-lg.text-sm.leading-4,
    [data-bookmark-wrapper="mobile"].text-sm.md\:text-base {
        display: none !important;
    }

    .latest.group.rounded.text-gray-50.group.p-4 {
        margin-top: 30px !important;
    }

    .ads-fixed-bottom img {
        margin: auto;
        width: 94%;
    }

    #floatPopup.ads-popup-fixed {
        left: 24% !important;
    }
}

/* GLOBAL PREMIUM UI ENHANCEMENTS */

/* 1. Glassmorphism for Cards & Sections */
.card,
.infox,
.bs,
.listupd,
.imptdt {
    background: rgba(25, 25, 25, 0.8) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

/* 2. Hover Effects (Lift & Glow) */
.card:hover,
.listupd:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    background: rgba(35, 35, 35, 0.9) !important;
    border-color: rgba(255, 255, 255, 0.2);
}

/* 3. Image Zoom on Hover */
.card .ratio img,
.listupd img,
.bs .section-item img {
    transition: transform 0.5s ease;
    aspect-ratio: 3/4;
    object-fit: cover;
    width: 100%;
}

.card:hover .ratio img,
.listupd:hover img {
    transform: scale(1.05);
}

/* 4. Smooth Button Interactions */
.btn {
    transition: all 0.2s ease;
}

.btn:active {
    transform: scale(0.95);
}

/* 5. Scrollbar Polish */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* BRANDING WATERMARK */
.brand-watermark {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
    opacity: 0.6;
    pointer-events: none;
}

.brand-watermark img {
    width: 80px;
    height: auto;
}

/* Floating CTA (Start Reading) */
.floating-cta {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: none;
    /* Hidden by default, shown via JS on specific scroll or always on mobile */
}

@media (max-width: 768px) {
    .floating-cta {
        display: block;
        bottom: 10px;
        right: 10px;
        left: 10px;
    }

    .floating-cta .btn {
        width: 100%;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
        font-size: 1.2rem;
        padding: 12px;
    }
}


/* ----------------------------------------------------------- */
/* PHASE 2: MOBILE RESPONSIVENESS (HERO METADATA FIX) */
/* ----------------------------------------------------------- */
@media (max-width: 480px) {

    /* Fix Cramped Status/Type in Hero */
    .imptdt,
    .spe,
    .infox {
        font-size: 12px !important;
        padding: 8px !important;
    }

    /* Wrap flex containers to prevent overflowing */
    .imptdt div,
    .spe div {
        flex-wrap: wrap !important;
        gap: 4px !important;
    }

    /* Reduce icon sizes */
    .imptdt i,
    .imptdt svg,
    .spe i,
    .spe svg {
        width: 14px !important;
        height: 14px !important;
        margin-right: 2px !important;
    }

    /* Ensure text doesn't overflow */
    .imptdt span,
    .spe span {
        white-space: normal !important;
    }

    /* Optimize Rating Stars */
    .rating-stars,
    .num {
        font-size: 11px !important;
    }
}

/* Fix Genre Tags Layout */
.genre {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.genre .btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: auto !important;
    margin: 0 !important;
    /* Managed by gap */
    padding: 6px 12px !important;
    font-size: 13px !important;
    flex: none !important;
    border-radius: var(--border-radius-pill);
    transition: all 0.2s ease;
}

.genre .btn:hover {
    transform: translateY(-2px);
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* ----------------------------------------------------------- */
/* PHASE 3: PREMIUM DARK THEME (BRAND OVERRIDES) */
/* ----------------------------------------------------------- */

:root {
    --primary-color: #28a745;
    /* Brand Green */
    --primary-hover: #218838;
    --accent-color: #28a745;
    /* Unified Accent */
    --dark-bg: #121212;
    --dark-card: #1e1e1e;
    --text-primary: #e0e0e0;
}

.bg-dark-bg {
    background-color: var(--dark-bg) !important;
}

.text-text-primary {
    color: var(--text-primary) !important;
}

/* Override Bootstrap Primaries */
.btn-primary,
.bg-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.btn-primary:hover {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
}

/* Action Buttons (Read, Next) - Use Accent Green */
.btn-success,
#btn-start-reading-float,
.btn-next {
    background-color: var(--accent-color) !important;
    border-color: var(--accent-color) !important;
    box-shadow: 0 0 15px rgba(40, 167, 69, 0.4);
}

/* Clean up Search/Inputs */
input.form-control {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    backdrop-filter: blur(5px);
}

input.form-control::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

/* READER LAYOUT FIXES (Desktop Width) */
@media (min-width: 1024px) {

    /* Widen the container for better reading */
    .container.detail {
        max-width: 1200px !important;
    }

    .container#readerarea {
        max-width: 900px !important;
        /* Focus reading width */
    }

    /* Ensure images don't stretch weirdly but fill space */
    #readerarea img {
        width: auto;
        max-width: 100%;
        margin: 0 auto;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    }
}

/* Sticky Footer Polish */
.reader-nav-bar {
    background: rgba(20, 20, 20, 0.95) !important;
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* ----------------------------------------------------------- */
/* PHASE 4: DETAIL PAGE & LAYOUT REPAIRS */
/* ----------------------------------------------------------- */

/* 1. Global Dark Theme Enforcement */
/* Ensures consistent background across Detail, Play, and Genre pages */
body {
    background-color: #121212 !important;
    color: #e0e0e0 !important;
}

/* 2. Fix 'Green Blocks' (Source Theme Leakage) */
/* Neutralize source classes that inject bright backgrounds */
.bg-accent-2,
.bg-accent-3,
.bg-secondary {
    background-color: #1e1e1e !important;
    /* Dark Card Color */
    color: #e0e0e0 !important;
}

/* 3. Detail Page Typography & Visibility */
/* Fix invisible titles on dark background */
h1.entry-title,
.entry-title {
    color: #ffffff !important;
    font-weight: 700 !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Fix Meta Info (Status, Released, etc.) */
.spe,
.imptdt {
    color: #b0b0b0 !important;
}

.spe span,
.imptdt i {
    color: #28a745 !important;
    /* Accent Green for labels */
}

/* 4. Fix Layout Overlap (Serialization Text) */
/* Prevent long text from breaking layout */
.spe,
.imptdt {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    margin-bottom: 4px;
}

.spe span,
.imptdt span {
    white-space: normal !important;
    overflow-wrap: break-word;
    max-width: 100%;
}

/* 5. Tidy Up Genre Tags */
.genxed,
.genre-info {
    margin-top: 10px;
}

.genxed a,
.genre-info a {
    display: inline-block;
    background: #333 !important;
    color: #fff !important;
    padding: 4px 10px;
    border-radius: 15px;
    margin: 2px;
    font-size: 11px;
    text-decoration: none;
    border: 1px solid #444;
}

.genxed a:hover {
    background: #28a745 !important;
    border-color: #28a745;
}

/* 6. Chapter List Cleanup */
#chapter-list-container li,
.clstyle li {
    border-bottom: 1px solid #333 !important;
    /* Softer border */
    padding: 8px 0;
}

#chapter-list-container li:last-child {
    border-bottom: none !important;
}

.clstyle li .chapternum,
.eph-num a {
    color: #fff !important;
}

.clstyle li .chapterdate {
    color: #888 !important;
    font-size: 11px;
}

/* 7. Tabs Styling (Synopsis vs Chapters) */
.ts-tabs-tabs li a {
    background: #1e1e1e !important;
    color: #888 !important;
    border: none !important;
}

.ts-tabs-tabs li.active a,
.ts-tabs-tabs li[aria-selected='true'] a {
    background: #28a745 !important;
    /* Active Green */
    color: #fff !important;
    font-weight: bold;
}


/* MANGA LIST LAYOUT REPAIR (GRID/LIST TOGGLE) */
#search-lazyload.grid-container[data-mode='vertical'] {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
}

/* Use Flex Column for Horizontal (List) Mode */
#search-lazyload.grid-container[data-mode='horizontal'] {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Explicitly Hide Redundant Elements based on Mode */
[data-mode='vertical'] .group-data-\[mode\=vertical\]\:hidden {
    display: none !important;
}

[data-mode='horizontal'] .group-data-\[mode\=horizontal\]\:hidden {
    display: none !important;
}

/* FIX: Oversized 'Download' text in Chapter List */
#chapter-list-container p.xl\:text-2xl,
#chapter-list-container p.text-2xl,
#chapter-list-container li p[class*="text-2xl"] {
    font-size: 13px !important;
    line-height: normal;
    margin-bottom: 0;
}

/* =========================================
   HERO SECTION STYLES (Semantic Refactor)
   ========================================= */

.hero-wrapper {
    position: relative;
    width: 100%;
    height: 50vh;
    min-height: 500px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 2rem;
    background: #000;
}

/* Background Layer */
.hero-bg-container {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
}

.hero-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(20px) brightness(0.6);
    transform: scale(1.1);
    /* Prevent blur edges */
    opacity: 0.5;
}

.hero-bg-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, #141414 10%, rgba(20, 20, 20, 0.8) 50%, transparent 100%);
    z-index: 1;
}

/* Content Layer */
.hero-content {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem 3rem 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Cover Art */
.hero-cover-art-box {
    margin-bottom: 1.5rem;
    position: relative;
    transition: transform 0.3s ease;
}

.hero-cover-art-box:hover {
    transform: scale(1.05);
}

.hero-cover-art-inner {
    width: 220px;
    aspect-ratio: 3/4;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    border: 4px solid #2a2a2a;
    position: relative;
    z-index: 2;
}

.hero-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-glow {
    position: absolute;
    inset: -20px;
    background: radial-gradient(circle, rgba(40, 167, 69, 0.4) 0%, transparent 70%);
    z-index: 1;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.hero-cover-art-box:hover .hero-glow {
    opacity: 1;
}

/* Title */
.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.5rem;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.8);
    line-height: 1.2;
    max-width: 900px;
    text-transform: capitalize;
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 3.5rem;
    }
}

/* Meta Data */
.hero-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    color: #ccc;
    background: rgba(0, 0, 0, 0.4);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-status {
    color: #4ade80;
    /* bright green */
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.hero-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #facc15;
    /* yellow */
    font-weight: 600;
}

.hero-rating svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Actions */
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    width: 100%;
}

.btn-hero-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #28a745, #1e7e34);
    color: white !important;
    padding: 12px 32px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
    transition: all 0.3s ease;
    border: none;
}

.btn-hero-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.6);
    color: white;
}

.btn-hero-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(30, 30, 30, 0.8);
    color: white;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-hero-secondary:hover {
    background: rgba(50, 50, 50, 0.9);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

/* Standardize Icon Sizes */
.hero-actions svg {
    width: 20px;
    height: 20px;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .hero-wrapper {
        min-height: auto;
        height: auto;
        padding-top: 80px;
        /* Space for navbar */
        padding-bottom: 2rem;
    }

    .hero-bg-img {
        height: 120%;
        /* Taller to cover scroll bounce */
    }

    .hero-cover-art-inner {
        width: 160px;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .btn-hero-primary,
    .btn-hero-secondary {
        padding: 10px 24px;
        font-size: 0.95rem;
        width: 100%;
        /* Full width on mobile */
        justify-content: center;
        max-width: 280px;
    }
}

/* =========================================
   PHASE 6: VISUAL CONSISTENCY CLEANUP
   (Analyst & Developer Audit - 2026-01-18)
   ========================================= */

/* 1. MANGA LIST: Enforce CSS Grid */
.grid-container,
#search-lazyload.grid-container {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)) !important;
    gap: 1.5rem !important;
}

/* Target only the vertical card when in vertical mode */
.grid-container[data-mode="vertical"] .group-data-\[mode\=vertical\]\:flex {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
}

/* Ensure hidden items stay hidden */
.grid-container[data-mode="vertical"] .group-data-\[mode\=vertical\]\:hidden,
.grid-container[data-mode="horizontal"] .group-data-\[mode\=horizontal\]\:hidden {
    display: none !important;
}

.grid-container img {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    border-radius: 8px;
}

/* 2. HOMEPAGE: Project Updates Alignment */
.project .swiper-slide .flex.flex-col {
    justify-content: space-between;
    height: 100%;
}

.project .link-first-div,
.project .flex.items-center.justify-between {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.project .link-first-div span,
.project .text-xs {
    font-size: 0.85rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 3. READER PAGE: Navigation Bar Anchor */
.reader-nav-bar {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 1.5rem !important;
    padding: 1.5rem 0 !important;
    background: rgba(18, 18, 18, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    width: 100% !important;
    margin: 0 auto !important;
}

.reader-nav-bar a.btn,
.reader-nav-bar button {
    min-width: 120px;
    text-align: center;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    height: 44px;
}

/* 4. GLOBAL: Spacing Utility Fixes */
.section-title,
h2.mb-4 {
    margin-bottom: 1.5rem !important;
    padding-bottom: 0.5rem;

    /* =========================================
   PHASE 10: DETAIL PAGE OVERHAUL
   (Addressing "Messy" Typography & List)
   ========================================= */

    /* 1. Content Body Isolation & Typography */
    .content-body {
        color: #e0e0e0;
        line-height: 1.6;
        font-size: 1rem;
    }

    .content-body h1,
    .content-body h2,
    .content-body h3 {
        color: #fff;
        margin-top: 1.5rem;
        margin-bottom: 1rem;
        font-weight: 600;
    }

    .content-body h2 {
        font-size: 1.5rem;
        border-bottom: 2px solid var(--primary-color);
        padding-bottom: 0.5rem;
        display: inline-block;
    }

    .content-body p {
        margin-bottom: 1rem;
        color: #cccccc;
    }

    /* 2. Metadata Contrast Fix */
    .imptdt {
        background: rgba(255, 255, 255, 0.05);
        padding: 10px;
        border-radius: 6px;
        margin-bottom: 15px;
        border-left: 3px solid var(--primary-color);
    }

    .imptdt i {
        color: #fff !important;
        font-style: normal;
        font-weight: 500;
    }

    .imptdt a {
        color: var(--primary-color) !important;
        text-decoration: none;
    }

    /* 3. Modern Chapter List (Touch-Friendly Rows) */
    #chapter_list,
    .clstyle {
        list-style: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    #chapter_list li,
    .clstyle li {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 15px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        transition: background 0.2s;
    }

    #chapter_list li:hover,
    .clstyle li:hover {
        background: rgba(255, 255, 255, 0.03);
    }

    /* Chapter Link Stylization */
    #chapter_list li a,
    .clstyle li a {
        color: #fff !important;
        font-weight: 500;
        font-size: 0.95rem;
        text-decoration: none;
        display: block;
        flex-grow: 1;
        /* Clickable area expands */
    }

    /* Download/Date span alignment */
    #chapter_list li span,
    .clstyle li span {
        font-size: 0.8rem;
        color: #888;
        margin-left: 10px;
    }

    /* Remove ugly bullets/tables if scraping legacy */
    /* 1. Content Body Isolation & Typography */
    .content-body {
        color: #e0e0e0;
        line-height: 1.6;
        font-size: 1rem;
    }

    .content-body h1,
    .content-body h2,
    .content-body h3 {
        color: #fff;
        margin-top: 1.5rem;
        margin-bottom: 1rem;
        font-weight: 600;
    }

    .content-body h2 {
        font-size: 1.5rem;
        border-bottom: 2px solid var(--primary-color);
        padding-bottom: 0.5rem;
        display: inline-block;
    }

    .content-body p {
        margin-bottom: 1rem;
        color: #cccccc;
    }

    /* 2. Metadata Contrast Fix */
    .imptdt {
        background: rgba(255, 255, 255, 0.05);
        padding: 10px;
        border-radius: 6px;
        margin-bottom: 15px;
        border-left: 3px solid var(--primary-color);
    }

    .imptdt i {
        color: #fff !important;
        font-style: normal;
        font-weight: 500;
    }

    .imptdt a {
        color: var(--primary-color) !important;
        text-decoration: none;
    }

    /* 3. Modern Chapter List (Touch-Friendly Rows) */
    #chapter_list,
    .clstyle {
        list-style: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    #chapter_list li,
    .clstyle li {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 15px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        transition: background 0.2s;
    }

    #chapter_list li:hover,
    .clstyle li:hover {
        background: rgba(255, 255, 255, 0.03);
    }

    /* Chapter Link Stylization */
    #chapter_list li a,
    .clstyle li a {
        color: #fff !important;
        font-weight: 500;
        font-size: 0.95rem;
        text-decoration: none;
        display: block;
        flex-grow: 1;
        /* Clickable area expands */
    }

    /* Download/Date span alignment */
    #chapter_list li span,
    .clstyle li span {
        font-size: 0.8rem;
        color: #888;
        margin-left: 10px;
    }

    /* Remove ugly bullets/tables if scraping legacy */
    #chapter_list table,
    .clstyle table {
        width: 100%;
    }

    #chapter_list td,
    .clstyle td {
        padding: 8px 0;
    }

    /* =========================================
   PHASE 11: DETAIL PAGE SPLIT LAYOUT
   (Matching User Reference: Cover Left / Info Right)
   ========================================= */

    /* Hero Wrapper: Main Container */
    .hero-wrapper {
        position: relative;
        max-width: 1200px;
        margin: 0 auto;
        padding-top: 50px;
        /* Even more top space */
        padding-bottom: 50px;
        display: flex;
        flex-wrap: wrap;
        /* Responsive wrap */
        gap: 120px;
        /* EXTRA Aggressive gap (was 80px) */
        align-items: center;
        /* Vertically center */
    }

    /* ... */

    /* RIGHT COLUMN: Info & Grid */
    .hero-right {
        flex: 1;
        /* Takes remaining space */
        z-index: 2;
        display: flex;
        flex-direction: column;
        justify-content: center;
        /* Vertical Center */
        padding-bottom: 20px;
        padding-left: 60px;
        /* Force extra separation barrier */
    }

    /* Title Styling */
    .hero-title {
        font-size: 3rem;
        /* Larger title */
        font-weight: 800;
        color: #fff;
        margin-bottom: 30px;
        /* More space below title */
        line-height: 1.2;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    }

    /* Metadata Grid (The "Reference" Look) */
    .meta-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        /* Wider items */
        gap: 20px;
        /* Increased gap */
        margin-bottom: 30px;
    }

    .meta-item {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        padding: 12px 15px;
        border-radius: 8px;
        display: flex;
        flex-direction: column;
        gap: 5px;
        transition: background 0.2s;
    }

    .meta-item:hover {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.2);
    }

    .meta-label {
        font-size: 0.75rem;
        text-transform: uppercase;
        color: #aaa;
        letter-spacing: 0.5px;
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .meta-value {
        font-size: 1rem;
        font-weight: 600;
        color: #fff;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Accent Colors for specific badges */
    .badge-status-ongoing {
        color: #22c55e;
    }

    .badge-status-completed {
        color: #3b82f6;
    }

    .badge-type-manhwa {
        color: #a855f7;
    }

    /* Purple accent */

    /* Mobile Responsive */
    @media (max-width: 768px) {
        .hero-wrapper {
            flex-direction: column;
            align-items: center;
            text-align: center;
        }

        .hero-left {
            width: 180px;
            /* Smaller cover on mobile */
            flex: none;
        }

        .hero-right {
            width: 100%;
            align-items: center;
        }

        .hero-title {
            font-size: 1.8rem;
        }

        .meta-grid {
            grid-template-columns: 1fr 1fr;
            /* 2 columns on mobile */
            width: 100%;
        }
    }

    @media (max-width: 640px) {
        .grid-container {
            grid-template-columns: repeat(2, 1fr) !important;
            gap: 0.75rem !important;
        }
    }

    /* =========================================
   PHASE 8: POLISH & VISUAL STANDARDIZATION
   ========================================= */

    /* 1. SIDEBAR STANDARDISATION */
    .section-popular ul,
    .widget ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .section-popular li,
    .widget li {
        padding: 12px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .section-popular li:last-child {
        border-bottom: none;
    }

    .section-popular .title,
    .widget .title {
        font-size: 0.95rem;
        line-height: 1.4;
        font-weight: 500;
        margin: 0;
        color: #e5e5e5;
    }

    .section-popular span,
    .widget span {
        font-size: 0.8rem;
        color: #9ca3af;
    }

    /* 2. FOOTER DESIGN (Premium Look) */
    footer,
    .footer {
        background: #0f0f0f !important;
        border-top: 1px solid #22c55e;
        padding: 3rem 1rem;
        margin-top: 4rem;
        text-align: center;
        position: relative;
        z-index: 10;
    }

    footer p,
    .footer p {
        color: #9ca3af;
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }

    footer a,
    .footer a {
        color: #d1d5db;
        text-decoration: none;
        transition: color 0.2s;
    }

    footer a:hover,
    .footer a:hover {
        color: #22c55e;
    }

    /* 3. MODERN PAGINATION (Thumb-friendly) */
    .pagination,
    .page-nav {
        display: flex;
        justify-content: center;
        gap: 8px;
        margin: 2rem 0;
        flex-wrap: wrap;
    }

    .pagination a,
    .pagination span,
    .page-nav a,
    .page-nav span {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        height: 44px;
        padding: 0 15px;
        background: #1e1e1e;
        border: 1px solid #333;
        border-radius: 8px;
        color: #fff;
        text-decoration: none;
        font-weight: 600;
        transition: all 0.2s ease;
    }

    .pagination a:hover,
    .page-nav a:hover {
        background: #2a2a2a;
        border-color: #22c55e;
        transform: translateY(-2px);
    }

    .pagination .current,
    .pagination .active,
    .page-nav .current,
    .page-nav .active {
        background: #22c55e;
        color: #fff;
        border-color: #22c55e;
        box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
    }

    /* 4. MOBILE NAVIGATION OPTIMIZATION */
    @media (max-width: 768px) {

        header,
        .header {
            padding: 10px 15px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            flex-wrap: wrap;
        }

        header .logo img {
            max-height: 35px;
            width: auto;
        }

        header nav,
        .header nav {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        /* Fix Search Form overlap */
        #search-form,
        .search-form {
            width: 100%;
            margin-top: 10px;
            order: 3;
            /* Move to bottom on really small screens */
        }
    }
}

/* =========================================
   PHASE 11 FIX: FORCE MOBILE STACKING
   ========================================= */
@media screen and (max-width: 768px) {
    .hero-wrapper {
        flex-direction: column !important;
        align-items: center !important;
        gap: 40px !important;
        /* Vertical gap between image and text block */
    }

    .hero-left {
        width: 100% !important;
        flex: none !important;
        max-width: 280px;
        margin: 0 auto;
    }

    .hero-right {
        width: 100% !important;
        flex: none !important;
        padding-top: 10px;
        /* Reduced padding since we have gap:40px on wrapper now */
        padding-left: 0 !important;
        /* Reset desktop padding */
        text-align: center;
        /* often cleaner on mobile */
    }

    .hero-title {
        font-size: 2rem !important;
        /* Slightly smaller on mobile */
        margin-bottom: 20px !important;
    }

    .meta-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }
}

/* ----------------------------------------------------------- */
/* PHASE 5: NEW STANDARD DETAIL HEADER STYLES */
/* ----------------------------------------------------------- */

/* Poster Container Polish */
.poster-container {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease;
}

.poster-container:hover {
    transform: scale(1.02);
}

/* Title Resp */
@media (max-width: 768px) {
    .entry-title {
        font-size: 1.75rem !important;
        text-align: center;
    }

    .col-md-9 {
        text-align: center !important;
        align-items: center !important;
    }

    .d-flex.gap-3 {
        justify-content: center !important;
    }
}

/* Hover Scale Utility */
.hover-scale {
    transition: transform 0.2s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* Ensure badges/text in header pop */
.text-white-50 {}

/* ----------------------------------------------------------- */
/* PHASE 6: HEADER CLEANUP (Replaces Inline Styles) */
/* ----------------------------------------------------------- */

/* Header Container */
.header-manga-custom {
    z-index: 1020;
    background-color: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

/* Mega Menu Dropdown */
.megamenu-custom {
    width: 100%;
    min-width: 600px;
    padding: 20px;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    border: 1px solid #333;
    background-color: #1e1e1e;
    /* bg-dark-card */
}

@media (max-width: 768px) {
    .megamenu-custom {
        min-width: 90vw !important;
        left: 0 !important;
        transform: none !important;
    }
}

/* Search Form Alignment */
.search-input-custom {
    font-size: 0.9rem !important;
    padding: 0.5rem 1rem !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
    min-width: 250px;
}

.search-input-custom:focus {
    background-color: rgba(255, 255, 255, 0.15) !important;
    color: white !important;
    box-shadow: none !important;
    outline: 1px solid rgba(40, 167, 69, 0.5);
}

/* ==========================================================================
   FINAL EMERGENCY OVERRIDES (Fixing Project Page & Theme)
   ========================================================================== */
body,
body.custom-background,
body.bg-primary,
body.page-template-default,
html body {
    background-color: #121212 !important;
    background: #121212 !important;
    background-image: none !important;
    /* Remove any background image too */
    color: #e0e0e0 !important;
}

/* Fix for any container that might be inheriting the green */
#contenedor,
.site-content,
.site {
    background-color: transparent !important;
    background: transparent !important;
}

/* Ensure sticky header is dark */
.main-header,
.header-manga,
header {
    background-color: rgba(18, 18, 18, 0.95) !important;
}

/* Remove Red Fire Icons globally if any persist */
.fa-fire,
.lucide-flame {
    color: #ff6b6b !important;
}