/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
    /* Colors */
    --primary: #8b5cf6;       /* Violet */
    --primary-glow: rgba(139, 92, 246, 0.5);
    --secondary: #06b6d4;     /* Cyan */
    --dark-bg: #0f172a;       /* Deep Navy */
    --darker-bg: #020617;     /* Almost Black */
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    /* Effects */
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --neon-shadow: 0 0 10px var(--primary-glow), 0 0 20px var(--primary-glow);
}

/* Light Theme Variables */
[data-theme="light"] {
    --dark-bg: #f1f5f9;
    --darker-bg: #e2e8f0;
    --card-bg: rgba(255, 255, 255, 0.8);
    --text-main: #0f172a;
    --text-muted: #475569;
    --glass-border: 1px solid rgba(0, 0, 0, 0.1);
}

* {
    margin: 5;
    padding: 0;
    box-sizing: border-box;
    cursor: none; /* Hide default cursor for custom one */
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.6;
}

h1, h2, h3, h4, .logo {
    font-family: 'Orbitron', sans-serif; /* Futuristic Font */
    letter-spacing: 1px;
}

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    z-index: 10000;
    width: 0%;
}

/* =========================================
   2. CUSTOM CURSOR
   ========================================= */
.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--secondary);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px var(--secondary);
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 1px solid var(--secondary);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, background 0.2s;
}

/* =========================================
   3. NAVIGATION
   ========================================= */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.5rem 0;
    z-index: 1000;
    transition: 0.3s;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: var(--glass-border);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
}

/* Navigation Logo Size */
.nav-logo-img {
    height: 50px; /* Adjust this number to make it bigger/smaller */
    width: auto;  /* Keeps the aspect ratio correct */
    vertical-align: middle;
}

.text-primary { color: var(--primary); }

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: 0.3s;
    position: relative;
}

.nav-link:hover { color: var(--primary); }

.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Container Layout */
.steps-container {
    display: flex;               /* Aligns items side-by-side */
    justify-content: space-between; /* Spreads them out evenly */
    align-items: flex-start;     /* Aligns them at the top */
    gap: 2rem;                   /* Adds space between cards */
    position: relative;          /* Creates context for the connector line */
    padding: 2rem 0;
}

/* Individual Cards */
.step-card {
    flex: 1;                     /* Makes all cards equal width */
    text-align: center;          /* Centers the text */
    z-index: 2;                  /* Keeps cards on top of the line */
    background: transparent;     /* Or your theme background color */
}

/* The Connecting Line */
.steps-connector {
    position: absolute;          /* Takes it out of the flex flow */
    top: 50px;                   /* Adjust this to align with your numbers */
    left: 0;
    width: 100%;                 /* Stretches across the container */
    height: 2px;                 /* Thickness of the line */
    background: var(--primary-color, #00f2fe); /* Uses your theme color */
    z-index: 1;                  /* Puts it behind the cards */
    opacity: 0.5;
}

/* --- Infinite Logo Carousel Styles --- */
.partners-section {
    padding: 4rem 0;
    background: transparent; /* Or a specific dark color like #0a0a0a */
    overflow: hidden; /* Hides the scrollbar */
}

.partners-section h2 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2rem;
}

/* The container that creates the fading edges */
.logos-container {
    overflow: hidden;
    padding: 20px 0;
    white-space: nowrap;
    position: relative;
}

/* Optional: Fades the left and right edges for a cool effect */
.logos-container:before,
.logos-container:after {
    position: absolute;
    top: 0;
    width: 150px;
    height: 100%;
    content: "";
    z-index: 2;
}

/* Left Fade */
.logos-container:before {
    left: 0;
    background: linear-gradient(to right, rgba(0,0,0,1), transparent);
}

/* Right Fade */
.logos-container:after {
    right: 0;
    background: linear-gradient(to left, rgba(0,0,0,1), transparent);
}

/* The Moving Track */
.logos-slide {
    display: inline-block;
    animation: slide-logos 35s infinite linear;
}

