/* Main Variables */
/* Main Variables */
:root {
    --primary-color: #c88c00;
    /* Logo Gold */
    --primary-rgb: 200, 140, 0;
    --primary-dark: #002800;
    /* Logo Dark Green */
    --secondary-color: #ffb700;
    /* Lighter Gold */
    --bg-color: #fcfcfc;
    /* Clean Off-White (Reverted) */
    --card-bg: #ffffff;
    /* Pure White */
    --text-color: #4a4a4a;
    /* Soft Dark Grey for body */
    --text-muted: #8898aa;
    --gradient-gold: linear-gradient(135deg, #c88c00 0%, #e6a800 100%);
    --gradient-hero: linear-gradient(135deg, #ffeebb 0%, #fff 50%, #dcedc8 100%);
    /* Stronger Gold to Green */
    --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.08);
    /* Increased softness */
    --shadow-hover: 0 20px 50px rgba(0, 0, 0, 0.15);
    /* Deeper hover */
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    line-height: 1.6;
    /* padding-top: 80px; REMOVED to fix gap between header and hero */
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--primary-dark);
}

/* Allow Bootstrap text utilities to override heading colors */
[class*="text-white"] h1,
[class*="text-white"] h2,
[class*="text-white"] h3,
[class*="text-white"] h4,
[class*="text-white"] h5,
[class*="text-white"] h6,
[class*="text-light"] h1,
[class*="text-light"] h2,
[class*="text-light"] h3,
[class*="text-light"] h4,
[class*="text-light"] h5,
[class*="text-light"] h6 {
    color: inherit;
}

a {
    text-decoration: none;
    transition: color 0.3s ease, background-color 0.3s ease;
}

/* Animations */
@keyframes pulse-brand {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

/* Navbar */
.navbar-custom {
    background: var(--gradient-hero);
    /* Matches Hero Gradient */
    border-bottom: 1px solid rgba(0, 100, 0, 0.05);
    /* Subtle Green separator */
    padding: 15px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    /* Slight shadow for separation */
    z-index: 1050;
    /* Above typical Bootstrap triggers */
    backdrop-filter: blur(10px);
    /* Modern touch */
    -webkit-backdrop-filter: blur(10px);
}

.navbar-brand img {
    height: 50px;
    width: auto;
    /* Removed pulse-brand animation */
}

.navbar-brand span {
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;

    /* Dark Green Shimmer Text Effect */
    background: linear-gradient(to right, #002800 0%, #4caf50 50%, #002800 100%);
    background-size: 200% auto;
    color: #002800;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shine-text 6s linear infinite;
}

@keyframes shine-text {
    to {
        background-position: 200% center;
    }
}

/* Scoped to main navbar to prevent side effects on other navs (like tabs) */
.navbar-nav .nav-link {
    font-weight: 600;
    color: var(--primary-dark) !important;
    margin: 0 12px;
    position: relative;
    font-size: 0.95rem;
}

.navbar-nav .nav-link::before {
    content: '';
    display: block;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
    position: absolute;
    bottom: 0;
    left: 0;
}

.navbar-nav .nav-item:hover .nav-link,
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--primary-color) !important;
}

.navbar-nav .nav-item:hover .nav-link::before,
.navbar-nav .nav-link:hover::before,
.navbar-nav .nav-link.active::before {
    width: 100%;
}

/* Dropdown Hover (Desktop) */
@media (min-width: 992px) {
    .dropdown:hover .dropdown-menu {
        display: block;
        margin-top: 0;
        animation: fadeInDropdown 0.3s ease;
    }

    /* Transparent bridge to prevent menu from closing when moving mouse */
    .dropdown-menu::before {
        content: "";
        position: absolute;
        top: -15px;
        left: 0;
        width: 100%;
        height: 20px;
        background: transparent;
    }
}

