/* Main Styles for Merzol Schools Platform */

/* Import Google Fonts for better typography */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.7;
    color: var(--text-primary);
    overflow-x: hidden;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Hero Section Styles */
.hero-section {
    background: #ffffff;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    z-index: 1;
}

.hero-section .container {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    color: white;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    animation: fadeInUp 1s ease-out;
}

.hero-subtitle {
    font-size: 1.4rem;
    font-weight: 400;
    color: rgba(255,255,255,0.9);
    margin-bottom: 2.5rem;
    line-height: 1.6;
    animation: fadeInUp 1s ease-out 0.3s both;
}

/* Modern Button Styles */
.btn-primary-modern {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    color: white;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.3);
    animation: fadeInUp 1s ease-out 0.6s both;
}

.btn-primary-modern:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 35px rgba(255, 107, 107, 0.4);
    color: white;
}

.btn-secondary-modern {
    background: transparent;
    border: 2px solid rgba(255,255,255,0.3);
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    color: white;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    animation: fadeInUp 1s ease-out 0.9s both;
}

.btn-secondary-modern:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.6);
    transform: translateY(-2px);
    color: white;
}

/* Navbar Improvements */
.navbar {
    background-color: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px);
    transition: all 0.3s ease;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    position: fixed !important;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.navbar.scrolled {
    background-color: rgba(255, 255, 255, 0.98) !important;
    box-shadow: 0 2px 30px rgba(0,0,0,0.15);
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.5rem;
}

.nav-link {
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 50%;
    background: var(--accent-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 100%;
}

/* Section Styles with Alternating Backgrounds */
.section-light {
    background: #ffffff;
    padding: 5rem 0;
}

.section-gray {
    background: #f8fafc;
    padding: 5rem 0;
}

.section-dark {
    background: #1a202c;
    color: white;
    padding: 5rem 0;
}

/* Card Styles */
.modern-card {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    height: 100%;
}

.modern-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 60px rgba(0,0,0,0.15);
}

.feature-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: white;
    font-size: 1.8rem;
}

/* Typography Improvements */
.section-title {
    font-size: 3rem;
    font-weight: 800;
    color: var(--heading-color);
    margin-bottom: 1rem;
    text-align: center;
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.feature-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--heading-color);
    margin-bottom: 1rem;
}

.feature-description {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

.floating {
    animation: float 6s ease-in-out infinite;
}

/* Contact Section Improvements */
.contact-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: none;
    height: 100%;
}

.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.12);
}

.contact-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

/* WhatsApp Button Improvements */
.whatsapp-btn {
    background: linear-gradient(45deg, #25d366, #128c7e);
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    color: white;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.3);
}

.whatsapp-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 35px rgba(37, 211, 102, 0.4);
    color: white;
}

/* Social Media Icons */
.social-icon {
    width: 50px;
    height: 50px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    text-decoration: none;
}

.social-icon:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .btn-primary-modern,
    .btn-secondary-modern {
        padding: 0.8rem 2rem;
        font-size: 1rem;
    }
}

/* Preloader Background */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #ffffff, #fff7f8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.6s ease, visibility 0.6s ease;
  }
  
  /* Card Style */
  .preloader-card {
    background: #fff;
    padding: 1.5rem 2rem;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
  }
  
  /* Logo + Text */
  .preloader-logo {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  
  .preloader-logo img {
    width: 35px;
    height: 35px;
  }
  
  .brand-name {
    font-size: 1.2rem;
    font-weight: 700;
    background: linear-gradient(45deg, #e63946, #ff6b6b);
    background-clip: text;
    color: transparent;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
  
  /* Spinner */
  .preloader-spinner {
    width: 26px;
    height: 26px;
    border: 3px solid rgba(230,57,70,0.2);
    border-top: 3px solid #e63946;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
  }
  
  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }
  
  /* Hide Preloader After Page Load */
  body.loaded #preloader {
    opacity: 0;
    visibility: hidden;
  }
  
/* Navbar Theme Toggle */
.navbar {
    background-color: var(--navbar-bg) !important;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.navbar .navbar-brand,
.navbar .nav-link,
.navbar .navbar-text {
    color: var(--navbar-text) !important;
}

#theme-toggle {
    cursor: pointer;
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
    border: 1px solid rgba(0,0,0,0.1);
    background-color: transparent;
    color: var(--navbar-text);
    transition: all 0.3s ease;
}

#theme-toggle:hover {
    background-color: rgba(0,0,0,0.05);
}

