/* =========================================
   1. CORE STYLES & VARIABLES
   ========================================= */
:root {
    --primary: #c82940;    /* Cherry Blossom Pink */
    --primary-dark: #d93855;
    --dark: #2b2d42;       /* Navy Blue/Grey */
    --light: #f8f9fa;      /* Off White */
    --white: #ffffff;
    --text-grey: #555;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', 'Noto Sans JP', sans-serif;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body { 
    color: var(--dark); 
    line-height: 1.6; 
    width: 100%;
    overflow-x: hidden; /* Prevent horizontal scroll bars */
}

a { 
    text-decoration: none; 
    color: inherit; 
}

ul { 
    list-style: none; 
}

/* =========================================
   2. NAVIGATION BAR (FIXED)
   ========================================= */
header {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed; /* Sticks to top */
    top: 0;
    left: 0;
    z-index: 1000; /* Layer 1 */
    width: 100%;
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    margin: 0 auto;
    height: auto;
    background: #ffffff;
    border-radius: 0;
    box-shadow: none;
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.logo-area { 
    display: flex; 
    align-items: center; 
    gap: 15px;
    transform: translateY(0);
    background: transparent;
    padding: 0;
    box-shadow: none;
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.logo-img { 
    height: 100px; 
    width: auto; 
}

.logo-text { 
    display: flex; 
    flex-direction: column; 
    line-height: 1.2; 
}

.logo-main { 
    font-size: 3rem; 
    font-weight: 700; 
    color: var(--primary); 
    letter-spacing: 1px; 
}

.logo-sub { 
    font-size: 0.75rem; 
    color: var(--dark); 
    font-weight: 500; 
}

.nav-links { 
    display: flex; 
    gap: 2rem;
    transform: translateY(0);
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.nav-links a { 
    font-weight: 500; 
    transition: all 0.3s; 
    position: relative;
    background: transparent;
    color: var(--dark);
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}

.nav-links a:hover { 
    color: var(--primary); 
}

/* Hover underline effect */
.nav-links a::after {
    content: ''; 
    width: 0; 
    height: 2px; 
    background: var(--primary);
    position: absolute; 
    left: 0; 
    bottom: -5px; 
    transition: 0.3s;
}

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

.menu-icon { 
    display: none; 
    font-size: 1.5rem; 
    cursor: pointer; 
}

/* Active Link Highlight (Desktop) */
.nav-links li a.active-link {
    color: var(--primary) !important; 
    font-weight: bold;
    transition: 0.3s;
}

/* Hide Close Button on Desktop */
.close-menu-icon {
    display: none;
}

/* =========================================
   3. SCROLLED HEADER (POP-OUT STRIP)
   ========================================= */
header.sticky-scrolled {
    background: #fff !important; /* Fixed conflicting background rules */
    box-shadow: none !important;
    pointer-events: none; /* Allow clicking through to underlying elements */
}

header.sticky-scrolled .top-bar {
    pointer-events: auto;
    height: 15px;
}

header.sticky-scrolled nav {
    pointer-events: auto; /* Enable nav clicks */
    margin: 0px auto 0 auto;
    backdrop-filter: blur(10px);
    height: 60px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    padding: 0 4%;
}

/* Logo Pop-out */
header.sticky-scrolled .logo-area {
    transform: translateY(25px);
    background: #fff;
    padding: 10px 25px;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

header.sticky-scrolled .logo-img { height: 90px; }
header.sticky-scrolled .logo-main { font-size: 3rem; }

/* Links Pop-out */
header.sticky-scrolled .nav-links {
    transform: translateY(25px);
    gap: 10px;
}

header.sticky-scrolled .nav-links a {
    background: #1e272e;
    color: #fff;
    padding: 10px 25px;
    border-radius: 30px;
    font-size: 0.90rem;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

header.sticky-scrolled .nav-links a::after {
    display: none; /* Remove underline on scrolled state */
}

header.sticky-scrolled .nav-links a:hover {
    background: var(--primary);
    transform: translateY(-5px) scale(1.05); /* Lift effect */
    box-shadow: 0 12px 25px rgba(255, 77, 109, 0.4);
}

/* =========================================
   4. HERO SECTION (FULL WIDTH)
   ========================================= */
.hero {
    width: 100%; 
    height: 100vh; /* Full Viewport Height */
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    
    /* Background Image */
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('https://images.unsplash.com/photo-1492571350019-22de08371fd3?ixlib=rb-1.2.1&auto=format&fit=crop&w=1920&q=80');
    background-size: cover;
    background-position: center;
    background-attachment: fixed; /* Parallax Effect */
    background-repeat: no-repeat;
    
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
}

.hero-content {
    max-width: 900px;
    padding: 0 20px;
    z-index: 2;
    margin-top: 60px; /* Offset for fixed header */
}

.hero h1 {
    font-size: 4.5rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    font-weight: 800;
    text-shadow: 2px 2px 15px rgba(0,0,0,0.6);
}

.hero p {
    font-size: 1.4rem;
    margin-bottom: 2.5rem;
    text-shadow: 1px 1px 5px rgba(0,0,0,0.6);
    font-weight: 300;
}

.btn {
    background: var(--primary);
    color: var(--white);
    padding: 15px 45px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: 0.3s;
    border: none;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(255, 77, 109, 0.4);
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 25px rgba(255, 77, 109, 0.6);
}

/* =========================================
   5. GENERAL SECTIONS & LAYOUTS
   ========================================= */
section { 
    padding: 5rem 5%; 
    max-width: 1200px; 
    margin: 0 auto; 
}

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

.section-header h2 { 
    font-size: 2.5rem; 
    color: var(--dark); 
    margin-bottom: 0.5rem; 
}

.section-header span { 
    color: var(--primary); 
}

/* --- About Section --- */
.about-container { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 4rem; 
    align-items: center; 
}

.about-img img { 
    width: 100%; 
    border-radius: 15px; 
    box-shadow: 0 15px 30px rgba(0,0,0,0.15); 
}

.about-text h3 { 
    font-size: 2rem; 
    margin-bottom: 1rem; 
    color: var(--dark); 
}

.about-text ul li { 
    margin-bottom: 15px; 
    font-size: 1.1rem; 
    display: flex; 
    align-items: center; 
    gap: 10px; 
}

/* --- Courses Section --- */
.bg-light { 
    background: var(--light); 
    width: 100%; 
}

.container-wrapper { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 5rem 5%; 
}

.course-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); 
    gap: 2rem; 
}

.course-card { 
    background: var(--white); 
    padding: 2.5rem; 
    border-radius: 15px; 
    box-shadow: 0 5px 20px rgba(0,0,0,0.05); 
    text-align: center; 
    transition: 0.3s; 
    border-bottom: 4px solid transparent; 
}

.course-card:hover { 
    transform: translateY(-10px); 
    border-bottom: 4px solid var(--primary); 
}

.course-icon { 
    font-size: 3rem; 
    color: var(--primary); 
    margin-bottom: 1.5rem; 
}

/* =========================================
   6. CONTACT SECTION & GOOGLE MAP
   ========================================= */
.modern-contact-section {
    padding: 80px 5%;
    background-color: #f8f9fa;
    width: 100%;
}

.contact-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
    overflow: hidden;
    flex-wrap: wrap;
}

/* Left Side Content */
.contact-content-box {
    flex: 1;
    min-width: 350px;
    padding: 50px;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.contact-info-modern h3 {
    font-size: 1.8rem;
    color: var(--dark);
    margin-bottom: 20px;
}

.info-row {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    gap: 15px;
}

.info-row i {
    font-size: 1.2rem;
    color: var(--primary);
    margin-top: 5px;
}

.info-row p {
    color: var(--text-grey);
    font-size: 0.95rem;
    line-height: 1.5;
}

.social-icons-modern {
    margin-top: 20px;
    display: flex;
    gap: 15px;
}

.social-icons-modern a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #f1f2f6;
    border-radius: 50%;
    color: var(--dark);
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.social-icons-modern a:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-5px);
}

.contact-form-modern .form-group {
    margin-bottom: 20px;
}

.contact-form-modern input, 
.contact-form-modern textarea {
    width: 100%;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #e1e1e1;
    border-radius: 10px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.contact-form-modern input:focus, 
.contact-form-modern textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 10px rgba(255, 77, 109, 0.1);
}

.contact-form-modern .btn {
    width: 100%;
    border-radius: 10px;
    padding: 15px;
}

/* Right Side Map */
.contact-map-box {
    flex: 1;
    min-width: 350px;
    min-height: 400px;
    position: relative;
}

.contact-map-box iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Distance Guide Cards */
.distance-cards {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid rgba(0, 0, 0, 0.1); 
}

.d-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.6); 
    padding: 12px 15px;
    border-radius: 12px;
    flex: 1; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    border: 1px solid rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.d-card:hover {
    transform: translateY(-5px);
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 10px 20px rgba(255, 77, 109, 0.15);
}