@keyframes fadeInDropdown {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Nav Pills (Tabs) */
.nav-pills .nav-link {
    border-radius: 50px;
    padding: 8px 25px;
    color: var(--primary-dark);
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    /* Smooth easing */
}

.nav-pills .nav-link.active,
.nav-pills .show>.nav-link {
    color: #fff !important;
    background: var(--primary-color);
    box-shadow: 0 5px 15px rgba(200, 140, 0, 0.3);
    transform: translateY(-2px);
    /* Subtle lift on active */
}

/* Smooth Tab Content Transition */
.tab-content>.tab-pane {
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    /* Slower, smoother fade */
}

.tab-content>.active {
    display: block;
    opacity: 1;
}

.tab-content>.fade {
    transition: opacity 0.4s linear;
}

/* Hero Section */
.hero-section {
    background: var(--gradient-hero);
    /* Use New Gradient */
    padding: 120px 0 80px;
    position: relative;
    overflow: hidden;
    margin-top: 0;
}

.hero-title {
    font-size: 3.5rem;
    color: var(--primary-dark);
    margin-bottom: 20px;
    line-height: 1.2;
    letter-spacing: -1px;
}

.hero-text {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 30px;
}

/* Floating Icons */
.floating-icon {
    position: absolute;
    opacity: 0.05;
    /* Subtle watermark layout */
    z-index: 0;
    pointer-events: none;
    color: var(--primary-dark);
}

@keyframes float-icon {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-15px) rotate(5deg);
    }
}

.float-1 {
    top: 15%;
    left: 5%;
    font-size: 3rem;
    animation: float-icon 6s ease-in-out infinite;
}

.float-2 {
    bottom: 20%;
    left: 10%;
    font-size: 2.5rem;
    animation: float-icon 7s ease-in-out infinite;
}

.float-3 {
    top: 20%;
    right: 10%;
    font-size: 4rem;
    animation: float-icon 8s ease-in-out infinite;
}

/* Hero Illustration Animation */
@keyframes float-hero {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

/* Hero Illustration Animation */
@keyframes float-hero {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

.float-anim {
    animation: float-hero 6s ease-in-out infinite;
}

/* --- New Hero Animations --- */

/* 1. Cosmetic Gateway (Particles) */
@keyframes floatUpRotate {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.8;
    }

    100% {
        transform: translateY(-800px) rotate(360deg);
        opacity: 0;
    }
}

.hero-particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    /* Slightly rounded squares */
    animation: floatUpRotate 15s linear infinite;
    bottom: -50px;
}

/* 2. Deep Dive (Bubbles) */
@keyframes riseWobble {
    0% {
        bottom: -100px;
        transform: translateX(0);
        opacity: 0;
    }

    50% {
        opacity: 0.6;
    }

    100% {
        bottom: 100%;
        transform: translateX(20px);
        /* Wobble right */
        opacity: 0;
    }
}

.hero-bubble {
    position: absolute;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    animation: riseWobble 10s ease-in infinite;
    bottom: -100px;
}

/* 3. Energy Pulse */
@keyframes pulseExpand {
    0% {
        transform: scale(0.5);
        opacity: 0.8;
    }

    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

.hero-pulse {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    animation: pulseExpand 6s linear infinite;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* Centered start */
}

/* Buttons */
.btn-primary-custom,
.btn-primary {
    background: var(--primary-color) !important;
    border: none !important;
    color: white !important;
    padding: 12px 35px;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    box-shadow: 0 10px 20px rgba(200, 140, 0, 0.25);
    transition: transform 0.3s, box-shadow 0.3s;
}

.btn-primary-custom:hover,
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(200, 140, 0, 0.35);
}

.btn-light {
    background: #fff;
    color: var(--primary-dark);
    border: 1px solid #eee;
}

