/* --- Brand Color Scheme --- */
:root {
    --midnight-blue: #183b7d;
    --brand-blue: #1A2238;
    
    --golden-yellow: #FDD200;
    --second-brand: #d6952a;
    --dark-teal: #c72323; /* New accent color for genre badges */

    /* --- Overriding Bootstrap Defaults --- */
    --bs-primary: var(--golden-yellow);
    --bs-primary-rgb: 253, 210, 0;
    --bs-link-color: var(--midnight-blue);
    --bs-link-hover-color: #000;
}

/* --- REBRANDED: Global Button Styles --- */
.btn-primary {
    background-color: var(--golden-yellow);
    border-color: var(--golden-yellow);
    color: var(--midnight-blue);
    font-weight: bold;
    transition: all 0.3s ease;
}
.btn-primary:hover, .btn-primary:focus {
    background-color: #e3be00; /* Darker yellow for hover */
    border-color: #e3be00;
    color: var(--midnight-blue);
}

/* --- Font Definition --- */
@font-face {
    font-family: 'Jameel Noori Nastaleeq';
    src: url('../fonts/jameel-noori-nastaleeq.woff2') format('woff2'),
         url('../fonts/jameel-noori-nastaleeq.ttf') format('truetype');
    font-weight: normal; font-style: normal; font-display: swap;
}



/* --- General Body and Typography --- */
body {
    background-color: #f8f9fa; color: #212529; -webkit-user-select: none; -ms-user-select: none; user-select: none;
}
/* NEW: Main Content Wrapper Style */
.main-content-wrapper {
    background-color: #ffffff; /* A clean white background for the content area */
}
.urdu-text, .urdu-title, .urdu-content {
    font-family: 'Jameel Noori Nastaleeq', 'Noto Nastaliq Urdu', serif; direction: rtl; text-align: right;
}
.urdu-title { font-size: 2.2rem; font-weight: bold; line-height: 1.6; }
.urdu-content { font-size: 1.8rem; line-height: 2.4; }
.urdu-content p { margin-bottom: 2rem; }