.d-card i {
    font-size: 1.8rem;
    color: var(--primary);
}

.d-card .d-text h5 {
    font-size: 0.95rem;
    color: var(--dark);
    margin-bottom: 2px;
}

.d-card .d-text span {
    font-size: 0.75rem;
    color: #666;
    font-weight: bold;
}

/* =========================================
   7. MODALS, GALLERY & TOAST ALERTS
   ========================================= */
/* General Modal Styles */
.modal {
    display: none; 
    position: fixed; 
    left: 0; 
    top: 0; 
    width: 100%; 
    height: 100%; 
    background-color: rgba(0,0,0,0.92); 
    justify-content: center; 
    align-items: center;
    backdrop-filter: blur(5px);
}

/* Close Button */
.close-btn {
    position: absolute; 
    top: 20px; 
    right: 35px;
    color: #fff; 
    font-size: 40px; 
    font-weight: bold;
    cursor: pointer; 
    transition: 0.3s; 
    z-index: 10;
}

.close-btn:hover { 
    color: var(--primary); 
}

/* Full Screen Modal Centering */
#fullViewModal {
    display: none; 
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95); 
    justify-content: center; 
    align-items: center;     
}

#fullImage {
    max-width: 90%;
    max-height: 90vh;
    width: auto;
    height: auto;
    margin: 0; 
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    object-fit: contain;
}