/* Individual Logo Items */
.logos-slide i, 
.logos-slide img {
    height: 50px;
    margin: 0 40px;
    font-size: 3rem; /* Size if using Icons */
    color: rgba(255, 255, 255, 0.3); /* Greyed out initially */
    transition: all 0.3s ease;
    cursor: pointer;
    vertical-align: middle;
}

/* Hover Effect: Lights up the logo */
.logos-slide i:hover, 
.logos-slide img:hover {
    color: var(--primary-color, #00f2fe);
    transform: scale(1.1);
    filter: drop-shadow(0 0 10px rgba(0, 242, 254, 0.5));
}

/* The Infinite Animation */
@keyframes slide-logos {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-100%);
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .logos-slide i, .logos-slide img {
        margin: 0 20px;
        font-size: 2rem;
    }
}

/* =========================================
Optional: Stacks them vertically again on Mobile phones
   ========================================= */
@media (max-width: 768px) {
    .steps-container {
        flex-direction: column;
    }
    .steps-connector {
        display: none; /* Hides the horizontal line on mobile */
    }
}

/* Container Layout */
.steps-container {
    display: flex;               /* Aligns items side-by-side */
    justify-content: space-between; /* Spreads them out evenly */
    align-items: flex-start;     /* Aligns them at the top */
    gap: 2rem;                   /* Adds space between cards */
    position: relative;          /* Creates context for the connector line */
    padding: 2rem 0;
}

/* Option 1: If you are using a Grid (Recommended) */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    /* This 'gap' property controls the space between the cards */
    gap: 2rem; 
    margin-top: 2rem;
}

/* Adds space below the cards section so it doesn't touch the form */
.info-section {
    margin-bottom: 5rem; /* You can adjust this number (e.g., 3rem or 80px) */
    position: relative;  /* Ensures z-index stacking is correct */
    z-index: 2;
}

/* Optional: Ensure the next section starts cleanly */
.contact-form-section {
    position: relative;
    z-index: 2;
}

/* Individual Cards */
.step-card {
    flex: 1;                     /* Makes all cards equal width */
    text-align: center;          /* Centers the text */
    z-index: 2;                  /* Keeps cards on top of the line */
    background: transparent;     /* Or your theme background color */
}

/* The Connecting Line */
.steps-connector {
    position: absolute;          /* Takes it out of the flex flow */
    top: 50px;                   /* Adjust this to align with your numbers */
    left: 0;
    width: 100%;                 /* Stretches across the container */
    height: 2px;                 /* Thickness of the line */
    background: var(--primary-color, #00f2fe); /* Uses your theme color */
    z-index: 1;                  /* Puts it behind the cards */
    opacity: 0.5;
}

/* Styling for the Question area (making it look clickable) */
.faq-question {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}


/* Adds space below the cards section so it doesn't touch the form */
.info-section {
    margin-bottom: 5rem; /* You can adjust this number (e.g., 3rem or 80px) */
    position: relative;  /* Ensures z-index stacking is correct */
    z-index: 2;
}

/* Optional: Ensure the next section starts cleanly */
.contact-form-section {
    position: relative;
    z-index: 2;
}

/* Center the text and the container items */
.newsletter-box {
    text-align: center;         /* Centers the h2 and p text */
    display: flex;
    flex-direction: column;     /* Stacks items vertically */
    align-items: center;        /* Centers items horizontally */
    justify-content: center;
    padding: 4rem 2rem;         /* Adds breathing room inside the box */
}

/* Align the input and button side-by-side in the center */
.newsletter-form {
    display: flex;
    justify-content: center;    /* Centers the input and button */
    align-items: center;
    gap: 1rem;                  /* Adds space between input and button */
    margin-top: 1.5rem;
    flex-wrap: wrap;            /* Allows them to stack on very small screens */
    width: 100%;
    max-width: 600px;           /* Prevents form from getting too wide */
}

/* Optional: Ensure input looks good */
.newsletter-input {
    min-width: 250px;           /* Gives the input a decent starting size */
}

/* 1. Target the box specifically to center text and stack items */
section.newsletter-section .newsletter-box {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important; /* Centers H2, P, and Form horizontally */
    justify-content: center !important;
    text-align: center !important;
    width: 100%;
}

/* 2. Target the form to center the input and button */
section.newsletter-section .newsletter-form {
    display: flex !important;
    justify-content: center !important; /* Centers the input and button */
    align-items: center !important;
    flex-wrap: wrap; /* Allows wrapping on mobile */
    gap: 1rem; /* Space between input and button */
    width: 100%;
    margin-top: 1.5rem;
}

/* 3. Make sure the input doesn't get squashed */
section.newsletter-section .newsletter-input {
    min-width: 300px; /* Makes the input bar wider like in your design */
    max-width: 100%;
}

.step-icon {
    /* Shape & Size */
    width: 60px;
    height: 60px;
    border-radius: 50%;
    
    /* Centering the Icon */
    display: flex;
    justify-content: center;
    align-items: center;

    /* Colors */
    background-color: #2563eb; /* Vibrant Blue */
    color: white;
    
    /* Icon Specifics */
    font-size: 1.5rem; /* Size of the icon inside the circle */
    
    /* Position & Glow */
    margin: 0 auto 15px auto;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.4);
    position: relative; 
    z-index: 2; /* Keeps icon on top of the connector line */
    background-clip: padding-box; /* Ensures clean edges */
    border: 5px solid #f8fafc; /* Creates the gap between line and circle */
}

