/* =========================================================
   Common Page Styling
   ========================================================= */

:root {
    --primary-dark-bg: #1a1a1a;  /* Updated to match Navbar */
    --dark-text: #2e2e2e;
    --light-text: #fff;
    --accent-gold: #d4a373;      /* The Gold color from your design */
    --accent-green: #5F9F72;
    --accent-green-darker: #4A8C60;
    --light-bg-body: #f8f9fa;
    --card-bg: #fff;
    --quiz-button-color: #198754; 
    --quiz-button-hover-color: #156d44;
    --border-light: #e0e0e0;
}

/* ================= Body & General ================= */
body {
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--light-bg-body);
    color: var(--dark-text);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-top: 0 !important; /* Fix: Remove top padding that causes gaps */
}

/* ================= NAVBAR STYLES (Fixed) ================= */

/* 1. The Main Bar */
.navbar {
    /* background-color: #1a1a1a !important; */
    padding-top: 0.5rem;    /* Reduced height */
    padding-bottom: 0.5rem; /* Reduced height */
    font-family: 'Special Elite', cursive;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* 2. Brand / Logo */
.navbar-brand {
    font-family: 'Special Elite', cursive;
    font-weight: bold;
    font-size: 1.25rem;
    color: #ffffff !important;
}

/* 3. Links (Desktop & Mobile) */
.navbar-dark .navbar-nav .nav-link {
    font-family: 'Special Elite', cursive;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    padding-right: 1rem;
    padding-left: 1rem;
    transition: color 0.3s ease;
}

/* 4. HOVER EFFECT (Text Color Only - NO Background Change) */
.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link:focus {
    color: var(--accent-gold) !important; 
    background-color: transparent !important; /* Prevents the white box */
    transform: none; /* Prevents jumping */
}

/* Optional Underline on Hover */
.navbar-nav .nav-link::after {
    content: '';
    display: block;
    width: 0;
    height: 2px;
    background: var(--accent-gold);
    transition: width 0.3s;
    margin-top: 2px;
}
.navbar-nav .nav-link:hover::after {
    width: 100%;
}

/* 5. User Avatar */
.profile-avatar {
    width: 30px;
    height: 30px;
    background-color: var(--accent-gold);
    color: #1a1a1a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 13px;
    font-family: sans-serif;
}

/* 6. Dropdown Menu (User Profile) */
.dropdown-menu {
    background-color: #2c2c2c; /* Dark Grey */
    border: 1px solid #444;
    margin-top: 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.dropdown-item {
    color: #e0e0e0;
    font-size: 0.9rem;
    padding: 8px 16px;
}

.dropdown-item:hover {
    background-color: #3d3d3d; /* Darker Grey hover */
    color: var(--accent-gold);
}

.dropdown-divider {
    border-top: 1px solid #444;
}

/* --- MOBILE SPECIFIC FIXES (Max-width 991px) --- */
@media (max-width: 991px) {
    /* Only paint the collapse background on mobile */
    .navbar-collapse {
        /* background-color: #1a1a1a;  */
        padding-bottom: 1rem;
        border-top: 1px solid #333;
        margin-top: 0.5rem;
    }
    
    .navbar-nav {
        text-align: left;
        padding-left: 10px;
    }
    
    .dropdown-menu {
        border: none;
        background: #222;
        padding-left: 1rem;
    }
}

/* --- DESKTOP SPECIFIC (Hover to Open Dropdown) --- */
@media (min-width: 992px) {
    .nav-item.dropdown:hover .dropdown-menu {
        display: block;
        margin-top: 0;
        animation: fadeIn 0.3s ease;
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ================= SECTION LAYOUT & SPACING FIXES ================= */

/* FIX: Removed the massive padding/margins that caused white gaps */
main, .page-hero-section, .legal-section, .page-section, .hero-section {
    padding-top: 0; 
    margin-top: 0;
}

/* Add specific spacing for standard page sections only */
.page-section {
    padding: 60px 15px;
    background-color: var(--light-bg-body);
    flex-grow: 1;
}

.hero-section {
    min-height: 80vh; /* Reduced from 100vh slightly */
    display: flex;
    align-items: center;
    justify-content: start;
    padding-left: 10%;
    padding-right: 20px;
    position: relative;
    color: white;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
    overflow: hidden;
    /* No margin-top here ensures it sits directly under navbar */
}

/* Container Spacing */
.container:first-of-type {
    padding-top: 20px;
}

/* ================= Components (Cards, Buttons, Text) ================= */

.section-title {
    font-family: 'Playfair Display', serif;
    font-weight: bold;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--dark-text);
    text-align: center;
}

.content-card {
    background-color: var(--card-bg);
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    padding: 30px;
    margin-bottom: 30px;
}

.btn-primary {
    background-color: var(--quiz-button-color) !important;
    border-color: var(--quiz-button-color) !important;
}

.btn-primary:hover {
    background-color: var(--quiz-button-hover-color) !important;
    border-color: var(--quiz-button-hover-color) !important;
}

.level-select-btn {
    background-color: var(--accent-green);
    color: var(--light-text);
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    margin: 5px;
    font-weight: 600;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.level-select-btn:hover {
    background-color: var(--accent-green-darker);
    transform: translateY(-2px);
}

.level-select-btn.active {
    background-color: var(--primary-dark-bg);
    border: 2px solid var(--accent-green);
}

/* File List & Audio */
.file-list-item {
    cursor: pointer;
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s ease;
}

.file-list-item:hover {
    background-color: #f0f0f0;
}

.file-list-item.active {
    background-color: #e0ffe0;
    font-weight: bold;
    color: cadetblue;
}

.audio-player-container {
    text-align: center;
    margin-top: 20px;
    margin-bottom: 20px;
}

.audio-player-container audio {
    width: 100%;
    max-width: 600px;
}

.transcript-section {
    border-top: 1px solid #eee;
    padding-top: 20px;
    margin-top: 20px;
}

.transcript-text {
    white-space: pre-wrap;
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    background-color: #f8f8f8;
    padding: 15px;
    border-radius: 8px;
    max-height: 400px;
    overflow-y: auto;
}

/* ================= Footer ================= */
.footer {
    background-color: var(--primary-dark-bg);
    color: var(--light-text);
    padding: 20px 0;
    text-align: center;
    font-size: 0.8rem;
    margin-top: auto;
}

.footer p { margin-bottom: 5px; }

.footer .social-icons a {
    color: var(--light-text);
    font-size: 1.2rem;
    margin: 0 8px;
    transition: color 0.3s ease;
}

.footer .social-icons a:hover {
    color: var(--accent-green);
}

/* ================= Responsive Text Sizes ================= */
@media (max-width: 768px) {
    .section-title { font-size: 2rem; }
}

@media (max-width: 576px) {
    .page-section { padding: 40px 10px; }
    .section-title { font-size: 1.8rem; }
    .content-card { padding: 20px; }
}

@media (max-width: 350px) {
    .navbar-brand { font-size: 1.1rem; }
}

/* =========================================================
   Floating WhatsApp Button
   ========================================================= */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 40px;
    right: 40px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 3px rgba(0,0,0,0.3);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    text-decoration: none; /* Removes underline */
}

.whatsapp-float:hover {
    background-color: #128c7e;
    color: #FFF;
    transform: scale(1.1); /* Gentle zoom effect */
    box-shadow: 2px 4px 6px rgba(0,0,0,0.4);
}

/* Pulse Animation to grab attention */
.whatsapp-float {
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

/* Adjust size for mobile screens */
@media (max-width: 768px) {
    .whatsapp-float {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
        font-size: 25px;
    }
}