/* iOS Safari viewport fixes */
@supports (-webkit-touch-callout: none) {
    .vh-fix {
        height: 100vh;
        height: -webkit-fill-available;
    }
    
    body.scroll-locked {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        overflow: hidden !important;
        -webkit-overflow-scrolling: touch;
    }
}

/* Enhanced scroll lock for all devices */
body.scroll-locked {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: none;
}

html.scroll-locked {
    overflow: hidden !important;
    height: 100% !important;
}

/* Smooth scrolling for older browsers */
html {
    scroll-behavior: smooth;
}

/* MOBILE HERO OPTIMIZATIONS */
/* Mobile-first hero content styling */
@media (max-width: 768px) {
    #hero-content {
        padding: 1rem;
        min-height: 100vh;
        min-height: -webkit-fill-available;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    #hero-content .text-center {
        padding: 0 1rem;
        max-width: 100%;
    }
    
    /* Mobile hero typography */
    #hero-content h1 {
        font-size: 2.5rem !important; /* Reduced from 6xl */
        line-height: 1.1 !important;
        margin-bottom: 1.5rem !important;
        text-align: center;
        word-wrap: break-word;
        hyphens: auto;
    }
    
    #hero-content p {
        font-size: 1.125rem !important; /* Reduced from xl */
        line-height: 1.5 !important;
        margin-bottom: 2rem !important;
        padding: 0 0.5rem;
    }
    
    /* Mobile hero button */
    #hero-content .join-btn {
        font-size: 1rem !important;
        padding: 0.875rem 2rem !important;
        min-height: 48px; /* Touch-friendly minimum */
        width: auto;
        max-width: 280px;
        margin: 0 auto;
        display: block;
    }
    
    /* Enter button mobile optimization */
    #enter-btn {
        font-size: 1.25rem !important;
        padding: 1rem 3rem !important;
        min-height: 56px;
        border-radius: 2rem !important;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Mobile scroll indicator */
    #scroll-indicator {
        bottom: 2rem !important;
        transform: translateX(-50%) scale(1.2);
    }
}

/* Tablet hero adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    #hero-content h1 {
        font-size: 4rem !important;
        line-height: 1.1 !important;
    }
    
    #hero-content p {
        font-size: 1.25rem !important;
        line-height: 1.6 !important;
    }
}

/* GLOFOX MODAL MOBILE OPTIMIZATIONS */
/* Enhanced mobile modal container */
@media (max-width: 768px) {
    .glofox-modal {
        padding: 0.5rem !important;
        align-items: flex-start !important;
        justify-content: center !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .glofox-modal > div {
        margin: 1rem auto !important;
        max-width: 95vw !important;
        width: 100% !important;
        max-height: none !important;
        min-height: auto !important;
        border-radius: 16px !important;
        overflow: visible !important;
    }
    
    /* Modal header mobile optimization */
    .glofox-modal .flex.justify-center {
        padding: 1rem 1rem 0.75rem !important;
        flex-wrap: wrap;
    }
    
    .glofox-modal h3 {
        font-size: 1.25rem !important;
        max-width: calc(100% - 60px) !important;
        word-wrap: break-word;
    }
    
    /* Modal content mobile scrolling */
    .glofox-modal .p-6 {
        padding: 1rem !important;
        max-height: none !important;
        overflow: visible !important;
    }
    
    /* Enhanced iframe mobile container */
    .glofox-modal #hero-form {
        max-height: none !important;
        overflow: visible !important;
    }
    
    .glofox-modal .glofox_iframe {
        min-height: 500px !important;
        max-height: none !important;
        height: auto !important;
        overflow: visible !important;
        -webkit-overflow-scrolling: touch !important;
        border-radius: 12px !important;
    }
    
    /* Critical: Ensure iframe is scrollable */
    .glofox-modal iframe {
        min-height: 500px !important;
        height: auto !important;
        overflow: auto !important;
        -webkit-overflow-scrolling: touch !important;
        touch-action: pan-y !important;
        border-radius: 12px !important;
        background: #2C2C2C !important;
    }
    
    /* Powered by text mobile */
    #poweredbyGlofox {
        font-size: 0.875rem !important;
        margin-top: 1rem !important;
        padding: 0 1rem !important;
    }
}

