/* Dynamic Styles - Class Categories and Color Badges */

/* Color badge base styling */
.color-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: 'BebasNeue', sans-serif;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

/* Color badge variants matching site palette */
.color-badge--electric-blue {
    background: linear-gradient(135deg, var(--color-electric-blue), var(--color-cyan-tint));
    color: white;
    border-color: rgba(0, 176, 240, 0.3);
}

.color-badge--cyan-tint {
    background: linear-gradient(135deg, var(--color-cyan-tint), var(--color-electric-blue));
    color: white;
    border-color: rgba(0, 207, 255, 0.3);
}

.color-badge--steel-gray {
    background: var(--color-steel-gray);
    color: var(--color-cool-gray);
    border-color: rgba(44, 44, 44, 0.5);
}

/* Timetable class styling */
.timetable-class--pt-led {
    background: linear-gradient(135deg, var(--color-electric-blue), var(--color-cyan-tint));
    border: 1px solid rgba(0, 176, 240, 0.3);
}

.timetable-class--main {
    background: linear-gradient(135deg, var(--color-electric-blue), var(--color-cyan-tint));
    border: 1px solid rgba(0, 176, 240, 0.3);
}

.timetable-class--mind-body {
    background: linear-gradient(135deg, #9C27B0, #7B1FA2);
    border: 1px solid rgba(156, 39, 176, 0.3);
}

.timetable-class--hiit {
    background: linear-gradient(135deg, #F44336, #D32F2F);
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.timetable-class--strength {
    background: linear-gradient(135deg, #FF9800, #F57C00);
    border: 1px solid rgba(255, 152, 0, 0.3);
}

.timetable-class--cardio {
    background: linear-gradient(135deg, #4CAF50, #388E3C);
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.timetable-class--recovery {
    background: linear-gradient(135deg, var(--color-cyan-tint), var(--color-electric-blue));
    border: 1px solid rgba(0, 207, 255, 0.3);
}

/* Legend indicators */
.legend-indicator {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    margin-left: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.legend-indicator--pt-led {
    background: linear-gradient(135deg, var(--color-electric-blue), var(--color-cyan-tint));
}

.legend-indicator--main {
    background: linear-gradient(135deg, var(--color-electric-blue), var(--color-cyan-tint));
}

.legend-indicator--mind-body {
    background: linear-gradient(135deg, #9C27B0, #7B1FA2);
}

.legend-indicator--hiit {
    background: linear-gradient(135deg, #F44336, #D32F2F);
}

.legend-indicator--strength {
    background: linear-gradient(135deg, #FF9800, #F57C00);
}

.legend-indicator--cardio {
    background: linear-gradient(135deg, #4CAF50, #388E3C);
}

.legend-indicator--recovery {
    background: linear-gradient(135deg, var(--color-cyan-tint), var(--color-electric-blue));
}

/* Enhanced hover states */
.color-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 176, 240, 0.3);
}

.timetable-class:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(0, 176, 240, 0.2);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .color-badge {
        font-size: 0.6875rem;
        padding: 0.1875rem 0.625rem;
    }
    
    .legend-indicator {
        width: 0.625rem;
        height: 0.625rem;
    }
}

/* Navigation header states */
.nav-initial-hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--duration-slow) ease-in-out;
}

.nav-visible {
    opacity: 1;
    pointer-events: auto;
}

/* Scroll indicator */
.scroll-indicator-visible {
    opacity: 1;
}

.scroll-indicator-hidden {
    opacity: 0;
}

/* Enter overlay states */
.enter-overlay-visible {
    opacity: 1;
    transition: opacity 1s ease;
}

.enter-overlay-hidden {
    opacity: 0;
}

.enter-overlay-none {
    display: none;
}

/* Body scroll position preservation */
.body-scroll-lock {
    position: fixed !important;
    top: var(--scroll-y, 0);
    left: 0;
    width: 100%;
    overflow: hidden;
}

/* Image Optimization Styles */
.gym-image {
    object-fit: contain;
    max-width: 100%;
    height: auto;
    display: block;
    transition: transform var(--duration-normal) ease;
}

.gym-image:hover {
    transform: scale(1.02);
}

/* Responsive image container for gym section */
@media (max-width: 1023px) {
    .gym-image {
        max-height: 400px;
        margin: 0 auto;
    }
}

/* Background image optimization */
section img[alt*="Background"],
section img[alt*="Ice Bath"],
section img[alt*="Entrance"] {
    object-fit: cover;
    object-position: center;
}

/* Ensure natural aspect ratio for all gallery images */
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--duration-normal) ease;
}

/* Mobile optimization for background images */
@media (max-width: 768px) {
    section .absolute img {
        object-position: center center;
    }
}

/* Performance optimization - lazy loading support */
img[loading="lazy"] {
    background-color: var(--color-steel-gray);
}

/* Ensure proper rendering during load */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* COMPREHENSIVE CROSS-BROWSER & MOBILE COMPATIBILITY */

/* Universal box-sizing */
*, *::before, *::after {
    box-sizing: border-box;
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    /* Fix iOS bounce scroll */
    body {
        -webkit-overflow-scrolling: touch;
        overflow-scrolling: touch;
    }
    
    /* Prevent iOS zoom on input focus */
    input, textarea, select {
        font-size: 16px !important;
    }
    
    /* Fix iOS video playback */
    video {
        -webkit-playsinline: true;
        playsinline: true;
    }
    
    /* iOS button styling */
    button, input[type="submit"], input[type="button"] {
        -webkit-appearance: none;
        border-radius: 0;
    }
    
    /* Fix iOS viewport units */
    .vh-fix {
        height: 100vh;
        height: -webkit-fill-available;
    }
}

/* Android Chrome specific fixes */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    /* Fix Chrome button styling */
    button, input[type="submit"], input[type="button"] {
        -webkit-appearance: none;
    }
    
    /* Chrome video autoplay fix */
    video {
        -webkit-playsinline: true;
    }
}

/* Firefox specific fixes */
@-moz-document url-prefix() {
    /* Fix Firefox button styling */
    button {
        -moz-appearance: none;
    }
    
    /* Firefox scrollbar styling */
    * {
        scrollbar-width: thin;
        scrollbar-color: var(--color-electric-blue) var(--color-steel-gray);
    }
}

/* Microsoft Edge/IE fixes */
@supports (-ms-ime-align: auto) {
    /* Edge button fixes */
    button {
        -ms-appearance: none;
    }
}

/* Samsung Internet fixes */
@media screen and (-webkit-min-device-pixel-ratio: 0) and (min-color-index: 0) {
    video {
        -webkit-playsinline: true;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    button, .join-btn, .mobile-book-btn {
        min-height: 48px !important;
        min-width: 48px !important;
        padding: 12px 24px !important;
    }
    
    /* Remove hover effects on touch devices */
    .join-btn:hover,
    .gradient-primary:hover,
    .mobile-book-btn:hover {
        transform: none !important;
    }
    
    /* Touch-friendly navigation */
    .nav-link {
        padding: 12px 16px;
    }
}

/* High DPI display optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Crisp images on retina displays */
    img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Landscape mobile optimizations */
@media screen and (orientation: landscape) and (max-height: 500px) {
    /* Adjust hero section for landscape mobile */
    #hero {
        height: 100vh;
        height: -webkit-fill-available;
    }
    
    /* Smaller button sizes in landscape */
    .join-btn, .gradient-primary, .mobile-book-btn {
        padding: 8px 16px !important;
        font-size: 14px !important;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .join-btn, .gradient-primary, .mobile-book-btn {
        border: 2px solid white !important;
    }
}

/* Dark mode support detection */
@media (prefers-color-scheme: dark) {
    /* Already optimized for dark mode */
}

/* Print styles */
@media print {
    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }
    
    .join-btn, .gradient-primary, .mobile-book-btn {
        background: #333 !important;
        color: white !important;
    }
}

/* Video performance optimizations */
video {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: transform;
}

/* Button performance optimizations */
.join-btn, .gradient-primary, .mobile-book-btn {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: transform, box-shadow;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Smooth scrolling for all browsers */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* Focus management for keyboard navigation */
.join-btn:focus-visible,
.gradient-primary:focus-visible,
.mobile-book-btn:focus-visible {
    outline: 2px solid var(--color-electric-blue);
    outline-offset: 2px;
}

/* Loading states */
.loading-spinner {
    border: 3px solid var(--color-steel-gray);
    border-top: 3px solid var(--color-electric-blue);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

/* Ensure buttons work in all contexts */
.join-btn, .gradient-primary, .mobile-book-btn {
    /* Prevent text selection */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    
    /* Enable hardware acceleration */
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    
    /* Ensure clickable */
    pointer-events: auto;
    
    /* Prevent double-tap zoom on mobile */
    touch-action: manipulation;
} 