/* ============================================
   INDEX.PHP - COMPLETE MOBILE FIX
   iPhone 12 Pro (390x844) - No Zoom, No Overlap
   ============================================ */

/* ===== PREVENT ZOOM & FIX VIEWPORT ===== */
@media (max-width: 768px) {
    html {
        -webkit-text-size-adjust: 100%;
        -moz-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
        text-size-adjust: 100%;
        touch-action: manipulation;
    }
    
    body {
        font-size: 14px !important;
        overflow-x: hidden !important;
        width: 100vw !important;
        max-width: 100vw !important;
        position: relative;
    }
    
    * {
        max-width: 100vw;
        box-sizing: border-box;
    }
    
    img {
        max-width: 100% !important;
        height: auto !important;
        display: block;
    }
    
    /* ===== GLOBAL COMPACT SECTIONS ===== */
    section {
        padding: 35px 0 !important;
        overflow: hidden;
    }
    
    .section-content {
        padding: 0 1rem !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    
    .section-title {
        font-size: 1.5rem !important;
        margin-bottom: 1.2rem !important;
        padding: 0 !important;
        line-height: 1.2 !important;
    }
    
    .section-title::after {
        width: 45px !important;
        height: 3px !important;
        bottom: -8px !important;
    }
    
    /* ===== HERO SECTION - FIXED ===== */
    .hero {
        padding: 80px 1rem 35px !important;
        min-height: auto !important;
    }
    
    .hero-content {
        padding: 0 !important;
        max-width: 100% !important;
    }
    
    .hero-logo {
        width: 85px !important;
        height: 85px !important;
        margin: 0 auto 10px !important;
    }
    
    .hero h1 {
        font-size: 1.5rem !important;
        line-height: 1.2 !important;
        margin-bottom: 0.5rem !important;
    }
    
    .hero .motto {
        font-size: 1rem !important;
        margin-bottom: 0.8rem !important;
    }
    
    .hero .subtitle {
        font-size: 0.88rem !important;
        margin-bottom: 1.2rem !important;
        line-height: 1.5 !important;
        padding: 0 !important;
    }
    
    .cta-buttons {
        flex-direction: column !important;
        gap: 0.7rem !important;
        padding: 0 !important;
        width: 100% !important;
    }
    
    .cta-btn {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0.8rem 1.2rem !important;
        font-size: 0.9rem !important;
        border-radius: 10px !important;
    }
    
    .enrollment-btn .tooltip {
        width: 80vw !important;
        max-width: 270px !important;
        font-size: 0.75rem !important;
        padding: 0.6rem !important;
        line-height: 1.3 !important;
    }
    
    /* ===== MISSION & VISION - FIXED OVERLAP ===== */
    .mission-vision {
        padding: 35px 0 !important;
        background: linear-gradient(135deg, #f8fafc 0%, #e0e7ff 50%, #f8fafc 100%) !important;
    }
    
    .mission-vision .scroll-reveal[style*="display: inline-block"] {
        padding: 0.35rem 1.2rem !important;
        font-size: 0.75rem !important;
        margin-bottom: 0.7rem !important;
    }
    
    .mission-vision .scroll-reveal[style*="max-width: 700px"] {
        font-size: 0.88rem !important;
        line-height: 1.5 !important;
        margin-bottom: 1.2rem !important;
        padding: 0 0.5rem !important;
    }
    
    /* Main card container - NO OVERFLOW */
    .mission-vision .scroll-reveal[style*="max-width: 1000px"] {
        margin: 0 0.5rem !important;
        border-radius: 18px !important;
        overflow: hidden !important;
        width: calc(100% - 1rem) !important;
    }
    
    .mission-vision .scroll-reveal[style*="max-width: 1000px"] > div[style*="padding: 3rem"] {
        padding: 1.5rem 1rem !important;
        width: 100% !important;
    }
    
    /* Icon at top */
    .mission-vision .scroll-reveal[style*="max-width: 1000px"] > div > div[style*="text-align: center"]:first-child {
        margin-bottom: 1rem !important;
    }
    
    .mission-vision .scroll-reveal[style*="max-width: 1000px"] > div > div[style*="text-align: center"] > div {
        width: 70px !important;
        height: 70px !important;
    }
    
    .mission-vision .scroll-reveal[style*="max-width: 1000px"] > div > div[style*="text-align: center"] > div i {
        font-size: 1.8rem !important;
    }
    
    .mission-vision .scroll-reveal[style*="max-width: 1000px"] > div > div[style*="text-align: center"] > div > div {
        width: 26px !important;
        height: 26px !important;
        top: -2px !important;
        right: -2px !important;
    }
    
    /* Title */
    .mission-vision h3[style*="font-size: 2rem"] {
        font-size: 1.3rem !important;
        margin-bottom: 1.2rem !important;
    }
    
    /* Points container - STACK PROPERLY */
    .mission-vision .scroll-reveal > div > div[style*="display: grid"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.9rem !important;
        width: 100% !important;
    }
    
    /* Each point - NO OVERLAP */
    .mission-vision .scroll-reveal > div > div > div[style*="display: flex"] {
        display: flex !important;
        flex-direction: row !important;
        padding: 1rem !important;
        gap: 0.9rem !important;
        border-radius: 12px !important;
        width: 100% !important;
        align-items: flex-start !important;
    }
    
    .mission-vision .scroll-reveal > div > div > div[style*="display: flex"] > div:first-child {
        width: 40px !important;
        height: 40px !important;
        flex-shrink: 0 !important;
        border-radius: 8px !important;
    }
    
    .mission-vision .scroll-reveal > div > div > div[style*="display: flex"] > div:first-child i {
        font-size: 1rem !important;
    }
    
    .mission-vision .scroll-reveal > div > div > div[style*="display: flex"] > div:last-child {
        flex: 1 !important;
        width: 100% !important;
    }
    
    .mission-vision .scroll-reveal > div > div > div h4 {
        font-size: 0.92rem !important;
        margin-bottom: 0.4rem !important;
        line-height: 1.3 !important;
    }
    
    .mission-vision .scroll-reveal > div > div > div p {
        font-size: 0.82rem !important;
        line-height: 1.5 !important;
        margin: 0 !important;
    }
    
    /* Bottom quote */
    .mission-vision .scroll-reveal > div > div[style*="margin-top: 2.5rem"] {
        margin-top: 1.2rem !important;
        padding-top: 1.2rem !important;
    }
    
    .mission-vision .scroll-reveal > div > div[style*="margin-top: 2.5rem"] > div {
        padding: 0.6rem 1.2rem !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 0.5rem !important;
        justify-content: center !important;
    }
    
    .mission-vision .scroll-reveal > div > div[style*="margin-top: 2.5rem"] i {
        font-size: 0.9rem !important;
        flex-shrink: 0 !important;
    }
    
    .mission-vision .scroll-reveal > div > div[style*="margin-top: 2.5rem"] p {
        font-size: 0.88rem !important;
        margin: 0 !important;
    }
    
    /* ===== PHILOSOPHY CARDS - FIXED ===== */
    #philosophy {
        padding: 35px 0 !important;
    }
    
    .mv-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
        margin-top: 1.2rem !important;
    }
    
    .mv-card {
        padding: 1.3rem 1rem !important;
        border-radius: 14px !important;
        width: 100% !important;
    }
    
    .mv-icon {
        width: 55px !important;
        height: 55px !important;
        font-size: 1.4rem !important;
        margin: 0 auto 0.9rem !important;
    }
    
    .mv-card h3 {
        font-size: 1.1rem !important;
        margin-bottom: 0.6rem !important;
    }
    
    .mv-card p {
        font-size: 0.84rem !important;
        line-height: 1.5 !important;
        margin-bottom: 0.5rem !important;
    }
    
    .mv-card ul {
        padding-left: 0 !important;
        margin-top: 0.5rem !important;
    }
    
    .mv-card ul li {
        font-size: 0.82rem !important;
        line-height: 1.5 !important;
        margin-bottom: 0.35rem !important;
    }
    
    /* Methodology box - FIXED */
    #philosophy .scroll-reveal[style*="margin-top: 3rem"] {
        padding: 1.3rem 1rem !important;
        margin-top: 1.2rem !important;
        border-radius: 14px !important;
        width: 100% !important;
    }
    
    #philosophy .scroll-reveal h3 {
        font-size: 1.2rem !important;
        margin-bottom: 1rem !important;
    }
    
    #philosophy .scroll-reveal > div[style*="display: grid"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.8rem !important;
        margin-top: 1rem !important;
    }
    
    #philosophy .scroll-reveal > div > div {
        padding: 1rem !important;
        border-radius: 10px !important;
        width: 100% !important;
    }
    
    #philosophy .scroll-reveal > div > div h4 {
        font-size: 0.88rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    #philosophy .scroll-reveal > div > div p {
        font-size: 0.8rem !important;
        line-height: 1.5 !important;
    }
    