/* Footer Theme */
footer {
    background-color: var(--footer-bg) !important;
    color: var(--footer-text) !important;
    transition: background-color 0.3s ease;
}

/* Theme Variables */
:root {
    /* Light Theme (Default) */
    --bg-primary: #ffffff;
    --bg-secondary: #f1faee;
    --text-primary: #333;
    --text-secondary: #6b7280;
    --accent-color: #e63946;
    --accent-hover: #c1121f;
    --heading-color: #1d3557;
    --card-bg: #ffffff;
    --card-shadow: 0 4px 6px rgba(0,0,0,0.05);
    --navbar-bg: #ffffff;
    --navbar-text: #333;
    --footer-bg: #1d3557;
    --footer-text: #ffffff;
    --navbar-height: 64px;
}

@media (min-width: 992px) {
    :root {
        --navbar-height: 72px;
    }
}

.content-offset {
    padding-top: calc(var(--navbar-height) + 16px);
}

.mt-6 {
    margin-top: 3rem !important;
}

.mb-6 {
    margin-bottom: 3rem !important;
}

/* Dark Theme */
[data-theme="dark"] {
    --bg-primary: #121212;
    --bg-secondary: #1e1e1e;
    --text-primary: #f1f1f1;
    --text-secondary: #b0b0b0;
    --accent-color: #e63946;
    --accent-hover: #ff6b6b;
    --heading-color: #f1f1f1;
    --card-bg: #2d2d2d;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    --navbar-bg: #1d1d1d;
    --navbar-text: #f1f1f1;
    --footer-bg: #1d1d1d;
    --footer-text: #f1f1f1;
}

/* Global Styles */
body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    background-color: var(--bg-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Smooth page entrance */
html { scroll-behavior: smooth; }

/* Preloader */
#preloader {
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg, #ffffff, #fff7f8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    transition: opacity 0.6s ease, visibility 0.6s ease, transform 0.6s ease;
}

[data-theme="dark"] #preloader {
    background: linear-gradient(180deg, #0f0f10, #151516);
}

#preloader .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 26px;
    border-radius: 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}

#preloader .brand .logo {
    height: 36px;
    width: 36px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: #fff;
    background-image: linear-gradient(135deg, var(--brand), var(--violet));
}

#preloader .brand .logo i { 
    color: #ffffff; 
    font-size: 16px; 
    line-height: 1; 
}

#preloader .brand .name {
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--heading-color);
}

#preloader .brand .name .merz { 
    color: var(--heading-color); 
}

#preloader .brand .name .ol { 
    color: var(--sky); 
}

#preloader .brand .name {
    font-size: 1.2rem;
    font-weight: 700;
    background: linear-gradient(45deg, #e63946, #ff6b6b);
    background-clip: text;
    color: transparent;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#preloader .spinner {
    margin-left: 14px;
    width: 22px;
    height: 22px;
    border: 3px solid rgba(230,57,70,0.25);
    border-top: 3px solid var(--brand);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Hide preloader after load */
body.loaded #preloader { opacity: 0; visibility: hidden; transform: scale(1.02); }

a {
    text-decoration: none;
    transition: all 0.3s ease;
    color: #ffffff;
}

a:hover {
    opacity: 0.85;
    color: var(--accent-hover);
}

/* Hero Section */
.hero-section {
    background-color: var(--bg-primary);
    padding: 5rem 0;
    margin-bottom: 0;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background-color: var(--bg-primary);
    z-index: 0;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: -100px;
    left: -100px;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background-color: rgba(230, 57, 70, 0.03);
    z-index: 0;
}

/* Soft shadow backdrop behind hero visual */
.hero-visual {
    position: relative;
}
.hero-visual::before {
    content: '';
    position: absolute;
    inset: -18px -22px -22px -18px;
    z-index: -1;
    border-radius: 24px;
    filter: blur(24px);
    background: radial-gradient(60% 60% at 40% 30%, rgba(230,57,70,0.30), transparent 70%),
                radial-gradient(60% 60% at 70% 70%, rgba(139,92,246,0.25), transparent 70%);
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--heading-color);
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--accent-color);
    margin-bottom: 1.5rem;
}

.stats-container {
    display: flex;
    justify-content: space-between;
    max-width: 400px;
    margin: 2rem 0;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--heading-color);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Hero image 3D outer shadow effect */
