/* Responsive Styles */

@media (max-width: 992px) {
    .header .container {
        padding: 0 20px;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .founder-wrapper {
        flex-direction: column;
        text-align: center;
    }

    .founder-img {
        flex: 0 0 auto;
        width: 100%;
        max-width: 350px;
    }

    .contact-wrapper {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .top-bar .container {
        flex-direction: column;
        position: relative;
    }

    .header {
        background: transparent !important;
        height: 0 !important;
        box-shadow: none !important;
        border: none !important;
        position: relative;
        z-index: 1000;
    }

    .logo {
        display: none !important;
    }

    .mobile-toggle {
        display: block;
        position: absolute;
        right: 15px;
        bottom: 5px;
        color: var(--white) !important;
        font-size: 1.5rem;
        cursor: pointer;
        z-index: 10000;
    }

    .nav-menu {
        position: fixed;
        top: var(--header-height);
        left: -100%;
        width: 100%;
        height: calc(100vh - var(--header-height));
        background: var(--white);
        flex-direction: column;
        align-items: center;
        padding-top: 50px;
        transition: 0.3s;
        box-shadow: var(--box-shadow);
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-link {
        font-size: 1.2rem;
    }

    .hero-slider {
        height: 500px;
    }

    .section-title {
        font-size: 2rem;
    }

    .logo-main {
        font-size: 1.4rem;
    }

    .logo-sub {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.8rem;
        line-height: 1.3;
    }

    .hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: 15px;
    }

    .logo img {
        height: 40px;
    }

    .btn,
    .btn-secondary {
        padding: 12px 20px;
        font-size: 0.9rem;
        display: block;
        width: 100%;
        margin-bottom: 10px;
        text-align: center;
    }

    .hero-content div {
        width: 100%;
    }
}

/* Prevent Horizontal Scroll Globally */
html,
body {
    overflow-x: hidden;
    width: 100%;
    /* IMPORTANT: Do NOT set position:relative on body — it breaks position:fixed children */
}

/* Global Responsive Fixes */
img {
    max-width: 100%;
    height: auto;
}

table {
    display: block;
    overflow-x: auto;
    width: 100%;
}

iframe {
    max-width: 100%;
}

/* Override for video popup iframe — must fill container */
.video-popup-body iframe {
    max-width: none !important;
    width: 100% !important;
    height: 100% !important;
}

#videoPopup {
    position: fixed;
    bottom: 25px;
    left: 25px;
    width: 360px;
    background: rgba(255, 255, 255, 0.15);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    z-index: 999999;
    overflow: visible;
    font-family: Poppins, sans-serif;
    padding: 10px;
    transition: all 0.3s ease;
}

@media (max-width: 576px) {
    .container {
        padding: 0 15px;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-brand .social-links {
        justify-content: center;
    }

    .stat-item h3 {
        font-size: 2rem !important;
    }

    /* Video Popup Mobile Fix */
    #videoPopup {
        width: calc(100% - 30px);
        left: 15px;
        bottom: 15px;
    }

    /* Social Float Mobile Fit */
    .whatsapp-float, .instagram-float, .facebook-float, .youtube-float {
        width: 46px !important;
        height: 46px !important;
        font-size: 22px !important;
        line-height: 46px !important;
        right: 15px !important;
    }
    .whatsapp-float { bottom: 15px !important; }
    .instagram-float { bottom: 71px !important; }
    .facebook-float { bottom: 127px !important; }
    .youtube-float { bottom: 183px !important; }

    /* Layout Grids Mobile Fix */
    .program-row, .facility-row {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
        margin-bottom: 40px !important;
    }

    .hero-slider {
        height: 300px !important;
        min-height: 300px !important;
    }

    .header-banner-slider {
        width: 170px !important;
        height: 40px !important;
    }

    /* Flyer Banners Contained (fully visible) */
    .slide {
        background-size: contain !important;
        background-position: center center !important;
    }

    /* Minimal mobile paddings */
    .section-padding, .founder-section, .programs-section, .cta-section {
        padding: 20px 10px !important;
    }

    .founder-wrapper {
        padding: 10px !important;
        gap: 15px !important;
        border-radius: 12px !important;
    }

    .founder-img-container {
        width: 100% !important;
        max-width: 280px !important;
        margin: 0 auto !important;
    }

    .founder-dual-img {
        height: auto !important;
        max-height: 300px !important;
        object-fit: contain !important;
        border-radius: 10px !important;
        border: 2px solid white !important;
        padding: 0 !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
    }

    /* Center Results Grid & Cards */
    .results-grid {
        grid-template-columns: 1fr !important;
        justify-items: center !important;
    }

    .result-card {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
    }

    /* Minimal 3px horizontal paddings for results page */
    .page-header-results .container,
    section.container {
        padding-left: 3px !important;
        padding-right: 3px !important;
    }
}