/* iOS-specific Glofox modal fixes */
@supports (-webkit-touch-callout: none) {
    .glofox-modal {
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: contain !important;
    }
    
    @media (max-width: 768px) {
        .glofox-modal iframe {
            -webkit-overflow-scrolling: touch !important;
            overflow: auto !important;
            transform: translate3d(0,0,0) !important;
            backface-visibility: hidden !important;
            touch-action: pan-y pinch-zoom !important;
        }
        
        /* iOS safe area support */
        .glofox-modal > div {
            margin-top: max(1rem, env(safe-area-inset-top)) !important;
            margin-bottom: max(1rem, env(safe-area-inset-bottom)) !important;
            margin-left: max(0.5rem, env(safe-area-inset-left)) !important;
            margin-right: max(0.5rem, env(safe-area-inset-right)) !important;
        }
    }
}

/* Android-specific optimizations */
@media (max-width: 768px) {
    .device-android .glofox-modal iframe {
        transform: translateZ(0) !important;
        will-change: scroll-position !important;
    }
}

/* Custom gradient backgrounds */
.gradient-bg {
    background: linear-gradient(135deg, #1A1A1A 0%, #2C2C2C 100%);
}

.gradient-text {
    background: linear-gradient(135deg, #00B0F0, #00CFFF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Desktop Header Button Hover Animations */
@media (min-width: 1024px) {
    .nav-link {
        position: relative;
        transition: all 0.3s ease;
        overflow: hidden;
    }
    
    .nav-link::before {
        content: '';
        position: absolute;
        bottom: -2px;
        left: 50%;
        width: 0;
        height: 2px;
        background: linear-gradient(90deg, #00B0F0, #00CFFF);
        transition: all 0.4s ease;
        transform: translateX(-50%);
    }
    
    .nav-link:hover::before {
        width: 100%;
    }
    
    .nav-link:hover {
        color: #00B0F0 !important;
        transform: translateY(-2px);
        text-shadow: 0 4px 8px rgba(0, 176, 240, 0.3);
    }
    
    .nav-link:active {
        transform: translateY(0);
        transition: transform 0.1s ease;
    }
    
    /* Join Now button enhanced hover */
    .hidden.lg\\:flex .join-btn {
        position: relative;
        overflow: hidden;
        transition: all 0.3s ease;
    }
    
    .hidden.lg\\:flex .join-btn::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        background: rgba(255, 255, 255, 0.2);
        border-radius: 50%;
        transition: all 0.6s ease;
        transform: translate(-50%, -50%);
    }
    
    .hidden.lg\\:flex .join-btn:hover::before {
        width: 300px;
        height: 300px;
    }
    
    .hidden.lg\\:flex .join-btn:hover {
        transform: translateY(-3px) scale(1.05);
        box-shadow: 0 8px 25px rgba(0, 176, 240, 0.4);
        filter: brightness(1.1);
    }
    
    .hidden.lg\\:flex .join-btn:active {
        transform: translateY(-1px) scale(1.02);
        transition: transform 0.1s ease;
    }
}

/* Video styling */
.hero-video {
    object-fit: cover;
    object-position: center;
}

/* Modal z-index hierarchy */
.modal-overlay {
    z-index: 1500;
}

.glofox-modal {
    z-index: 2000;
}

/* Loading animation */
.loading-spinner {
    border: 3px solid #2C2C2C;
    border-top: 3px solid #00B0F0;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Text truncation for descriptions */
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Glofox iframe styling */
.glofox_iframe {
    width: 100%;
    min-height: 400px;
}

.glofox-iframe-rounded {
    border-radius: 8px;
}

/* iOS Glofox modal compatibility */
@supports (-webkit-touch-callout: none) {
    .glofox-modal .glofox_iframe {
        -webkit-overflow-scrolling: touch;
        transform: translate3d(0,0,0);
    }
    
    .glofox-modal iframe {
        border-radius: 8px !important;
        background: #2C2C2C;
    }
}

/* Mobile menu enhancements - DARKER GREY THEME */
#mobile-menu {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    background-color: #111111 !important; /* Darker grey background */
    backdrop-filter: none !important; /* Remove blur that was causing transparency */
    -webkit-backdrop-filter: none !important;
    z-index: 9999 !important;
    border-left: 1px solid rgba(68, 68, 68, 0.3); /* Darker grey border */
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.7); /* Stronger shadow for depth */
}

/* Ensure mobile menu overlay is fully opaque */
#mobile-menu-overlay {
    background-color: rgba(0, 0, 0, 0.9) !important; /* More opaque overlay */
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9998 !important;
}

/* Hardware acceleration for smooth animations */
#mobile-menu,
#mobile-menu-overlay {
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Touch-friendly hover states for mobile */
@media (hover: hover) and (pointer: fine) {
    .mobile-nav-link:hover {
        transform: translateX(4px);
    }
}

/* Mobile menu scrollbar styling */
#mobile-menu::-webkit-scrollbar {
    width: 4px;
}