.hero-visual img {
    border-radius: 16px; /* keep rounded look */
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
                filter 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
                box-shadow 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 8px 20px rgba(17, 24, 39, 0.08);
    will-change: transform, filter;
}

.hero-visual:hover img {
    /* lift slightly and scale for depth */
    transform: translateY(-10px) scale(1.03);
    /* strong outer, multi-layer 3D shadow (not inner) */
    filter: drop-shadow(0 10px 18px rgba(17, 24, 39, 0.22))
            drop-shadow(0 28px 46px rgba(17, 24, 39, 0.16))
            drop-shadow(0 60px 70px rgba(17, 24, 39, 0.08));
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.16);
}

/* Section Styling */
section {
    padding: 5rem 0;
    position: relative;
}

section:nth-child(even) {
    background-color: var(--bg-secondary);
}

/* Force specific sections to match hero background and text */
#why-choose,
#testimonials {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary);
}

#why-choose h2,
#testimonials h2 {
    color: var(--heading-color);
}

#why-choose h2,
#contact h2 {
    color: var(--accent-color) !important; /* red */
    background-image: none !important;     /* cancel gradient text */
    -webkit-background-clip: initial !important;
    background-clip: initial !important;
}

#about-partnerships .rounded.shadow-sm {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary);
}

#about-partnerships .rounded.shadow-sm h2,
#about-partnerships .rounded.shadow-sm h3,
#about-partnerships .rounded.shadow-sm h4,
#about-partnerships .rounded.shadow-sm h5 {
    color: var(--heading-color);
}

/* Contact section: unify text color to match heading */
#contact {
    color: var(--heading-color);
}

#contact h2,
#contact h3,
#contact h4,
#contact h5,
#contact p,
#contact small,
#contact span,
#contact li {
    color: var(--heading-color) !important;
}

/* Keep icons and buttons using their original styles */
#contact i {
    color: inherit;
}

.section-header {
    margin-bottom: 3rem;
    text-align: center;
}

.section-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--heading-color);
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background-color: var(--accent-color);
}

/* Scroll reveal animations */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

.section-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
}

/* Card Styling */
.card {
    border: none;
    border-radius: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    margin-bottom: 1.5rem;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    background-color: var(--card-bg);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.15) !important;
}

.card-title {
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--heading-color);
}

.card-text {
    color: var(--text-secondary);
}

.card-img-top {
    height: 180px;
    object-fit: cover;
}

.grade-card {
    text-align: center;
    padding: 2rem 1rem;
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
}

.grade-card .card-title {
    font-size: 1.5rem;
}

.testimonial-card {
    padding: 2rem;
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
}

.testimonial-card .quote {
    font-style: italic;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.testimonial-author {
    display: flex;
    align-items: center;
}

.author-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 1rem;
    object-fit: cover;
}

.author-info h5 {
    margin-bottom: 0.25rem;
    font-weight: 600;
    color: #1e3a8a;
}

.author-info p {
    margin: 0;
    font-size: 0.875rem;
    color: #6b7280;
}

/* Feature Icons */
.feature-icon {
    height: 4rem;
    width: 4rem;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8d7da;
    border-radius: 12px;
    color: #e63946;
    font-size: 1.5rem;
}

/* AI Feature Container */
#aiFeatureContainer {
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-top: 2rem;
}

#aiOutputContainer {
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-top: 1rem;
}