/* Icon rotation transition */
.faq-question i {
    transition: transform 0.3s ease;
}

/* Rotate icon when active */
.faq-item.active .faq-question i {
    transform: rotate(180deg);
    color: var(--primary-color, #00f2fe); /* Optional: Highlights icon */
}

/* The Answer: Hidden by default */
.faq-answer {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease-out, opacity 0.4s ease-out, padding 0.4s ease;
}

/* The Answer: Visible when active */
.faq-item.active .faq-answer {
    max-height: 300px; /* Large enough to fit the text */
    opacity: 1;
    padding-bottom: 1rem; /* Adds space at bottom when open */
}


/* =========================================
   4. HERO SECTION & PARTICLES
   ========================================= */
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px;
    overflow: hidden;
}

#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    align-items: center;
}

.badge {
    background: rgba(139, 92, 246, 0.1);
    color: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--primary);
    font-size: 0.8rem;
    font-family: 'Orbitron', sans-serif;
}

h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin: 1.5rem 0;
}

.text-gradient {
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* 3D Tilt Cards in Hero */
.hero-image-wrapper {
    position: relative;
    height: 400px;
    transform-style: preserve-3d;
}

.hero-card-solid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
    border: 1px solid var(--primary);
    box-shadow: var(--neon-shadow);
}

.hero-card-glass {
    position: absolute;
    bottom: -30px;
    left: -30px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 15px;
    border: var(--glass-border);
    width: 200px;
    z-index: 3;
    animation: float 4s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* =========================================
   5. BUTTONS & UI ELEMENTS
   ========================================= */
.btn {
    padding: 0.8rem 1.8rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s;
    border: none;
    position: relative;
    overflow: hidden;
    cursor: none;
    display: inline-block;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 15px var(--primary-glow);
}

.btn-primary:hover {
    background: #7c3aed;
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-main);
    margin-left: 1rem;
}

/* Ripple Animation */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}
@keyframes ripple {
    to { transform: scale(4); opacity: 0; }
}

/* =========================================
   6. LIBRARY & CARDS
   ========================================= */
.library-section, .stats-section, .mission-section, .contact-section {
    padding: 5rem 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

/* Filters */
.filter-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 0.5rem 1.5rem;
    margin-left: 0.5rem;
    border-radius: 20px;
    transition: 0.3s;
}

.filter-btn.active, .filter-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.book-card {
    background: var(--card-bg);
    border: var(--glass-border);
    border-radius: 15px;
    overflow: hidden;
    transition: transform 0.3s;
}

.card-image {
    height: 200px;
    position: relative;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.5s;
}

.book-card:hover .card-image img {
    transform: scale(1.1);
}

.card-info {
    padding: 1.5rem;
}