/* Navigation Buttons */
.prev-btn, .next-btn {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: white;
    font-weight: bold;
    font-size: 40px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    background-color: rgba(0, 0, 0, 0.3); 
}

.next-btn { right: 0; border-radius: 3px 0 0 3px; }
.prev-btn { left: 0; border-radius: 3px 0 0 3px; }

.prev-btn:hover, .next-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
    color: var(--primary);
}

/* Toast Notification Styles */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000; 
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 250px;
    background: #333;
    color: #fff;
    padding: 12px 20px;
    border-radius: 5px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease-out, fadeOut 0.5s ease-in 3.5s forwards;
    font-size: 0.9rem;
}

.toast.success { border-left: 5px solid #2ecc71; background: #1e272e; }
.toast.error { border-left: 5px solid #e74c3c; background: #1e272e; }
.toast.info { border-left: 5px solid #3498db; background: #1e272e; }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    to { opacity: 0; visibility: hidden; }
}

/* =========================================
   8. MISC (FOOTER & WHATSAPP BUTTON)
   ========================================= */
footer { 
    background: var(--dark); 
    color: var(--white); 
    text-align: center; 
    padding: 3rem 0; 
    margin-top: 0; 
}

.whatsapp-float {
    position: fixed; 
    width: 60px;
    height: 60px;
    bottom: 40px; 
    right: 40px;  
    background-color: #25d366; 
    color: #FFF;
    border-radius: 50%; 
    text-align: center;
    font-size: 30px; 
    box-shadow: 2px 2px 3px #999; 
    z-index: 9999; 
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.whatsapp-float:hover {
    background-color: #128c7e; 
    transform: scale(1.1); 
}

/* =========================================
   9. MOBILE RESPONSIVENESS (CONSOLIDATED)
   ========================================= */
@media (max-width: 768px) {
    
    /* Header & Navigation Fixes */
    header.sticky-scrolled nav { height: 45px; }
    header.sticky-scrolled .logo-img { height: 55px; }
    header.sticky-scrolled .logo-main { font-size: 2rem; }
    header.sticky-scrolled .logo-sub { font-size: 0.5rem; }

    .menu-icon { display: block; }
    
    .nav-links {
        position: fixed; 
        top: 0; 
        right: -250px; /* Hidden off-screen right */
        height: 100vh;
        width: 250px;
        background: var(--white);
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        padding-top: 60px;
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        transition: 0.4s;
        z-index: 10001; 
    }

    .nav-links.active { right: 0; }
    .nav-links li { margin: 15px 30px; }

    .close-menu-icon {
        display: block;
        position: absolute;
        top: 20px;
        left: 20px;
        font-size: 24px;
        color: var(--dark);
        cursor: pointer;
    }
    
    .close-menu-icon:hover { color: var(--primary); }
    
    /* Hero Section Fixes */
    .hero {
        height: auto !important; 
        min-height: 100vh !important; 
        padding: 120px 20px 50px 20px !important; 
        background-position: center !important;
        background-size: cover !important;
        background-attachment: scroll !important; 
    }

    .hero-content {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
    }

    .hero-content h1 {
        font-size: 2rem !important; 
        line-height: 1.2 !important; 
        margin-bottom: 15px !important;
    }

    .hero-content p {
        font-size: 1rem !important;
        line-height: 1.5 !important;
        padding: 0 10px !important; 
        margin-bottom: 25px !important;
    }

    .hero .btn {
        padding: 12px 30px !important;
        font-size: 0.9rem !important;
        width: auto !important; 
    }

    /* About Section Fixes */
    .about-container {
        display: flex !important;
        flex-direction: column !important;
        gap: 30px !important;
        width: 100% !important;
        align-items: center !important;
    }

    .about-img, 
    .about-text {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
        padding: 0 !important;
        text-align: center !important; 
    }

    .about-img img {
        width: 100% !important;
        height: auto !important; 
        margin-bottom: 20px !important;
    }

    .about-text ul {
        display: inline-block !important;
        text-align: left !important; 
    }

    /* Contact Section Fixes */
   /* 1. Section eke palala phone ekata fit kirima */
    .modern-contact-section {
        padding: 40px 10px !important;
        width: 100vw !important; /* Screen eke palalata wada yanne na */
        max-width: 100% !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }

    /* 2. Box eka column (yatin yatata) kirima */
    .contact-container {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        border-radius: 15px !important;
        box-sizing: border-box !important;
    }

    /* 3. 350px limit eka ain karala 100% kirima */
    .contact-content-box {
        min-width: 0 !important; /* Kalin thibba 350px ain karanawa */
        width: 100% !important;
        max-width: 100% !important;
        padding: 30px 15px !important;
        box-sizing: border-box !important;
    }

    /* 4. Map eke loku size eka force override kirima */
    .contact-map-box {
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        min-height: 350px !important;
        box-sizing: border-box !important;
    }
    
    .contact-map-box iframe {
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        box-sizing: border-box !important;
    }

    /* 5. Diga text nisa cards panina eka nawathweema */
    .distance-cards {
        width: 100% !important;
        flex-direction: column !important;
        box-sizing: border-box !important;
    }
    
    .d-card {
        width: 100% !important;
        box-sizing: border-box !important;
        flex-direction: column !important; /* Text saha icon yatin yatata */
        text-align: center !important;
        padding: 20px 10px !important;
    }

    .d-card .d-text span {
        display: block;
        word-wrap: break-word !important; /* Diga wachana kadala yata peliytata gannawa */
        white-space: normal !important;
        margin-top: 5px;
    }
    
    /* 6. Form inputs phone screen ekata hadima */
    .contact-form-modern input, 
    .contact-form-modern textarea {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Miscellaneous Components Fixes */
    .teachers-grid {
        flex-direction: column;
        align-items: center;
    }

    .prev-btn, .next-btn {
        padding: 10px;
        font-size: 30px;
    }

    .whatsapp-float {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
        font-size: 25px;
    }
}