/**
 * Team Rocket HQ Ferris Wheel Styles
 * ULTRA-SMOOTH MP4 IMPLEMENTATION: Full Wheel Display
 * WordPress Integration with Ultra-Smooth MP4 Video Backgrounds
 * 
 * Features:
 * - Perfect circular geometry on all devices using square container system
 * - FULL WHEEL VISIBLE - No more hidden bottom half
 * - Ultra-smooth MP4 video backgrounds (30 FPS, 96% smaller files)
 * - Touch-optimized mobile experience with larger wheel presence
 * - Cross-browser compatible using modern CSS (min(), aspect-ratio)
 * - Performance optimized for mobile devices with hardware acceleration
 */

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: 'Segoe UI', Arial, sans-serif;
    
    /* Prevent all scrolling on mobile */
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    
    /* DEFAULT (Desktop): Fallback background color - MP4 video will overlay */
    background: #e0eafc;
    background-size: cover;
}

/* Ultra-Smooth MP4 Video Background */
.video-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.video-background video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

/* Show appropriate video based on screen size */
.video-background .desktop-video {
    display: block;
}

.video-background .tablet-video,
.video-background .mobile-video {
    display: none;
}

/* TABLET: Show tablet video (481-768px) */
@media screen and (max-width: 768px) and (min-width: 481px) {
    .video-background .desktop-video {
        display: none;
    }
    .video-background .tablet-video {
        display: block;
    }
}

/* MOBILE: Show mobile video (320-480px) */
@media screen and (max-width: 480px) {
    .video-background .desktop-video,
    .video-background .tablet-video {
        display: none;
    }
    .video-background .mobile-video {
        display: block;
    }
}

/* TABLET: Medium resolution background (481-768px) */
@media screen and (max-width: 768px) and (min-width: 481px) {
    html, body {
        /* Tablet fallback - MP4 video will overlay */
        background-attachment: scroll; /* Better performance on tablets */
    }
}

/* MOBILE: Small resolution background (320-480px) */
@media screen and (max-width: 480px) {
    html, body {
        /* Mobile fallback - MP4 video will overlay */
        background-attachment: scroll; /* Critical for mobile performance */
        background-position: center center;
    }
}

/* MOBILE-FIRST RESPONSIVE CONTAINER SYSTEM - Prominent wheel on all devices */
.ferris-container {
    /* MOBILE FIRST: Priority on wheel prominence (85-90% width) */
    width: 90vw;
    height: 90vw;
    max-width: 90vh;                /* Prevent overflow on landscape */
    max-height: 90vh;               /* Ensure full visibility */
    aspect-ratio: 1:1;
    
    position: fixed;               /* Fixed positioning for center alignment */
    top: 50%;                      /* Center vertically */
    left: 50%;                     /* Center horizontally */
    transform: translate(-50%, -50%); /* Perfect center positioning */
    overflow: visible;             /* Allow cabins to extend outside for full wheel visibility */
    
    /* Transparent background - no container background */
    background: transparent;
    
    /* Performance and isolation */
    isolation: isolate;
    contain: layout style;
    z-index: 1;
}

/* TABLET: Balanced experience (70-80% width) */
@media screen and (min-width: 481px) and (max-width: 1024px) {
    .ferris-container {
        width: 75vw;
        height: 75vw;
        max-width: 80vh;
        max-height: 80vh;
    }
}

/* DESKTOP: Optimal size without overwhelming (50-60% width, capped) */
@media screen and (min-width: 1025px) {
    .ferris-container {
        width: min(60vw, 600px);     /* Cap at reasonable max size */
        height: min(60vw, 600px);
        max-width: 80vh;
        max-height: 80vh;
    }
}

/*
 * FULL WHEEL DISPLAY SYSTEM
 * 
 * Strategy: Position wheel at bottom of container for complete visibility
 * - Container anchored at bottom of screen
 * - Wheel positioned at bottom of container (not middle)
 * - Full circular wheel visible on all devices
 * - No more hidden semicircle effect
 * 
 * Expected results:
 * - 320px screen: Full 320px wheel visible at bottom
 * - 375px screen: Full 375px wheel visible at bottom  
 * - 600px screen: Full 600px wheel visible at bottom
 * - 1366px screen: Full wheel visible at bottom
 * - 1920px screen: Full wheel visible at bottom
 */

.ferris-wheel {
    position: absolute;
    left: 50%;
    top: 50%;                  /* ✅ Perfect center positioning */
    width: 85%;                /* Slightly smaller to prevent cabin clipping */
    height: 85%;               /* Slightly smaller to prevent cabin clipping */
    transform: translate(-50%, -50%);  /* ✅ True center alignment */
    transform-origin: center center;
    
    /* Preserve existing properties */
    touch-action: pan-x;
    will-change: transform;
    backface-visibility: hidden;
}