/* Button Styling */
.btn {
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-primary {
    background-color: #e63946;
    border-color: #e63946;
}

.btn-primary:hover {
    background-color: #c1121f;
    border-color: #c1121f;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(230, 57, 70, 0.25);
}

.btn-outline-primary {
    color: #e63946;
    border-color: #e63946;
    background-color: transparent;
}

.btn-outline-primary:hover {
    background-color: #e63946;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(230, 57, 70, 0.25);
}

/* Footer Styling */
/* Light, clean footer */
.site-footer {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    padding: 3rem 0 2rem;
    border-top: 1px solid rgba(0,0,0,0.06);
}

.site-footer h5 {
    color: var(--heading-color);
}

.site-footer .text-muted {
    color: var(--text-secondary) !important;
}

.site-footer a {
    color: var(--text-secondary);
}

.site-footer a:hover {
    color: var(--heading-color);
    text-decoration: none;
}

/* Theme-aware divider in footer */
.site-footer hr {
    border-color: rgba(0,0,0,0.06);
}

[data-theme="dark"] .site-footer {
    border-top-color: rgba(255,255,255,0.08);
}

[data-theme="dark"] .site-footer hr {
    border-color: rgba(255,255,255,0.08);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .hero-section {
        text-align: center;
        padding: 3rem 0;
    }
    
    .hero-section img {
        margin-top: 2rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
    }
    
    .stats-container {
        margin: 2rem auto;
    }
    
    .section-header {
        margin-bottom: 2rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
    }
}

/* Additional Components */
.navbar {
    padding: 1rem 0;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.navbar-brand {
    font-weight: 700;
    color: #1e3a8a;
    font-size: 1.5rem;
}

/* Home page gradient glass navbar */
/* Home: start transparent, become solid on scroll */
body.home .navbar,
body.transparent-nav .navbar {
    background: transparent !important;
    border-bottom: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

body.home.scrolled .navbar,
body.transparent-nav.scrolled .navbar {
    background-color: var(--navbar-bg) !important;
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

/* Ensure content clears fixed navbar when using transparent nav */
body.transparent-nav .content-offset {
    padding-top: 20rem; /* adjust to 7rem if needed */
}

.navbar-nav .nav-link {
    font-weight: 500;
    color: #4b5563;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: #3b82f6;
}

.search-form {
    position: relative;
}

.search-form .form-control {
    border-radius: 20px;
    padding-left: 2.5rem;
    background-color: #f3f4f6;
    border: none;
}

.search-form .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

/* Scroll progress bar for home */
#scrollProgress {
    position: fixed;
    left: 0;
    top: 0;
    height: 3px;
    width: 0;
    z-index: 1500;
    background-image: linear-gradient(90deg, var(--brand), var(--violet));
    box-shadow: 0 0 8px rgba(230,57,70,0.45);
}

/* Custom scrollbar (WebKit) */
body.home::-webkit-scrollbar { height: 10px; width: 10px; }
body.home::-webkit-scrollbar-track { background: transparent; }
body.home::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--brand), var(--violet));
    border-radius: 8px;
}

/* Cursor trail bubbles */
.trail-container { position: fixed; inset: 0; pointer-events: none; z-index: 1200; }
.trail-dot {
    position: absolute;
    width: 10px; height: 10px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 30%, #fff, rgba(255,255,255,0)) ,
                linear-gradient(135deg, var(--brand), var(--sky));
    box-shadow: 0 4px 12px rgba(230,57,70,0.35);
    opacity: 0.9;
    transform: translate(-50%, -50%);
    animation: popFade 1.2s ease forwards;
}

@keyframes popFade {
    0% { transform: translate(-50%, -50%) scale(0.6); opacity: 0.95; }
    70% { opacity: 0.9; }
    100% { transform: translate(-50%, -50%) scale(1.4); opacity: 0; filter: blur(1px); }
}

/* Auth pages */
.auth-card {
    /* Glassmorphism */
    background: rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    backdrop-filter: saturate(140%) blur(12px);
    -webkit-backdrop-filter: saturate(140%) blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}

[data-theme="dark"] .auth-card {
    background: rgba(18, 18, 18, 0.55);
}

.auth-page .form-control {
    background: #fff;
    border: 1px solid #e5e7eb;
}

/* Subtle hover lift for auth card */
.auth-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.16);
}