#mobile-menu::-webkit-scrollbar-track {
    background: transparent;
}

#mobile-menu::-webkit-scrollbar-thumb {
    background: #444444;
    border-radius: 2px;
}

#mobile-menu::-webkit-scrollbar-thumb:hover {
    background: #666666;
}

/* Safe area adjustments for notched devices */
@supports (padding: max(0px)) {
    #mobile-menu {
        padding-top: max(env(safe-area-inset-top), 0px);
        padding-bottom: max(env(safe-area-inset-bottom), 0px);
    }
}

/* Prevent text selection in mobile menu */
#mobile-menu {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Focus styles for accessibility - darker theme */
.mobile-nav-link:focus,
#mobile-menu-close:focus {
    outline: 2px solid #666666;
    outline-offset: 2px;
    background-color: rgba(68, 68, 68, 0.3) !important;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    #mobile-menu,
    #mobile-menu-overlay,
    .mobile-nav-link,
    .nav-link,
    .join-btn {
        transition-duration: 0.1s;
    }
    
    .nav-link::before,
    .join-btn::before {
        display: none;
    }
}

/* Google Maps iframe styling */
.maps-container iframe {
    border: 0;
    border-radius: 8px;
}

.maps-iframe {
    border: 0;
    border-radius: 8px;
}

/* Contact section links */
.contact-link {
    transition: color 0.3s ease;
}

.contact-link:hover {
    color: #00B0F0;
}

/* Footer social links */
.footer-social {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.footer-social a {
    transition: color 0.3s ease;
}

.footer-social a:hover {
    color: #00B0F0;
}

/* Timetable class hover effects */
.timetable-class {
    transition: all 0.3s ease;
}

.timetable-class:hover {
    border-color: rgba(0, 176, 240, 0.6);
    transform: scale(1.02);
}

/* Class details modal */
.class-modal-content {
    max-height: 90vh;
    overflow-y: auto;
}

/* Mobile book button */
.mobile-book-btn {
    pointer-events: all;
}

/* Social icon hover effects */
.social-icon {
    transition: color 0.2s ease;
}

.social-icon:hover {
    color: #00B0F0;
}

/* Hide auto-appended TeamUp helper container that can appear after footer */
body > div[id^="teamup-widget-"][id$="-container"] {
    display: none !important;
    visibility: hidden !important;
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Initial page load state - ENHANCED SCROLL LOCK */
body.initial-load,
body.scroll-locked {
    overflow: hidden !important;
    height: 100vh !important;
    position: fixed !important;
    width: 100% !important;
    top: 0 !important;
    left: 0 !important;
}

/* Header initial state */
.nav-initial-hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease-in-out;
}

.nav-visible {
    opacity: 1;
    pointer-events: auto;
}

/* Hero content fade in */
.hero-content-hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease-in-out;
}

.hero-content-visible {
    opacity: 1;
    pointer-events: auto;
}

/* Enhanced AOS animations fix */
[data-aos] {
    pointer-events: none;
    transition-property: transform, opacity;
}

[data-aos].aos-animate {
    pointer-events: auto;
}

/* Ensure AOS elements are visible when animations are disabled */
@media (prefers-reduced-motion: reduce) {
    [data-aos] {
        opacity: 1 !important;
        transform: none !important;
        pointer-events: auto !important;
    }
} 