/* --- Navbar Styles (Already Branded) --- */
.bg-dark { background-color: var(--midnight-blue) !important; }
.navbar-brand img { max-height: 40px; }
.navbar-dark .navbar-nav .nav-link { color: rgba(255, 255, 255, 0.8); position: relative; padding: 0.5rem 1rem; transition: color 0.3s ease; }
.navbar-dark .navbar-nav .nav-link::after { content: ''; position: absolute; bottom: -2px; left: 0.5rem; right: 0.5rem; height: 3px; background-color: var(--golden-yellow); transform: scaleX(0); transform-origin: bottom right; transition: transform 0.3s ease-out; }
.navbar-dark .navbar-nav .nav-link:hover, .navbar-dark .navbar-nav .nav-link.active { color: #fff; }
.navbar-dark .navbar-nav .nav-link:hover::after, .navbar-dark .navbar-nav .nav-link.active::after { transform: scaleX(1); transform-origin: bottom left; }
.navbar-dark .navbar-nav .dropdown-toggle::after { display: none; }
.navbar-dark .navbar-nav .nav-link.dropdown-toggle:hover::after, .navbar-dark .navbar-nav .nav-link.dropdown-toggle.active::after { transform: scaleX(0); }
@media (min-width: 992px) {
    .dropdown:hover .dropdown-menu { display: block; margin-top: 0; opacity: 1; visibility: visible; transform: translateY(0); }
    .dropdown-menu { opacity: 0; visibility: hidden; display: block; transform: translateY(10px); transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease; }
}
.dropdown-menu { background-color: var(--midnight-blue); border: 1px solid rgba(255, 255, 255, 0.1); }
.dropdown-item { color: rgba(255, 255, 255, 0.8); transition: all 0.3s ease; }
.dropdown-item:hover, .dropdown-item:focus { color: var(--midnight-blue); background-color: var(--golden-yellow); }
.dropdown-divider { border-top: 1px solid rgba(255, 255, 255, 0.2); }
.offcanvas { background-color: var(--midnight-blue); color: #fff; }
.offcanvas .offcanvas-header { border-bottom: 1px solid rgba(255, 255, 255, 0.2); }
.offcanvas .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
.offcanvas-body .navbar-nav .nav-link { font-size: 1.2rem; padding: 0.8rem 1rem; border-radius: 5px; }
.offcanvas-body .navbar-nav .nav-link:hover, .offcanvas-body .navbar-nav .nav-link.active { background-color: var(--golden-yellow); color: var(--midnight-blue); }
.offcanvas-body .dropdown-menu { background-color: transparent; border: none; padding-left: 1rem; }
.offcanvas-body .dropdown-item { padding: 0.5rem 1rem; }
.offcanvas-body::-webkit-scrollbar { width: 8px; }
.offcanvas-body::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
.offcanvas-body::-webkit-scrollbar-thumb { background: var(--golden-yellow); border-radius: 10px; }
.offcanvas-body::-webkit-scrollbar-thumb:hover { background: #e3be00; }

/* --- Other site styles... --- */
.hero-carousel-item, .hero-slide-item { height: 60vh; min-height: 400px; background-size: cover; background-position: center; position: relative; }
.hero-slide-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)); }
.hero-slide-content { position: relative; z-index: 2; height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.hero-slide-content .urdu-title { font-size: 3.5rem; }
.section-title { font-weight: bold; font-size: 2rem; margin-bottom: 2rem; text-align: center; position: relative; padding-bottom: 1rem; }
.section-title::after { content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 80px; height: 4px; background-color: var(--golden-yellow); border-radius: 2px; }

/* --- REBRANDED: Homepage Genre Tabs --- */
.genre-nav .nav-link { background-color: #e9ecef; color: #495057; margin: 0 5px; border-radius: 50px; transition: all 0.3s ease; font-weight: 500; }
.genre-nav .nav-link.active { background-color: var(--golden-yellow); color: var(--midnight-blue); box-shadow: 0 4px 10px rgba(253, 210, 0, 0.4); }
.genre-nav .nav-link:not(.active):hover { background-color: #ced4da; }

/* --- REBRANDED: Novel Card Genre Badges --- */
.novel-card .badge {
    background-color: var(--dark-teal) !important;
    color: #fff !important;
}

.novel-card { transition: transform 0.3s ease, box-shadow 0.3s ease; border: none; border-radius: 0.5rem; overflow: hidden; background: #ffffff; }
.novel-card:hover { transform: translateY(-8px); box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08); }
.image-aspect-ratio-container { position: relative; width: 100%; padding-top: 150%; background-color: #e9ecef; }
.image-aspect-ratio-container img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.card-title { font-weight: bold; }
.card-title.urdu-text { font-size: 1.5rem; }
.badge-premium { position: absolute; top: 15px; right: 15px; background-color: var(--second-brand); color: var(--midnight-blue); font-weight: bold; z-index: 10; }
#reading-progress-bar { position: fixed; top: 0; left: 0; height: 4px; background: var(--golden-yellow); width: 0%; z-index: 1050; transition: width 0.1s ease-out; }
.reading-header { background: #fff; border-bottom: 1px solid #dee2e6; z-index: 1040; }
.episode-sidebar { position: sticky; top: 80px; height: calc(100vh - 100px); overflow-y: auto; background: #f8f9fa; border-radius: 0.5rem; padding: 1rem; }
.episode-list .list-group-item { border: none; background: transparent; transition: background-color 0.2s ease; }
.episode-list .list-group-item.active { background-color: #0d6efd !important; color: #fff !important; border-radius: 0.25rem; }
.episode-list .list-group-item:not(.active):hover { background-color: #e9ecef; }
.premium-cta-section { background: var(--brand-blue); color: #fff; }
.premium-cta-section .features-list { list-style: none; padding: 0; }
.premium-cta-section .features-list li { margin-bottom: 0.5rem; }
.latest-episodes-list .list-group-item { background-color: #ffffff; border: 1px solid #dee2e6; transition: background-color 0.2s ease, transform 0.2s ease; }
.latest-episodes-list .list-group-item:hover { background-color: #f1f3f5; transform: translateX(-5px); }
.filter-sidebar { position: sticky; top: 100px; }
.pagination .page-item .page-link { color: #0d6efd; }
.pagination .page-item.active .page-link { background-color: #0d6efd; border-color: #0d6efd; color: #fff; }
.pagination .page-item.disabled .page-link { color: #6c757d; }
.preloader { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #ffffff; z-index: 9999; display: flex; justify-content: center; align-items: center; transition: opacity 0.5s ease; }
.preloader.fade-out { opacity: 0; pointer-events: none; }
.preloader .spinner-border { width: 3rem; height: 3rem; }