/* Custom Back Button */
.btn-back {
    color: var(--primary-dark);
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.btn-back:hover {
    color: var(--primary-color);
    background: #fff;
    /* Keep white */
    transform: translateX(-5px);
    /* Slide left hint */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Circular Hero Back Button - Refined for Transparency & Centering */
.btn-back-circle {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    text-decoration: none !important;
}

.btn-back-circle:hover {
    transform: scale(1.1) translateY(-2px);
    background: rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    color: #fff !important;
}

.back-btn-container {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
}

@media (max-width: 768px) {
    .back-btn-container {
        display: none !important;
    }
}

/* Cards (Modern Premium) */
.subject-card,
.card {
    background: var(--card-bg);
    border-radius: 20px;
    /* Slightly Reduced radius for sharper premium look */
    border: 1px solid rgba(0, 0, 0, 0.08);
    /* Defined subtle border */
    padding: 30px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: var(--shadow-soft);
}

.subject-card:hover,
.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(200, 140, 0, 0.2);
    /* Gold hint on hover */
}

.subject-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    color: var(--primary-color);
    background: rgba(200, 140, 0, 0.1);
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    /* Squircle */
    transition: transform 0.3s;
}

.subject-card:hover .subject-icon {
    transform: rotate(10deg);
}

/* Footer */
.footer {
    background-color: var(--primary-dark);
    color: #e0e0e0;
    padding: 150px 0 40px;
    /* Increased top padding to clear the wave */
    position: relative;
    margin-top: 0;
    /* Remove margin since wave handles transition */
}

.footer h5 {
    color: #fff;
    margin-bottom: 25px;
    font-size: 1.25rem;
    letter-spacing: 0.5px;
    font-weight: 700;
}

.footer p {
    line-height: 1.8;
    color: #ccc;
}


.footer a {
    color: #bbb;
    font-size: 0.9rem;
}

.footer a:not(.icon-circle):hover {
    color: var(--primary-color);
    padding-left: 5px;
}

/* Social & Brand Icons */
.icon-facebook {
    color: #1877F2;
    border-color: #1877F2 !important;
}

.icon-facebook:hover {
    background-color: #1877F2 !important;
    color: #fff !important;
    border-color: #1877F2 !important;
}

.icon-instagram {
    color: #fd5949;
    border-color: #fd5949 !important;
}

.icon-instagram:hover {
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%) !important;
    color: #fff !important;
    border-color: transparent !important;
}

.icon-youtube {
    color: #FF0000;
    border-color: #FF0000 !important;
}

.icon-youtube:hover {
    background-color: #FF0000 !important;
    color: #fff !important;
    border-color: #FF0000 !important;
}

/* Footer Icon Override (Visible Outline on Dark BG) */
.footer .icon-circle {
    border-color: rgba(255, 255, 255, 0.4);
}

/* Interactive Generic Icons (Fill on hover) */
.icon-hover-primary:hover {
    background-color: var(--primary-color) !important;
    color: #fff !important;
    border-color: var(--primary-color) !important;
}

.icon-hover-danger:hover {
    background-color: #dc3545 !important;
    color: #fff !important;
    border-color: #dc3545 !important;
}

/* Perfect Circle Icon Helpers */
.wave-divider-top {
    position: absolute;
    top: -1px;
    /* Overlap slightly */
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
    transform: rotate(180deg);
}

.wave-divider-top svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 60px;
}

.wave-divider-top .shape-fill {
    fill: var(--bg-color);
    /* Match body bg */
}

/* Utilities */
.text-brand {
    color: var(--primary-color);
}

.bg-brand {
    background-color: var(--primary-color);
}

/* Dropdown Items (Animated Underline) */
.dropdown-item {
    position: relative;
    padding: 8px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: transparent;
    color: var(--primary-color);
}

.dropdown-item::before {
    content: '';
    display: block;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
    position: absolute;
    bottom: 5px;
    left: 15px;
    /* Matches padding */
}

.dropdown-item:hover::before,
.dropdown-item.active::before,
.dropdown-item:active::before {
    width: calc(100% - 30px);
    /* Full width minus total horizontal padding */
}

.dropdown-item.active,
.dropdown-item:active {
    background-color: transparent;
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}

