/* ═══════════════════════════════════════════════════════════════
   MOBILE PHONE RESPONSIVE OPTIMIZATION
   Comprehensive fixes for all phone sizes and orientations
   ═══════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════
   SMALL PHONES - PORTRAIT (< 375px)
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 374px) and (orientation: portrait) {
    .hero {
        min-height: 100vh;
        padding: 0.75rem;
    }
    
    .hero-logo-corner {
        max-width: 60px;
        top: 0.5rem;
        left: 0.5rem;
    }
    
    .hero-badge-top {
        font-size: 0.6rem;
        padding: 0.5rem 0.9rem;
        letter-spacing: 0.8px;
        margin-top: 0;
        margin-bottom: 1rem;
    }
    
    .hero-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 1rem 0.5rem;
    }
    
    .hero h1 {
        font-size: 1.8rem;
        margin-bottom: 0.8rem;
        line-height: 1.1;
    }
    
    .hero-hundred {
        font-size: 4rem;
        margin: 0.5rem 0;
        line-height: 1;
    }
    
    .hero-festival {
        font-size: 1.8rem;
        margin: 0.5rem 0 1rem 0;
        line-height: 1.1;
    }
    
    /* Charity corner for small phones */
    .hero-charity-corner {
        bottom: 4rem;
        right: 0.5rem;
    }
    
    .charity-supporting-text {
        font-size: 0.9rem;
    }
    
    .charity-logo-inline {
        height: 35px;
        max-width: 140px;
    }
    
    .charity-tagline-text {
        font-size: 0.75rem;
    }
}

/* ═══════════════════════════════════════════════════════════════
   STANDARD PHONES - PORTRAIT (375px - 414px)
   ═══════════════════════════════════════════════════════════════ */

@media (min-width: 375px) and (max-width: 414px) and (orientation: portrait) {
    .hero {
        min-height: 100vh;
        padding: 1rem;
    }
    
    .hero-logo-corner {
        max-width: 70px;
        top: 0.75rem;
        left: 0.75rem;
    }
    
    .hero-badge-top {
        font-size: 0.7rem;
        padding: 0.7rem 1.3rem;
        letter-spacing: 1px;
        margin-top: 0;
        margin-bottom: 1.2rem;
    }
    
    .hero-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 1.5rem 1rem;
    }
    
    .hero h1 {
        font-size: 2.2rem;
        margin-bottom: 1rem;
        line-height: 1.1;
    }
    
    .hero-hundred {
        font-size: 5rem;
        margin: 0.7rem 0;
        line-height: 1;
    }
    
    .hero-festival {
        font-size: 2.2rem;
        margin: 0.7rem 0 1.2rem 0;
        line-height: 1.1;
    }
    
    /* Charity corner */
    .hero-charity-corner {
        bottom: 4.5rem;
        right: 0.75rem;
    }
    
    .charity-supporting-text {
        font-size: 1rem;
    }
    
    .charity-logo-inline {
        height: 40px;
        max-width: 160px;
    }
    
    .charity-tagline-text {
        font-size: 0.85rem;
    }
}

/* ═══════════════════════════════════════════════════════════════
   LARGE PHONES - PORTRAIT (415px - 599px)
   ═══════════════════════════════════════════════════════════════ */

@media (min-width: 415px) and (max-width: 599px) and (orientation: portrait) {
    .hero {
        min-height: 95vh;
        padding: 1.2rem;
    }
    
    .hero-logo-corner {
        max-width: 80px;
        top: 1rem;
        left: 1rem;
    }
    
    .hero-badge-top {
        font-size: 0.75rem;
        padding: 0.8rem 1.5rem;
        letter-spacing: 1.2px;
        margin-top: 0;
        margin-bottom: 1.5rem;
    }
    
    .hero-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 2rem 1.2rem;
    }
    
    .hero h1 {
        font-size: 2.5rem;
        margin-bottom: 1.1rem;
        line-height: 1.1;
    }
    
    .hero-hundred {
        font-size: 5.5rem;
        margin: 0.8rem 0;
        line-height: 1;
    }
    
    .hero-festival {
        font-size: 2.5rem;
        margin: 0.8rem 0 1.3rem 0;
        line-height: 1.1;
    }
    
    /* Charity corner */
    .hero-charity-corner {
        bottom: 4.8rem;
        right: 1rem;
    }
    
    .charity-supporting-text {
        font-size: 1.1rem;
    }
    
    .charity-logo-inline {
        height: 45px;
        max-width: 180px;
    }
    
    .charity-tagline-text {
        font-size: 0.9rem;
    }
}