/* ===== HISTORY TIMELINE - CENTERED CARDS, NO LINE/DOTS ===== */
    @media (max-width: 768px) {
        .history-section {
            padding: 35px 0 !important;
        }
        
        .history-timeline {
            padding: 0 1rem !important;
            margin: 1.2rem 0 0 0 !important;
            width: 100% !important;
            max-width: 100% !important;
            position: relative !important;
        }
        
        /* REMOVE the vertical line */
        .history-timeline::before {
            display: none !important;
        }
        
        /* Each timeline item - CENTERED */
        .timeline-item {
            display: flex !important;
            flex-direction: column !important;
            align-items: center !important;
            margin-bottom: 1.2rem !important;
            padding-left: 0 !important;
            position: relative !important;
            width: 100% !important;
        }
        
        .timeline-item:nth-child(odd),
        .timeline-item:nth-child(even) {
            flex-direction: column !important;
            align-items: center !important;
        }
        
        /* Content box - CENTERED */
        .timeline-content {
            width: 100% !important;
            max-width: 100% !important;
            margin: 0 auto !important;
            padding: 1.2rem !important;
            border-radius: 12px !important;
            background: var(--white) !important;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
            position: relative !important;
            text-align: left !important;
        }
        
        .timeline-item:nth-child(odd) .timeline-content,
        .timeline-item:nth-child(even) .timeline-content {
            width: 100% !important;
            margin: 0 auto !important;
        }
        
        /* HIDE the timeline dot */
        .timeline-dot {
            display: none !important;
        }
        
        /* Year styling */
        .timeline-year {
            font-size: 1.1rem !important;
            font-weight: 700 !important;
            color: var(--primary-blue) !important;
            margin-bottom: 0.4rem !important;
            display: block !important;
        }
        
        /* Title styling */
        .timeline-content h4 {
            font-size: 1rem !important;
            font-weight: 600 !important;
            color: var(--primary-blue) !important;
            margin-bottom: 0.5rem !important;
            line-height: 1.3 !important;
        }
        
        /* Description text */
        .timeline-content p {
            font-size: 0.85rem !important;
            color: var(--text-light) !important;
            line-height: 1.6 !important;
            margin: 0 !important;
        }
    }
    
    /* ===== NETWORK SECTION - FIXED ===== */
    #network {
        padding: 35px 0 !important;
    }
    
    #network > div > div {
        margin-top: 1.2rem !important;
        width: 100% !important;
    }
    
    #network .scroll-reveal {
        padding: 1.3rem 1rem !important;
        margin-bottom: 1rem !important;
        border-radius: 14px !important;
        width: 100% !important;
    }
    
    #network .scroll-reveal > div:first-child {
        flex-direction: row !important;
        gap: 0.7rem !important;
        margin-bottom: 0.9rem !important;
        align-items: center !important;
    }
    
    #network .scroll-reveal > div:first-child > div:first-child {
        width: 42px !important;
        height: 42px !important;
        font-size: 1.1rem !important;
        flex-shrink: 0 !important;
    }
    
    #network .scroll-reveal h3 {
        font-size: 1.1rem !important;
        line-height: 1.3 !important;
    }
    
    #network .scroll-reveal > p {
        font-size: 0.84rem !important;
        line-height: 1.5 !important;
        margin-bottom: 0.9rem !important;
    }
    
    #network .scroll-reveal > div[style*="display: grid"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.7rem !important;
    }
    
    #network .scroll-reveal > div > div {
        padding: 0.9rem !important;
        border-radius: 10px !important;
    }
    
    #network .scroll-reveal > div > div h4 {
        font-size: 0.86rem !important;
        margin-bottom: 0.3rem !important;
        display: flex !important;
        align-items: center !important;
        gap: 0.4rem !important;
    }
    
    #network .scroll-reveal > div > div p {
        font-size: 0.78rem !important;
        line-height: 1.4 !important;
    }
    
    #network .scroll-reveal ul li {
        font-size: 0.8rem !important;
        margin-bottom: 0.5rem !important;
        line-height: 1.4 !important;
    }
    
    /* ===== PROMO VIDEO - FIXED ===== */
    .promo-video-section {
        padding: 35px 0 !important;
    }
    
    .promo-video-wrapper {
        margin-top: 1.2rem !important;
        padding: 0 1rem !important;
    }
    
    .promo-video-embed {
        width: 100% !important;
        padding: 0 !important;
    }
    
    .promo-video-embed iframe {
        width: 100% !important;
        height: 200px !important;
        border-radius: 10px !important;
    }
    
    /* ===== FACEBOOK SECTION - NO OVERLAP ===== */
    .facebook-page-section {
        padding: 35px 0 !important;
    }
    
    .facebook-page-section .section-content {
        margin-bottom: 1.2rem !important;
    }
    
    .facebook-page-section .scroll-reveal {
        display: flex !important;
        flex-direction: column !important;
        padding: 1.2rem 1rem !important;
        gap: 1rem !important;
        border-radius: 16px !important;
        width: 100% !important;
        margin: 0 !important;
    }
    
    .facebook-page-section .scroll-reveal > div:first-child {
        order: 2 !important;
        text-align: left !important;
        width: 100% !important;
    }
    
    .facebook-page-section .scroll-reveal > div:first-child > div:first-child {
        font-size: 1rem !important;
        line-height: 1.3 !important;
        margin-bottom: 0.4rem !important;
    }
    
    .facebook-page-section .scroll-reveal > div:first-child > div:nth-child(2) {
        font-size: 0.84rem !important;
        line-height: 1.5 !important;
        margin-bottom: 0.8rem !important;
    }
    
    .facebook-page-section .scroll-reveal > div:first-child a {
        display: inline-flex !important;
        padding: 0.5rem 0.9rem !important;
        font-size: 0.86rem !important;
        max-width: fit-content !important;
    }
    
    .facebook-page-section .scroll-reveal > div:last-child {
        order: 1 !important;
        width: 100% !important;
        display: block !important;
    }
    
    .facebook-page-section .scroll-reveal > div:last-child img {
        width: 100% !important;
        height: 160px !important;
        object-fit: cover !important;
        border-radius: 10px !important;
        border: 2px solid var(--light-gray) !important;
    }
    
    /* ===== GALLERY - FIXED IMAGES ===== */
    .gallery-section {
        padding: 35px 0 !important;
    }
    
    .gallery-section > div > div[style*="display: grid"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
        margin-top: 1.2rem !important;
    }
    
    .gallery-section .scroll-reveal {
        border-radius: 14px !important;
        overflow: hidden !important;
        width: 100% !important;
    }
    
    .gallery-section .scroll-reveal img {
        width: 100% !important;
        height: 180px !important;
        object-fit: cover !important;
    }
    
    .gallery-section .scroll-reveal > div {
        padding: 1rem !important;
    }
    
    .gallery-section .scroll-reveal h4 {
        font-size: 1rem !important;
        margin-bottom: 0.4rem !important;
    }
    
    .gallery-section .scroll-reveal p {
        font-size: 0.82rem !important;
        line-height: 1.5 !important;
    }
    
    /* ===== PROGRAMS - FIXED ===== */
    #programs {
        padding: 35px 0 !important;
    }
    
    .programs-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
        margin-top: 1.2rem !important;
    }
    
    .program-card {
        border-radius: 14px !important;
        width: 100% !important;
    }
    
    .program-card img {
        width: 100% !important;
        height: 170px !important;
        object-fit: cover !important;
    }
    
    .program-card-content {
        padding: 1.1rem !important;
    }
    
    .program-card h4 {
        font-size: 0.96rem !important;
        line-height: 1.3 !important;
        margin-bottom: 0.5rem !important;
    }
    
    .program-card p {
        font-size: 0.82rem !important;
        line-height: 1.5 !important;
    }
    
    /* ===== FEATURES - COMPACT ===== */
    .features {
        padding: 35px 0 !important;
    }
    
    .features-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.9rem !important;
        margin-top: 1.2rem !important;
    }
    
    .feature-item {
        padding: 1.2rem 1rem !important;
        border-radius: 12px !important;
        width: 100% !important;
    }
    
    .feature-icon {
        width: 50px !important;
        height: 50px !important;
        font-size: 1.1rem !important;
        margin-bottom: 0.9rem !important;
    }
    
    .feature-item h3 {
        font-size: 0.98rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .feature-item p {
        font-size: 0.82rem !important;
        line-height: 1.5 !important;
    }
    
    /* ===== CTA SECTION ===== */
    .cta-section {
        padding: 35px 0 !important;
    }
    
    .cta-section h2 {
        font-size: 1.6rem !important;
        line-height: 1.3 !important;
        margin-bottom: 0.7rem !important;
    }
    
    .cta-section p {
        font-size: 0.9rem !important;
        line-height: 1.5 !important;
        margin-bottom: 1.2rem !important;
        padding: 0 0.5rem !important;
    }
    
    /* ===== FOOTER - COMPACT ===== */
    .footer {
        padding: 25px 0 10px !important;
    }
    
    .footer-content {
        display: flex !important;
        flex-direction: column !important;
        gap: 1.3rem !important;
        padding: 0 1rem !important;
    }
    
    .footer-section {
        text-align: center !important;
    }
    
    .footer-section h3 {
        font-size: 1rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .footer-section p,
    .footer-section li {
        font-size: 0.82rem !important;
        line-height: 1.5 !important;
        margin-bottom: 0.4rem !important;
    }
    
    .footer-section iframe {
        width: 100% !important;
        max-width: 320px !important;
        height: 140px !important;
        border-radius: 8px !important;
        display: block !important;
        margin: 0 auto !important;
    }
    
    .footer-bottom {
        margin-top: 1rem !important;
        padding-top: 0.9rem !important;
    }
    
    .footer-bottom p {
        font-size: 0.78rem !important;
        line-height: 1.4 !important;
        margin-bottom: 0.3rem !important;
    }

    .footer-section:last-child {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .footer-section:last-child > div {
        width: 100% !important;
        max-width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }
}

/* ===== SMALLER DEVICES ===== */
@media (max-width: 390px) {
    .hero h1 {
        font-size: 1.4rem !important;
    }
    
    .section-title {
        font-size: 1.4rem !important;
    }
}

/* ===== LANDSCAPE ===== */
@media (max-height: 500px) and (orientation: landscape) {
    section {
        padding: 25px 0 !important;
    }
    
    .hero {
        padding: 70px 1rem 30px !important;
    }
}

/* ===== PREVENT HORIZONTAL SCROLL ===== */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
        position: relative;
    }
    
    .hero::before,
    .mission-vision > div:first-child {
        display: none !important;
    }
}