/* --- Brand Color Scheme --- */
:root {
    --midnight-blue: #183b7d;
    --brand-blue: #1A2238;

    --golden-yellow: #FDD200;
    --second-brand: #d6952a;
    --dark-teal: #c72323;
    /* New Brand Gradient */
    --dark-green: #094033;
    --brand-gradient: linear-gradient(135deg, var(--midnight-blue) 0%, var(--dark-green) 100%);

    /* --- 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;

    /* --- Spacing System --- */
    --section-spacing: 70px;
    --section-spacing-mobile: 40px;
}

/* --- REBRANDED: Global Button Styles --- */
.btn-primary {
    background: var(--brand-gradient);
    border: none;
    color: #ffffff;
    font-weight: bold;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    z-index: 1;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0) 100%);
    transform: skewX(-25deg);
    transition: all 0.6s ease;
    z-index: -1;
}

.btn-primary:hover::before {
    left: 150%;
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--brand-gradient);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(24, 59, 125, 0.4);
}

.site-section {
    padding-top: var(--section-spacing);
    padding-bottom: var(--section-spacing);
}

footer {
    padding-top: var(--section-spacing);
    padding-bottom: 40px;
}

/* --- 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;
    /* Spacing is handled by individual sections or the wrapper's final child */
}

.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: var(--brand-gradient) !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... --- */
/* --- PREMIUM HERO SLIDER --- */
.hero-carousel-item,
.hero-slide-item {
    height: 80vh;
    min-height: 600px;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.hero-slide-blur-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(30px) brightness(0.4);
    transform: scale(1.15);
    z-index: 1;
}

.hero-slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 100%);
    z-index: 2;
}

.hero-slide-content {
    position: relative;
    z-index: 5;
    width: 100%;
}

.hero-content-inner {
    text-align: left;
    animation: heroFadeInUp 1s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.hero-slide-item .urdu-title {
    font-size: 4.5rem;
    color: var(--golden-yellow);
    margin-bottom: 1.5rem;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    text-align: left;
    line-height: 1.4;
}

.hero-slide-item .lead {
    color: #f8f9fa;
    font-size: 1.3rem;
    margin-bottom: 2.5rem;
    opacity: 0.95;
    border-left: 5px solid var(--golden-yellow);
    padding-left: 25px;
    max-width: 90%;
    line-height: 1.8;
}

.hero-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1500px;
    animation: heroFadeInRight 1.2s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.hero-cover-img {
    width: 320px;
    height: 480px;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8);
    transform: rotateY(-20deg) rotateX(10deg);
    transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.carousel-item.active .hero-cover-img {
    transform: rotateY(-10deg) rotateX(5deg);
}

.hero-slide-item:hover .hero-cover-img {
    transform: rotateY(0deg) rotateX(0deg) scale(1.05);
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.9);
}

/* Animations */
@keyframes heroFadeInUp {
    from { opacity: 0; transform: translateY(50px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes heroFadeInRight {
    from { opacity: 0; transform: translateX(80px) rotateY(10deg); }
    to { opacity: 1; transform: translateX(0) rotateY(-20deg); }
}

/* Responsive Fixes */
@media (max-width: 991px) {
    .hero-slide-item {
        height: auto;
        padding: 80px 0;
        min-height: auto;
    }
    .hero-slide-content .row {
        flex-direction: column-reverse;
    }
    .hero-content-inner {
        text-align: center;
        margin-top: 40px;
    }
    .hero-slide-item .urdu-title {
        text-align: center;
        font-size: 3rem;
    }
    .hero-slide-item .lead {
        border-left: none;
        padding-left: 0;
        border-top: 3px solid var(--golden-yellow);
        padding-top: 20px;
        margin: 0 auto 2rem;
    }
    .hero-cover-img {
        width: 220px;
        height: 330px;
        transform: none !important;
    }
    .carousel-control-prev, .carousel-control-next {
        display: none !important;
    }
}

.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 SECTION --- */
.episode-row-card {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 15px;
    padding: 15px 25px;
    text-decoration: none;
    color: inherit;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
}

.episode-row-card:hover {
    transform: translateX(10px);
    background: #ffffff;
    box-shadow: 0 15px 35px rgba(0,0,0,0.08);
    color: inherit;
    border-color: var(--golden-yellow);
}

.episode-thumbnail {
    width: 60px;
    height: 85px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    margin-right: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    background: #eee;
}

.episode-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.episode-row-card:hover .episode-thumbnail img {
    transform: scale(1.1);
}

.episode-info-main {
    flex-grow: 1;
}

.novel-name-small {
    font-size: 0.75rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 5px;
    font-weight: 600;
}

.episode-title-ur {
    margin-bottom: 0;
    font-size: 1.6rem;
    color: var(--brand-blue);
    line-height: 1.2;
}

.episode-meta-end {
    display: flex;
    align-items: center;
    gap: 20px;
}

.ep-badge {
    background: #f8f9fa;
    padding: 6px 15px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--midnight-blue);
    white-space: nowrap;
    border: 1px solid #eee;
    transition: all 0.3s ease;
}

.episode-row-card:hover .ep-badge {
    background: var(--golden-yellow);
    border-color: var(--golden-yellow);
}

.read-now-arrow {
    width: 40px;
    height: 40px;
    background: #f8f9fa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid #eee;
}

.episode-row-card:hover .read-now-arrow {
    background: var(--brand-gradient);
    color: #fff;
    border-color: transparent;
    transform: rotate(-45deg);
}

.episode-item-wrapper {
    animation: heroFadeInUp 0.8s ease both;
}

.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;
}

.about-common-section {
    background: linear-gradient(180deg, #ffffff 0%, #fefefe 100%);
    border-top: 1px solid #eee;
}


.about-section-row {
    display: flex;
    align-items: center;
    margin-bottom: 80px;
    gap: 60px;
}

.about-section-row:last-child {
    margin-bottom: 0;
}

.about-section-row:nth-child(even) {
    flex-direction: row-reverse;
}

.about-content-block {
    flex: 1.2;
}

.about-content-block h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--midnight-blue);
    margin-bottom: 25px;
}