.tag {
    color: var(--secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 700;
}

/* =========================================
   7. STATS & MISSION
   ========================================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
    padding: 3rem;
    border-radius: 20px;
    border: var(--glass-border);
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
    font-family: 'Orbitron', sans-serif;
}

.split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.category-card {
    background: var(--card-bg);
    padding: 3rem;
    border-radius: 20px;
    border: var(--glass-border);
    text-align: center;
}

.icon-xl {
    font-size: 3rem;
    color: var(--secondary);
    margin-bottom: 1.5rem;
}

/* =========================================
   8. FORMS & FOOTER
   ========================================= */
.glass-form {
    background: rgba(15, 23, 42, 0.6);
    padding: 3rem;
    border-radius: 20px;
    border: var(--glass-border);
    backdrop-filter: blur(10px);
}

.form-group { margin-bottom: 1.5rem; }

.form-input {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

/* =========================================
   COMPACT FOOTER (Fixed for Mobile & Colors)
   ========================================= */

.site-footer {
    background-color: var(--darker-bg); 
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 40px;
    color: var(--text-muted);
    font-size: 0.9rem;
    width: 100%;
    position: relative;
    z-index: 10;
}

/* Forces all links in footer to be your text color, NOT blue/purple */
.site-footer a {
    color: var(--text-muted) !important;
    text-decoration: none;
    transition: 0.3s;
}

.site-footer a:hover {
    color: var(--secondary) !important; /* Cyan on hover */
}

.footer-layout {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 40px;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}

/* --- 1. Brand Column (Left) --- */
.brand-col {
    flex: 1;
    max-width: 300px;
}

.logo-img {
    max-width: 120px;
    height: auto;
    opacity: 0.9;
    display: block; /* Fixes spacing issues */
    margin-bottom: 10px;
}

.footer-tagline {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 2px;
    color: var(--secondary);
    margin-bottom: 15px;
    text-transform: uppercase;
    display: block;
}

address {
    font-style: normal;
    line-height: 1.5;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* --- 2. Links Column (Center) --- */
.links-col {
    flex: 1;
    display: flex;
    justify-content: center;
}

.link-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex; /* Horizontal on Desktop */
    gap: 25px;
}

.link-list a {
    font-weight: 500;
    font-size: 0.9rem;
}

/* --- 3. Social Column (Right) --- */
.social-col {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.social-ring {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.02);
}

.social-ring:hover {
    border-color: var(--primary);
    background: transparent;
    color: #fff !important;
    transform: translateY(-3px);
    box-shadow: 0 0 15px var(--primary-glow);
}

/* --- Bottom Bar --- */
.footer-bottom {
    background-color: #000000;
    padding: 15px 0;
    font-size: 0.75rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* =========================================
   MISSING MOBILE PART (This fixes the layout!)
   ========================================= */
@media (max-width: 768px) {
    .footer-layout {
        flex-direction: column; /* Stacks everything vertically */
        text-align: center;
        gap: 30px;
    }

    .brand-col, .links-col, .social-col {
        max-width: 100%;
        width: 100%;
        justify-content: center;
        align-items: center;
    }
    
    .brand-col {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    /* Stacks the links vertically on phone so they are easy to read */
    .link-list {
        flex-direction: column; 
        gap: 15px;
    }
    
    .social-col {
        justify-content: center;
    }
}

/* --- GLOBAL MOBILE FIXES --- */
@media screen and (max-width: 768px) {
    /* 1. Prevent Side Scrolling */
    html, body {
        width: 100%;
        overflow-x: hidden !important;
    }
    
    /* 2. Fix Header/Purple Box Overlap */
    .nav-container {
        flex-direction: column;
        height: auto;
        padding-bottom: 15px;
    }
    
    /* Hides the floating CTA button on mobile if it blocks the view */
    .header-btn, .cta-button, .btn-primary { 
        display: none !important; 
    }
    
    /* 3. Stop Text from getting cut off */
    .container, p, h1, h2 {
        max-width: 100% !important;
        width: auto !important;
        word-wrap: break-word;
    }
}

/* =========================================
   9. MOBILE RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-image-wrapper {
        display: none; /* Hide 3D element on mobile for performance */
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .nav-menu {
        display: none; /* Add JS toggle logic for full mobile menu */
    }
    
    .split-layout {
        grid-template-columns: 1fr;
    }
    
    h1 { font-size: 2.5rem; }
}

/* =======================================================
   MOBILE REPAIR KIT (Paste at the very bottom of CSS)
   ======================================================= */

@media screen and (max-width: 768px) {

    /* 1. STOP THE SIDE-SCROLLING (The Wiggle) */
    html, body {
        width: 100%;
        overflow-x: hidden !important; /* Cuts off anything sticking out */
        margin: 0;
        padding: 0;
    }

    /* 2. FIX THE TEXT CUT-OFF (Mission Section) */
    .container, section, p, h1, h2, h3, h4, div {
        max-width: 100% !important; /* Forces boxes to fit the screen */
        width: auto !important;
        box-sizing: border-box;
    }

    p {
        padding-right: 15px; /* Adds safety space on the right */
        word-wrap: break-word; /* Forces long words to wrap */
    }

    /* 3. FIX THE HEADER & PURPLE BOX OVERLAP */
    .nav-container {
        display: flex;
        flex-direction: column; /* Stacks Logo on top of Menu */
        align-items: center;
        padding: 10px;
        position: relative;
    }

    /* If you can find the class for that Purple Box, add it here to hide it */
    .header-cta, .cta-button, .header-right { 
        display: none !important; /* Hides the floating box on mobile */
    }
    
    /* 4. FIX THE FOOTER (Stacking Columns) */
    .footer-layout {
        display: flex;
        flex-direction: column; /* Stacks columns vertically */
        align-items: center;
        text-align: center;
        gap: 40px;
    }

    .footer-col, .brand-col, .links-col, .social-col {
        width: 100%;
        max-width: 100%;
    }

    /* 5. FIX THE LINKS TURNING BLUE */
    a {
        color: inherit; /* Forces links to use your theme color, not default blue */
    }
}

/* =========================================
   WEBI-STYLE MOBILE MENU (FINAL VERSION)
   ========================================= */

/* Hide Mobile Elements on Desktop */
.mobile-header-actions, .mobile-overlay, .mobile-theme-btn {
    display: none;
}

.desktop-menu {
    display: flex;
    gap: 20px;
    align-items: center;
}

/* --- THEME TOGGLE BTN --- */
.theme-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.theme-btn:hover {
    background: rgba(255,255,255,0.1);
}

/* --- MOBILE STYLES --- */
@media (max-width: 768px) {

    /* 1. Navbar Adjustments */
    .desktop-menu { display: none; } /* Hide old menu */
    
    .nav-container {
        flex-direction: row !important; /* Keep Logo and Icons side-by-side */
        justify-content: space-between;
        align-items: center;
        padding: 15px 20px;
    }

    /* 2. Header Icons (Call, Text, Burger) */
    .mobile-header-actions {
        display: flex;
        align-items: center;
        gap: 15px;
    }
    
    .mobile-theme-btn {
        display: flex; /* Show moon icon on mobile */
    }

    .header-action {
        color: white;
        text-decoration: none;
        font-size: 0.9rem;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 5px;
    }

    .header-action i {
        font-size: 0.85rem; 
    }

    /* Hamburger */
    .hamburger {
        display: block;
        cursor: pointer;
    }
    .bar {
        width: 22px;
        height: 2px;
        background-color: white;
        margin: 5px 0;
        display: block;
    }

    /* 3. THE FULL SCREEN OVERLAY (Fixed Width) */
    .mobile-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;       /* Force Full Width */
        height: 100vh;      /* Force Full Height */
        background-color: #0f172a; /* Dark Background */
        z-index: 99999;     /* Top Layer */
        transform: translateX(100%); /* Hidden */
        transition: transform 0.3s ease-in-out;
        overflow-y: auto;   /* Scrollable */
    }

    /* Slide in effect */
    .mobile-overlay.active {
        transform: translateX(0);
    }

    /* Overlay Header */
    .overlay-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 20px;
        background-color: #1e293b;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .menu-title {
        font-size: 1.2rem;
        font-weight: bold;
        color: white;
    }

    .close-btn {
        font-size: 1.5rem;
        color: white;
        cursor: pointer;
        padding: 5px;
    }

    /* Overlay Content */
    .overlay-content {
        padding: 20px;
    }

    /* Buttons Row */
    .overlay-actions-row {
        display: flex;
        gap: 10px;
        margin-bottom: 15px;
    }

    .overlay-btn {
        flex: 1;
        padding: 12px 5px;
        text-align: center;
        border-radius: 5px;
        text-decoration: none;
        font-weight: bold;
        font-size: 0.85rem;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        white-space: nowrap; /* Prevents text breaking */
    }

    /* Button Styles */
    .outline-btn {
        border: 2px solid var(--primary);
        color: var(--primary);
        background: transparent;
    }

    .solid-btn {
        background-color: #2563eb; 
        color: white;
        border: none;
    }

    .proposal-btn {
        background-color: #3b82f6; 
        color: white;
        width: 100%;
        margin-bottom: 30px;
        padding: 15px;
    }

    /* Link List */
    .overlay-links {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .overlay-links li {
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .overlay-links a {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px 0;
        color: white;
        text-decoration: none;
        font-weight: bold;
        font-size: 1rem;
    }

    .arrow {
        font-size: 0.8rem;
        color: #94a3b8;
    }
}

/* =========================================
   FINAL MOBILE REPAIR KIT 
   ========================================= */

@media screen and (max-width: 768px) {

    /* --- 1. CURSOR FIX (CRITICAL) --- */
    /* Re-enables the normal touch interaction so you can click things */
    * {
        cursor: auto !important;
    }

    /* Hides the decorative circles so they don't freeze on the screen */
    .cursor-dot, 
    .cursor-outline {
        display: none !important;
    }

    /* --- 2. BRING BACK MISSING BUTTONS --- */
    /* Forces "Explore Library" and "View Here" to reappear */
    .btn-primary, 
    .btn-secondary {
        display: inline-block !important;
    }

    /* --- 3. FIX BUTTON SIZING FOR TOUCH --- */
    /* Stacks buttons vertically and makes them full width for easy tapping */
    .hero-btns {
        display: flex;
        flex-direction: column;
        gap: 15px;            /* Space between buttons */
        margin-top: 25px;
        width: 100%;
    }

    .btn {
        width: 100%;          /* Full width across the screen */
        padding: 16px 0;      /* Taller button is easier to tap */
        margin: 0 !important; /* Removes messy side margins */
        text-align: center;
    }

    /* --- 4. FIX HERO OVERLAP & TEXT SIZE --- */
    /* Pushes the content down so it's not hidden behind the menu */
    .hero-section {
        padding-top: 150px; 
        min-height: auto;     /* Let content define height, not screen size */
        text-align: center;
        align-items: flex-start;
    }

    /* Shrinks the giant headline so it fits on screen */
    h1 {
        font-size: 2.2rem;
        line-height: 1.2;
        padding: 0 10px;
    }
    
    /* Adds breathing room to other sections */
    section {
        padding: 3rem 20px;
    }
}

/* =========================================
   MOBILE FIXES PART 2 (About & Testimonials)
   Paste this at the VERY bottom of styles.css
   ========================================= */

@media screen and (max-width: 768px) {

    /* --- 1. FIX SQUASHED TESTIMONIAL ICONS --- */
    /* This stops the icons from turning into ovals */
    .testimonial-card img, 
    .review-avatar, 
    .user-icon,
    .testimonial-item div[class*="icon"], /* Catches generic icon divs */
    .testimonial-item img {
        flex-shrink: 0 !important; /* CRITICAL: Prevents squashing */
        width: 50px !important;    /* Force perfect width */
        height: 50px !important;   /* Force perfect height */
        min-width: 50px !important;
        border-radius: 50% !important; /* Ensures it stays a circle */
        object-fit: cover;         /* Ensures image inside doesn't warp */
    }

    /* --- 2. FIX 'OUR MISSION' OVERLAPPING TEXT --- */
    /* Resets the layout so text doesn't sit on top of headers */
    .mission-section, 
    .about-content,
    .about-section {
        display: flex !important;
        flex-direction: column !important; /* Stacks items vertically */
        height: auto !important;
        padding-top: 40px !important;
        padding-bottom: 40px !important;
    }

    /* Force the "Our Mission" header to have its own space */
    .mission-section h1, 
    .mission-section h2,
    .about-section h1,
    .about-section h2 {
        position: relative !important; /* Stops it from floating behind text */
        margin-bottom: 25px !important; /* Pushes the paragraph down */
        z-index: 5;
        width: 100%;
        line-height: 1.3;
        top: auto !important; 
        left: auto !important;
        transform: none !important; /* Removes any fancy desktop positioning */
    }

    /* --- 3. FIX CUT-OFF IMAGES (Circuit Board) --- */
    /* Ensures the image fits the screen and doesn't cover text */
    .mission-section img,
    .about-section img {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        margin-top: 30px !important; /* Adds space above the image */
        margin-bottom: 30px !important;
        display: block;
        position: relative !important;
        top: auto !important;
    }
}

/* =======================================================
   FINAL REPAIR KIT (Paste at bottom of styles.css)
   ======================================================= */

/* --- 1. MOBILE HEADER FIX (Prevents text hiding under Navbar) --- */
@media screen and (max-width: 768px) {
    
    /* Forces ALL top-level headers to push content down */
    header, 
    .page-header, 
    .hero-section,
    .mission-section {
        padding-top: 160px !important; /* Large space to clear the Nav bar */
        height: auto !important;       /* Allow height to grow with text */
        min-height: auto !important;   /* content determines height */
        align-items: flex-start !important; /* Align text to top (with padding) instead of center */
    }

    /* specific fix for the text container */
    .hero-content,
    .header-content {
        margin-top: 20px !important;
        padding-bottom: 40px !important;
    }
}


/* --- 2. CAROUSEL FIX (Prevents merging & glitching) --- */
/* We switch to a flex layout which is much more stable than inline-block */

.logos-container {
    display: flex !important;
    width: 100%;
    overflow: hidden;
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.logos-slide {
    display: flex !important;
    align-items: center;
    /* This ensures the track is always wide enough */
    width: max-content !important; 
    /* This ensures the duplicate track doesn't shrink */
    flex-shrink: 0 !important; 
    animation: slide-logos 30s linear infinite;
}

/* Force specific sizing for the icons */
.logos-slide img, 
.logos-slide i {
    flex-shrink: 0 !important;  /* Stops the squashing */
    width: 60px !important;     /* Fixed width */
    height: 60px !important;    /* Fixed height */
    font-size: 3rem !important; /* Fixes font-awesome icon size */
    margin: 0 40px !important;  /* The gap between logos */
    object-fit: contain;        /* Keeps images looking correct */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Reset the animation to ensure it flows left perfectly */
@keyframes slide-logos {
    from { transform: translateX(0); }
    to { transform: translateX(-100%); }
}

/* Stop individual logos from squashing on phone screens */
.logos-slide i, 
.logos-slide img {
    flex-shrink: 0 !important;
    margin: 0 30px !important; /* Consistent spacing */
}

/* --- 2. ABOUT US OVERLAP FIX --- */
/* We added .info-section here so it applies to your About page too */

@media screen and (max-width: 768px) {
    
    /* Target the specific class used in about.html */
    .info-section,
    .mission-section {
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        padding-top: 20px !important;
    }

    /* Force the Header (Our Mission) to sit properly */
    .info-section h2,
    .mission-section h2 {
        position: relative !important;
        margin-bottom: 30px !important; /* Pushes the paragraph down */
        width: 100%;
        display: block !important;
    }

    /* Fix the text container */
    .info-section .split-layout,
    .mission-section .split-layout {
        display: flex !important;
        flex-direction: column !important;
        gap: 30px;
    }

    /* Fix the Image overlapping the text */
    .info-section img,
    .mission-section img {
        width: 100% !important;
        height: auto !important;
        margin-top: 20px !important;
        order: 2; /* Ensures image sits below text on mobile if desired */
    }
}