/* Perfect Circle Icon Helpers */
.icon-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    padding: 0;
    transition: all 0.3s ease;
    flex-shrink: 0;
    text-decoration: none !important;
    border: 1px solid transparent;
}

.icon-circle-lg {
    width: 50px;
    height: 50px;
}

.icon-circle:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Responsive Media Queries */
@media (max-width: 768px) {

    /* Global Spacing */
    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

    .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    /* Hero */
    .hero-section {
        padding: 120px 0 60px;
        /* Reduced top/bottom */
        min-height: auto !important;
        /* Allow growing */
        text-align: center;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-text {
        font-size: 1rem;
    }

    /* Buttons */
    .btn-primary-custom,
    .btn-primary,
    .btn-light {
        padding: 10px 25px;
        font-size: 0.8rem;
    }

    /* Cards */
    .subject-card,
    .card {
        padding: 20px;
        border-radius: 16px;
    }

    .subject-icon {
        font-size: 2rem;
        width: 60px;
        height: 60px;
    }

    /* Footer */
    .footer {
        padding-top: 100px;
        /* text-align: center; REMOVED per user request */
    }

    .social-btn {
        width: 40px;
        height: 40px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.05);
        color: #fff;
        border-radius: 50%;
        transition: all 0.3s ease;
        text-decoration: none;
    }

    .social-btn:hover {
        background: var(--primary-color);
        border-color: var(--primary-color);
        color: #fff;
        transform: translateY(-3px);
        box-shadow: 0 5px 15px rgba(200, 140, 0, 0.3);
    }

    .footer .col-lg-3,
    .footer .col-lg-2,
    .footer .col-lg-4 {
        margin-bottom: 2rem;
    }

    /* Floating Icons - Hide or reduce on mobile */
    .floating-icon {
        display: none;
        /* Too cluttered on small screens usually */
    }

    /* Extra Small Devices Optimization */
    @media (max-width: 360px) {
        .navbar-brand .brand-logo-img {
            max-height: 35px !important;
        }

        .navbar-brand .brand-name-text {
            font-size: 1rem !important;
        }

        .navbar-toggler {
            padding: 0.25rem 0.4rem;
        }

        .container {
            padding-left: 0.75rem;
            padding-right: 0.75rem;
        }
    }
}

/* --- Restored Utility Classes --- */
.hover-scale:hover {
    transform: scale(1.1);
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15) !important;
}

.tracking-wider {
    letter-spacing: 2px;
}

/* --- Premium 2D Book Card --- */
.book-card-premium {
    position: relative;
    width: 100%;
    max-width: 250px;
    margin: 0 auto;
    aspect-ratio: 2 / 3;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.book-card-premium:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.book-img-premium {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.book-card-premium:hover .book-img-premium {
    transform: scale(1.05);
}

/* Texture Overlay */
.book-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
    z-index: 2;
}

/* --- Expandable Search (Moved from inline) --- */
.search-expandable {
    position: relative;
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 5px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.search-expandable:hover,
.search-expandable:focus-within {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    border-color: rgba(0, 0, 0, 0.1);
}

.search-input {
    border: none;
    background: transparent;
    width: 0;
    padding: 0;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    opacity: 0;
    outline: none;
    font-size: 0.95rem;
    color: #444;
}

.search-expandable:hover .search-input,
.search-expandable:focus-within .search-input,
.search-input:not(:placeholder-shown) {
    width: 250px;
    padding: 0 10px 0 15px;
    opacity: 1;
}

.search-btn {
    background: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #0d6efd;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.search-expandable:hover .search-btn {
    transform: rotate(90deg) scale(0.9);
    color: #0a58ca;
}

/* Scroll to Top Button */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    background-color: var(--primary-color) !important;
    border: none !important;
    box-shadow: 0 5px 15px rgba(200, 140, 0, 0.4);
    color: #fff !important;
}

.scroll-top.show {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(200, 140, 0, 0.6);
}