/* ═══════════════════════════════════════════════════════════════
   PHONE LANDSCAPE - ALL SIZES
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 896px) and (orientation: landscape) and (max-height: 500px) {
    .hero {
        min-height: 100vh;
        padding: 0.8rem 1.5rem;
    }
    
    .hero-logo-corner {
        max-width: 80px;
        top: 0.6rem;
        left: 1rem;
    }
    
    .hero-badge-top {
        font-size: 0.65rem;
        padding: 0.5rem 1.2rem;
        letter-spacing: 0.8px;
        margin-top: 0;
        margin-bottom: 0.5rem;
    }
    
    .hero-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 0.5rem 1.5rem;
    }
    
    .hero h1 {
        font-size: 1.8rem;
        margin-bottom: 0.4rem;
        line-height: 1;
    }
    
    .hero-hundred {
        font-size: 3.5rem;
        margin: 0.3rem 0;
        line-height: 0.9;
    }
    
    .hero-festival {
        font-size: 1.8rem;
        margin: 0.3rem 0 0.8rem 0;
        line-height: 1;
    }
    
    /* Charity corner - compact for landscape */
    .hero-charity-corner {
        bottom: 3rem;
        right: 1rem;
    }
    
    .charity-supporting-text {
        font-size: 0.85rem;
    }
    
    .charity-logo-inline {
        height: 32px;
        max-width: 130px;
    }
    
    .charity-tagline-text {
        font-size: 0.75rem;
    }
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE - GENERAL IMPROVEMENTS (All phones)
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 767px) {
    /* Better section padding */
    section {
        padding: 3rem 1.5rem;
    }
    
    /* Countdown improvements */
    .countdown {
        padding: 2.5rem 1.5rem;
    }
    
    .countdown h2 {
        font-size: 1.6rem;
        margin-bottom: 1.5rem;
    }
    
    .countdown-timer {
        gap: 1.5rem;
        flex-wrap: wrap;
    }
    
    .countdown-item {
        min-width: 80px;
    }
    
    .countdown-number {
        font-size: 3rem;
    }
    
    .countdown-label {
        font-size: 0.85rem;
    }
    
    /* Corporate section */
    .corporate-hospitality {
        padding: 3rem 1.5rem;
    }
    
    .corporate-hospitality h2 {
        font-size: 2rem;
        margin-bottom: 1.5rem;
        line-height: 1.2;
    }
    
    .packages-grid {
        gap: 1.5rem;
    }
    
    .package {
        padding: 2rem 1.5rem;
    }
    
    .package h3 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .package-price {
        font-size: 2rem;
    }
    
    /* Schedule section */
    .schedule {
        padding: 3rem 1.5rem;
    }
    
    .schedule h2 {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }
    
    .match-card {
        padding: 1.5rem 1.2rem;
        margin-bottom: 1.2rem;
    }
    
    .match-time {
        font-size: 1.1rem;
    }
    
    .match-teams {
        font-size: 1.3rem;
    }
    
    /* Teams section */
    .teams {
        padding: 3rem 1.5rem;
    }
    
    .teams h2 {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }
    
    .teams-grid {
        gap: 1.5rem;
    }
    
    .team-card {
        padding: 2rem 1.5rem;
    }
    
    .team-badge {
        width: 100px;
        height: 100px;
        margin-bottom: 1rem;
    }
    
    .team-name {
        font-size: 1.3rem;
    }
    
    /* Gallery section */
    .gallery {
        padding: 3rem 1.5rem;
    }
    
    .gallery h2 {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }
    
    .gallery-grid {
        gap: 1rem;
        grid-template-columns: 1fr;
    }
    
    /* Testimonials */
    .testimonials {
        padding: 3rem 1.5rem;
    }
    
    .testimonials h2 {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }
    
    .testimonial-card {
        padding: 2rem 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    /* FAQ section */
    .format {
        padding: 3rem 1.5rem;
    }
    
    .format h2 {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }
    
    .faq-item {
        margin-bottom: 1rem;
    }
    
    .faq-item h3 {
        font-size: 1.05rem;
        padding: 1.2rem 2.5rem 1.2rem 1.2rem;
        line-height: 1.4;
    }
    
    .faq-content {
        padding: 1.2rem;
    }
    
    /* Venue section */
    .venue {
        padding: 3rem 1.5rem;
    }
    
    .venue h2 {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }
    
    /* Charity section */
    .charity {
        padding: 3rem 1.5rem;
    }
    
    .charity h2 {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }
    
    /* Buttons - larger touch targets */
    .register-btn,
    .nav-register-btn,
    .package-cta {
        padding: 1.1rem 2.5rem;
        font-size: 1rem;
        min-height: 54px;
        width: 100%;
        max-width: 100%;
    }
    
    /* Better text readability */
    body {
        font-size: 16px;
        line-height: 1.6;
    }
    
    p {
        font-size: 1rem;
        line-height: 1.7;
        margin-bottom: 1.2rem;
    }
    
    /* Improved list spacing */
    ul, ol {
        padding-left: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    li {
        margin-bottom: 0.8rem;
        line-height: 1.6;
    }
}

/* ═══════════════════════════════════════════════════════════════
   TOUCH-FRIENDLY IMPROVEMENTS
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 767px) and (pointer: coarse) {
    /* Minimum 48x48px touch targets */
    button,
    a,
    .nav-item,
    .faq-item h3 {
        min-height: 48px;
        min-width: 48px;
    }
    
    /* Extra padding for tap areas */
    .clickable {
        padding: 0.8rem;
    }
    
    /* Prevent accidental zooms */
    input,
    textarea,
    select {
        font-size: 16px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   iOS SAFARI SPECIFIC FIXES
   ═══════════════════════════════════════════════════════════════ */

@supports (-webkit-touch-callout: none) {
    @media (max-width: 767px) {
        /* Fix for iOS Safari viewport height */
        .hero {
            min-height: -webkit-fill-available;
        }
        
        /* Prevent text size adjustment */
        body {
            -webkit-text-size-adjust: 100%;
        }
        
        /* Smooth momentum scrolling */
        * {
            -webkit-overflow-scrolling: touch;
        }
        
        /* Fix for iOS Safari bottom bar */
        @supports (padding: max(0px)) {
            .hero {
                padding-bottom: max(1rem, env(safe-area-inset-bottom));
            }
        }
    }
}

/* ═══════════════════════════════════════════════════════════════
   NOTCH/SAFE AREA SUPPORT (iPhone X and later)
   ═══════════════════════════════════════════════════════════════ */

@supports (padding: max(0px)) {
    @media (max-width: 767px) {
        .hero {
            padding-left: max(1rem, env(safe-area-inset-left));
            padding-right: max(1rem, env(safe-area-inset-right));
        }
        
        .hero-logo-corner {
            left: max(0.75rem, env(safe-area-inset-left));
        }
        
        .hero-charity-corner {
            right: max(0.75rem, env(safe-area-inset-right));
        }
    }
}

/* ═══════════════════════════════════════════════════════════════
   VERY SMALL PHONES (Galaxy Fold, etc.) - PORTRAIT
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 320px) and (orientation: portrait) {
    .hero {
        padding: 0.6rem;
    }
    
    .hero-logo-corner {
        max-width: 50px;
        top: 0.4rem;
        left: 0.4rem;
    }
    
    .hero-badge-top {
        font-size: 0.55rem;
        padding: 0.4rem 0.8rem;
        letter-spacing: 0.5px;
    }
    
    .hero h1 {
        font-size: 1.6rem;
    }
    
    .hero-hundred {
        font-size: 3.5rem;
    }
    
    .hero-festival {
        font-size: 1.6rem;
    }
    
    .charity-supporting-text {
        font-size: 0.8rem;
    }
    
    .charity-logo-inline {
        height: 30px;
        max-width: 120px;
    }
    
    .charity-tagline-text {
        font-size: 0.7rem;
    }
}

/* ═══════════════════════════════════════════════════════════════
   END MOBILE OPTIMIZATION
   ═══════════════════════════════════════════════════════════════ */