.about-content-block p {
    color: #555;
    margin-bottom: 0;
}

.about-image-block {
    flex: 1;
    position: relative;
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
}

.about-image-block img {
    width: 100%;
    height: 450px;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.about-image-block:hover img {
    transform: scale(1.08);
}

@media (max-width: 992px) {

    .site-section,
    .premium-cta-section,
    .for-you-section,
    .about-common-section,
    footer {
        padding-top: var(--section-spacing-mobile) !important;
        padding-bottom: var(--section-spacing-mobile) !important;
    }

    .about-section-row {
        flex-direction: column !important;
        text-align: center;
        margin-bottom: 50px;
        gap: 30px;
    }

    .about-image-block {
        width: 100%;
        max-width: 550px;
        order: -1;
    }

    .about-image-block img {
        height: 350px;
    }

    .about-content-block h3 {
        font-size: 1.7rem;
    }
}

/* --- Category Card Styling --- */
.category-card {
    display: block;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0) 100%);
    transform: skewX(-25deg);
    transition: all 0.6s ease;
    z-index: 3;
}

.category-card:hover::before {
    left: 150%;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.category-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%;
    /* Square aspect ratio */
    background: var(--midnight-blue);
}

.category-image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 800;
    color: var(--golden-yellow);
    background: var(--midnight-blue);
}

.category-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.2) 60%, transparent 100%);
}

.category-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px;
    text-align: center;
    color: #fff;
    z-index: 2;
}

.category-content h5 {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.5px;
}

/* --- Poetry Styling --- */
.poetry-card {
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    background: #fff;
    border-radius: 15px !important;
    overflow: hidden;
    text-align: center;
}

.poetry-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1) !important;
}

.poetry-card .card-body {
    padding: 2.5rem 2rem;
}

.poetry-accent-line {
    width: 40px;
    height: 3px;
    background: var(--golden-yellow);
    margin: 0 auto 1.5rem;
    border-radius: 2px;
}

.poetry-card .urdu-text {
    font-size: 1.5rem;
    line-height: 1.8;
    color: var(--midnight-blue);
    display: block;
    margin-bottom: 1rem;
}

.poetry-excerpt {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #666;
    margin-bottom: 2rem;
    font-style: italic;
    min-height: 3.2rem;
    overflow: hidden;
}

.poetry-detail-container {
    background: #fff;
    padding: 5rem 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.poetry-detail-container::before {
    content: '"';
    position: absolute;
    top: -20px;
    right: 30px;
    font-size: 15rem;
    color: rgba(253, 210, 0, 0.1);
    font-family: serif;
    line-height: 1;
}

.poem-content {
    font-size: 1.8rem;
    line-height: 2.5;
    color: #333;
    text-align: center;
    max-width: 650px;
    margin: 0 auto;
    font-weight: 500;
}

.poem-meta {
    text-align: center;
    margin-bottom: 4rem;
}

.poem-title-ur {
    font-size: 2.8rem;
    color: var(--midnight-blue);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.poem-title-en {
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: #aaa;
    margin-bottom: 1.5rem;
    display: block;
}

.poetry-nav-btn {
    border-radius: 30px !important;
    padding: 12px 30px !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: all 0.3s ease;
}

.poetry-nav-btn:hover {
    transform: scale(1.05);
}

/* --- Floating Particles Background --- */
.floating-particles-section {
    position: relative;
    overflow: hidden;
    background: var(--brand-gradient);
}

.floating-particles-section * {
    position: relative;
    z-index: 2;
    /* Content stays legible above particles */
}

.floating-particles-section .section-title,
.floating-particles-section h2 {
    color: #fff;
    /* contrast against dark gradient */
}

/* Base style for particles */
.particle-elem {
    position: absolute;
    border-radius: 50%;
    background: var(--golden-yellow);
    box-shadow: 0 0 10px rgba(253, 210, 0, 0.4);
    opacity: 0.2;
    z-index: 1;
    /* behind content */
    animation: floatParticle 15s infinite ease-in-out;
}

/* Creating varied particle appearances and paths */
.p1 {
    width: 40px;
    height: 40px;
    left: 10%;
    top: 20%;
    animation-duration: 20s;
    animation-delay: 0s;
}

.p2 {
    width: 15px;
    height: 15px;
    left: 25%;
    top: 60%;
    animation-duration: 12s;
    animation-delay: 2s;
}

.p3 {
    width: 30px;
    height: 30px;
    left: 60%;
    top: 15%;
    animation-duration: 18s;
    animation-delay: -5s;
    opacity: 0.15;
}

.p4 {
    width: 25px;
    height: 25px;
    left: 85%;
    top: 50%;
    animation-duration: 25s;
    animation-delay: 1s;
}

.p5 {
    width: 10px;
    height: 10px;
    left: 45%;
    top: 80%;
    animation-duration: 14s;
    animation-delay: -3s;
}

.p6 {
    width: 50px;
    height: 50px;
    left: 75%;
    top: 85%;
    animation-duration: 22s;
    animation-delay: 4s;
    opacity: 0.1;
}

@keyframes floatParticle {
    0% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -50px) scale(1.1);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }

    100% {
        transform: translate(0, 0) scale(1);
    }
}