.cabin {
    position: absolute;
    /* Scale cabins proportionally: responsive container-based scaling */
    width: 18%;                /* 18% of container width - increased for mobile touch */
    height: 18%;               /* 18% of container height - increased for mobile touch */
    min-width: 50px;           /* Meet 44px+ touch target guidelines */
    min-height: 50px;
    max-width: 80px;
    max-height: 80px;
    background-color: transparent;
    border: 3px solid #1976d2;
    border-radius: 50%;
    box-shadow: 0 2px 8px #0002;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Responsive font size based on container size - larger for mobile */
    font-size: clamp(1.0rem, 4vw, 1.3rem);
    font-weight: 700;          /* Bold for better mobile readability */
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);  /* Better contrast */
    color: #1976d2;
    transition: background 0.2s, opacity 0.2s;
    pointer-events: auto;
    user-select: none;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
    background-clip: padding-box;
    box-sizing: border-box;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(25, 118, 210, 0.2);
}

/* Enhanced mobile touch optimization */
@media (hover: none) and (pointer: coarse) {
    html, body {
        /* Additional mobile performance optimizations */
        background-position: center top;
        /* Optimize for mobile viewports */
        background-size: cover;
        /* Force no scrolling on mobile */
        overflow: hidden !important;
        position: fixed !important;
        width: 100% !important;
        height: 100% !important;
        top: 0 !important;
        left: 0 !important;
        -webkit-overflow-scrolling: none;
        overscroll-behavior: none;
    }
    
    .cabin {
        /* Slightly larger touch targets on mobile */
        min-width: 40px;
        min-height: 40px;
        /* Better touch feedback */
        transition: background 0.1s, transform 0.1s, opacity 0.2s;
    }
    
    .cabin:active {
        transform: scale(0.95);
        background-color: rgba(25, 118, 210, 0.1);
    }
    
    /* Mobile center button optimization */
    .logo-center {
        /* Larger touch target on mobile */
        min-width: 44px;
        min-height: 44px;
    }
    
    .logo-center:active {
        transform: translate(-50%, -50%) scale(0.95);
        box-shadow: 0 0 0 5px rgba(0, 255, 255, 0.5);
    }
}

.wheel-svg {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    transform-origin: center center;
}

.cabins {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    z-index: 2;
    pointer-events: none;
}

.cabin.empty {
    background-color: transparent;
    border-style: dashed;
    color: #aaa;
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
}

.logo-center {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 30%;
    height: 30%;
    transform: translate(-50%, -50%);
    z-index: 3;
    background: #000000;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(25, 118, 210, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
    animation: pulse 3s infinite;
    /* Mobile touch optimization */
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 255, 255, 0.3);
    pointer-events: auto;
}

.logo-center:hover {
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow: 0 0 0 8px rgba(25, 118, 210, 0.3);
}

@keyframes pulse {
    0% { 
        box-shadow: 0 0 0 0 rgba(0, 255, 255, 0.8), 0 0 20px rgba(0, 255, 255, 0.5);
        transform: translate(-50%, -50%) scale(1);
    }
    50% { 
        box-shadow: 0 0 0 15px rgba(0, 255, 255, 0.3), 0 0 30px rgba(0, 255, 255, 0.7);
        transform: translate(-50%, -50%) scale(1.05);
    }
    100% { 
        box-shadow: 0 0 0 0 rgba(0, 255, 255, 0), 0 0 20px rgba(0, 255, 255, 0.5);
        transform: translate(-50%, -50%) scale(1);
    }
}

.center-button-text {
    position: fixed !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) translateY(-20%) rotate(0deg) !important;
    font-size: 1.1rem;
    color: #00FFFF;  /* Starting with cyan */
    text-shadow: 2px 2px 4px rgba(0,0,0,0.9), 0 0 12px rgba(0,255,255,0.8);
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    pointer-events: none;
    z-index: 99999 !important;
    display: block;
    animation: textGlow 4s ease-in-out infinite;
    transition: opacity 0.5s ease-in-out;
    /* Prevent ANY rotation or movement */
    will-change: auto;
    backface-visibility: visible;
    transform-origin: center center !important;
}

@keyframes textGlow {
    0% { 
        color: #00FFFF;  /* Cyan - complements pink */
        text-shadow: 2px 2px 4px rgba(0,0,0,0.9), 0 0 12px rgba(0,255,255,0.8);
    }
    25% { 
        color: #FFFFFF;  /* White - high contrast */
        text-shadow: 2px 2px 4px rgba(0,0,0,0.9), 0 0 12px rgba(255,255,255,0.8);
    }
    50% { 
        color: #00FF00;  /* Lime green - complements pink */
        text-shadow: 2px 2px 4px rgba(0,0,0,0.9), 0 0 12px rgba(0,255,0,0.8);
    }
    75% { 
        color: #87CEEB;  /* Sky blue - cool complement */
        text-shadow: 2px 2px 4px rgba(0,0,0,0.9), 0 0 12px rgba(135,206,235,0.8);
    }
    100% { 
        color: #00FFFF;  /* Back to cyan */
        text-shadow: 2px 2px 4px rgba(0,0,0,0.9), 0 0 12px rgba(0,255,255,0.8);
    }
}

.pokeball-button-white {
    width: 70%;
    height: 70%;
    background: #FFFFFF;
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pokeball-button-grey {
    width: 50%;
    height: 50%;
    background: #CCCCCC;
    border-radius: 50%;
    border: 1px solid #333333;
}

.logo-center img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.cabin iframe {
    pointer-events: none;
}

 