/*
    File: style.css (ULTRA-STABLE FINAL FIX - Aggressive Mobile Positioning)
    Purpose: Global Stylesheet for eSarthi Education - GUARANTEEING correct header flow.
*/

/* === GLOBAL RESET AND TYPOGRAPHY === */
body { 
    font-family: 'Poppins', Arial, sans-serif; 
    margin: 0; 
    padding: 0; 
    background-color: #f8f9fa; 
    color: #333; 
    line-height: 1.6;
}
* {
    box-sizing: border-box;
    transition: all 0.25s ease-in-out; 
}
a { text-decoration: none; color: #0f2b46; }
h1, h2, h3, h4, h5 { color: #0f2b46; font-weight: 700; }

/* === UTILITY AND CONTAINERS (Final Version) === */
.cool-shadow { box-shadow: 0 10px 20px rgba(0,0,0,0.1), 0 6px 6px rgba(0,0,0,0.05); }
.cool-hover:hover { transform: translateY(-3px) scale(1.005); box-shadow: 0 12px 24px rgba(0,0,0,0.2); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; }
.content-container { width: 96%; max-width: 1200px; margin: auto; padding: 20px 0; margin-top: 20px; }
.dark-section-title { color: #ffc107 !important; }
.dark-section-text { color: #f0f0f0; font-size: 1.1em; }


/* === 1. HEADER/NAV BAR STYLES === */
.header { 
    background-color: rgba(15, 43, 70, 0.98); 
    color: white; 
    padding: 15px 4%; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25); 
    position: sticky; 
    top: 0;
    z-index: 1000;
    /* Removed flex-wrap: wrap here to prevent incorrect stacking on smaller flex containers */
}
.header .logo { display: flex; align-items: center; }
.header .logo img { height: 40px; margin-right: 10px; border-radius: 50%; } 
.header .logo a { color: white; font-size: 1.5em; font-weight: 700; }

/* Desktop Navigation */
.header nav { 
    display: flex; 
    align-items: center; 
    flex-grow: 1;
    justify-content: flex-end; 
}
.header nav a { color: white; margin-left: 20px; font-weight: 500; padding: 8px 0; position: relative; }
.header nav a:after { content: ''; position: absolute; width: 0; height: 2px; bottom: 0; left: 0; background-color: #ffc107; transition: width 0.3s; }
.header nav a:hover:after { width: 100%; }

/* --- HEADER BUTTONS --- */
.header .btn-primary { background-color: #ffc107; color: #333; padding: 10px 20px; border-radius: 30px; font-size: 0.9em; margin-left: 20px; font-weight: bold; box-shadow: 0 3px #e0a800; border: none; display: inline-block; }
.header .btn-primary:active { transform: translateY(2px); box-shadow: 0 1px #e0a800; }
.header .btn-primary.admissions { background-color: #dc3545; color: white; box-shadow: 0 3px #b82c3a; }
.header .btn-primary.admissions:active { transform: translateY(2px); box-shadow: 0 1px #b82c3a; }

/* Hamburger Checkbox and Icon (Hidden by default) */
.menu-toggle { display: none; }
.menu-icon { display: none; color: white; font-size: 1.5em; cursor: pointer; padding: 5px; }


/* === 2. HOMEPAGE & CONTENT STYLES (Final Version) === */
.section-title { text-align: center; margin: 50px 0 30px 0; font-size: 2.5em; color: #0f2b46; position: relative; font-weight: 800; text-transform: uppercase; }
.section-title::after { content: ''; display: block; width: 80px; height: 4px; background: #ffc107; margin: 10px auto 0; border-radius: 2px; }
.hero-section { background-color: #0f2b46; color: white; padding: 80px 0 100px; position: relative; overflow: hidden; border-bottom: 8px solid #dc3545; background-image: linear-gradient(135deg, #0d273e, #1a4268); margin-top: -15px; }
.hero-content { display: flex; align-items: center; justify-content: space-between; max-width: 1200px; margin: 0 auto; padding: 0 20px; position: relative; z-index: 10; }
.hero-text { width: 55%; max-width: 650px; }
.hero-text h1 { font-size: 3.5em; line-height: 1.1; margin-bottom: 20px; text-shadow: 2px 2px 5px rgba(0,0,0,0.4); color: white; }
.hero-image-wrap { position: absolute; right: 0; top: 0; height: 100%; width: 45%; overflow: hidden; pointer-events: none; z-index: 5; }
.hero-image-wrap img { height: 100%; width: auto; object-fit: cover; position: absolute; bottom: 0; right: 0; min-width: 400px; transform: scale(1.1) translateY(10px); filter: brightness(1.1); }
.hero-action-btn { background-color: #dc3545; color: white; padding: 15px 40px; border-radius: 50px; font-size: 1.1em; font-weight: bold; box-shadow: 0 6px #b82c3a; display: inline-block; cursor: pointer; text-align: center; border: none; margin-top: 20px; }
.hero-action-btn:hover { background-color: #b82c3a; transform: translateY(-1px); box-shadow: 0 5px #a1232d; }
.hero-action-btn:active { transform: translateY(2px); box-shadow: 0 2px #a1232d; }
.hero-action-btn.view-courses { background-color: transparent; border: 2px solid #ffc107; color: #ffc107; box-shadow: none; margin-left: 15px; padding: 13px 38px; font-size: 1.1em; }
.feature-card { background-color: white; padding: 30px; border-radius: 12px; text-align: center; box-shadow: 0 4px 10px rgba(0,0,0,0.1); border-bottom: 5px solid #ffc107; }
.feature-card .icon { font-size: 3em; color: #0f2b46; display: block; margin-bottom: 10px; }
.course-card, .blog-card, .topper-card { background: white; padding: 25px; border-radius: 10px; border-left: 5px solid; position: relative; display: flex; flex-direction: column; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.course-card { border-color: #0f2b46; }
.blog-card { border-color: #dc3545; }
.about-section-flex { display: flex; gap: 40px; align-items: flex-start; margin-bottom: 50px; }


/* === 3. PROFESSIONAL FOOTER STYLING (Final Version) === */
.footer { 
    background-color: #0f2b46; 
    color: white; 
    padding: 40px 4%; 
    margin-top: 40px;
    font-size: 0.95em;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.3); 
}
.footer-content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto 30px;
    text-align: left;
}
.footer h4 {
    color: #ffc107;
    font-size: 1.1em;
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 2px solid rgba(255, 193, 7, 0.3);
    padding-bottom: 5px;
}
.footer a { 
    color: #f0f0f0; 
    text-decoration: none; 
    font-weight: 400;
    display: block; 
    margin-bottom: 8px;
    transition: color 0.2s, transform 0.2s;
}
.footer a:hover { color: #ffc107; transform: translateX(3px); }
.footer .social-icons { margin-top: 20px; }
.footer .social-icons a { font-size: 1.5em; margin-right: 15px; color: white; }
.footer-bottom-bar { text-align: center; border-top: 1px solid rgba(255, 255, 255, 0.15); padding-top: 20px; margin-top: 20px; }


/* === 4. RESPONSIVENESS (MEDIA QUERIES) - HAMBURGER IMPLEMENTATION FIX === */

/* --- Tablet/Mobile (Max 992px) --- */
@media (max-width: 992px) {
    
    /* Show the hamburger icon */
    .menu-icon {
        display: block !important; 
        order: 2; 
        margin-left: 10px;
    }
    
    /* CORE FIX: Header must remain non-wrapping to keep logo and icon on one row */
    .header {
        flex-direction: row; 
        flex-wrap: nowrap !important; /* CRITICAL */
        justify-content: space-between;
        padding-right: 4%;
        padding-left: 4%;
        position: relative; /* CRITICAL: Necessary for absolute menu positioning */
    }
    
    /* Hide the navigation menu by default and set its position */
    .header nav {
        display: none; 
        /* ULTRA-STABLE POSITIONING */
        position: absolute !important; 
        top: 100%; /* Start immediately below the header height */
        left: 0;
        width: 100%;
        background-color: #0f2b46;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
        
        /* Menu stacking and full width */
        flex-direction: column; 
        align-items: stretch;
        padding: 0;
        z-index: 999; 
    }
    
    /* Show the menu when the checkbox is checked */
    .menu-toggle:checked ~ nav {
        display: flex;
    }

    /* Style stacked links/buttons for large tap targets */
    .header nav a {
        margin: 0;
        width: 100%;
        text-align: center;
        padding: 15px 0; 
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    .header .btn-primary { 
        width: 90%; 
        margin: 10px auto; 
        display: block; 
    }

    /* Hero and Content Layouts (Stacking) */
    .hero-content { flex-direction: column; align-items: center; }
    .hero-text { width: 100%; text-align: center; order: 2; }
    .hero-text h1 { font-size: 2.5em; }
    .hero-image-wrap { position: relative; width: 80%; max-height: 350px; margin: 0 auto 30px; order: 1; transform: none; right: auto; top: auto; overflow: visible; pointer-events: auto; }
    .hero-image-wrap img { position: relative; width: 100%; height: auto; transform: none; min-width: 0; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
    .about-section-flex { flex-direction: column; gap: 20px !important; }
    
    /* Footer Stacking */
    .footer-content-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); 
        text-align: center;
    }
    .footer a { display: inline-block; margin: 0 5px; }
}

/* --- Mobile Phone (Max 576px) --- */
@media (max-width: 576px) {
    .wrapper, .content-container { padding: 10px; }
    .section-title { font-size: 2em; margin-top: 30px; }
    .hero-text h1 { font-size: 2em; }
    
    /* Single column footer stacking */
    .footer-content-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .footer a {
        display: block; 
        margin: 5px 0;
    }
}