.social-btn {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ----------------------------------------------------- */
/* Attractive UI Enhancements for Youthful Look & Feel   */
/* ----------------------------------------------------- */

/* Extra theme tokens */
:root {
    --brand: #e63946;
    --brand-2: #ff7a90;
    --brand-3: #ffd1d8;
    --sky: #22d3ee;
    --violet: #8b5cf6;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --ring: rgba(230, 57, 70, 0.25);
}

[data-theme="dark"] {
    --glass-bg: rgba(30, 30, 30, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --ring: rgba(255, 107, 107, 0.35);
}

/* Subtle playful background accents */
body::before {
    content: '';
    position: fixed;
    inset: -20vh -20vw;
    background: radial-gradient(60vw 60vh at 10% 10%, rgba(255, 122, 144, 0.07), transparent),
                radial-gradient(50vw 50vh at 90% 20%, rgba(34, 211, 238, 0.06), transparent),
                radial-gradient(35vw 35vh at 50% 100%, rgba(139, 92, 246, 0.06), transparent);
    pointer-events: none;
    z-index: 0;
}

/* Elevate stacking of main content above accents */
body > *:not(script) {
    position: relative;
    z-index: 1;
}

/* Glassy navbar feel */
.navbar {
    backdrop-filter: saturate(140%) blur(8px);
    -webkit-backdrop-filter: saturate(140%) blur(8px);
    border-bottom: 1px solid var(--glass-border);
}

/* Gradient heading text for sections */
.section-title,
.display-6,
.hero-title {
    background-image: linear-gradient(90deg, var(--heading-color), var(--brand));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Glow-on-hover links for callouts like Back to ... */
a.text-danger:hover {
    text-shadow: 0 0 12px rgba(230, 57, 70, 0.45);
}

/* Cards: animated lift, ring and border shimmer */
.card {
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 18px 45px rgba(0,0,0,0.12);
}

.card .card-body {
    position: relative;
}

.card .card-body::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    pointer-events: none;
    box-shadow: 0 0 0 0 var(--ring);
    transition: box-shadow 0.25s ease;
}

.card:hover .card-body::after {
    box-shadow: 0 0 0 6px var(--ring);
}

/* Feature icon bounce */
@keyframes floaty {
    0% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
    100% { transform: translateY(0); }
}

.feature-icon {
    background: linear-gradient(180deg, rgba(230,57,70,0.12), rgba(230,57,70,0.06));
    border: 1px solid rgba(230, 57, 70, 0.25);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.feature-icon:hover {
    transform: translateY(-4px) scale(1.04);
    box-shadow: 0 10px 20px rgba(230, 57, 70, 0.25);
    animation: floaty 1.6s ease-in-out infinite;
}

/* Buttons: vibrant gradient + glow */
.btn-danger,
.btn-primary,
.btn {
    position: relative;
    overflow: hidden;
}

.btn-danger,
.btn-primary {
    background-image: linear-gradient(90deg, var(--brand), var(--violet));
    border: none;
    color: #fff;
}

.btn-danger:hover,
.btn-primary:hover {
    filter: brightness(1.05);
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(230, 57, 70, 0.35), 0 6px 14px rgba(139, 92, 246, 0.25);
}

.btn-outline-primary,
.btn-outline-danger {
    border-color: var(--brand);
    color: var(--brand);
}

.btn-outline-primary:hover,
.btn-outline-danger:hover {
    background-image: linear-gradient(90deg, var(--brand), var(--brand-2));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 10px 22px rgba(230,57,70,0.25);
}

/* Inputs with playful focus ring */
.form-control:focus,
.form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(230, 57, 70, 0.15);
}

/* Footer polish */
.site-footer {
    background: linear-gradient(180deg, rgba(0,0,0,0.0), rgba(0,0,0,0.03));
}

/* Utility: gradient text */
.gradient-text {
    background-image: linear-gradient(90deg, var(--brand), var(--sky), var(--violet));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
}

/* Utility: soft container shadow */
.soft-shadow {
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

/* Make alerts a bit friendlier */
.alert-light {
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .alert-light {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
}

/* Chapters page card layout */
.chapter-card {
  border-radius: 16px;
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  border: 1px solid rgba(0, 0, 0, 0.04);
}
.chapter-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 36px rgba(0,0,0,0.12);
}
.chapter-card .card-title {
  color: var(--heading-color);
}

.chapter-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: #fff;
  font-size: 1.1rem;
  box-shadow: 0 6px 16px rgba(109, 40, 217, 0.25);
}

/* PDF availability pill */
.pdf-badge {
  font-weight: 600;
  background: rgba(108,117,125,0.08);
  border: 1px solid rgba(108,117,125,0.2);
}
.pdf-badge.text-success {
  background: rgba(25,135,84,0.10);
  border-color: rgba(25,135,84,0.25);
}

/* AI CTA button */
.ai-btn {
  border-color: var(--brand);
  color: var(--brand);
}
.ai-btn:hover {
  background-image: linear-gradient(90deg, var(--brand), var(--brand-2));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 22px rgba(230,57,70,0.25);
}

/* Dark theme adjustments */
[data-theme="dark"] .chapter-card {
  border-color: rgba(255,255,255,0.06);
  box-shadow: 0 10px 28px rgba(0,0,0,0.4);
}
[data-theme="dark"] .chapter-icon { box-shadow: 0 8px 20px rgba(109, 40, 217, 0.35); }
[data-theme="dark"] .pdf-badge { border-color: rgba(255,255,255,0.12); }

/* Global page shell utilities for sticky footer */
.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.page-main {
  flex: 1 0 auto;
}
.site-footer { /* ensure footer sits at bottom when using .page-shell */
  margin-top: auto;
}
