/**
 * Hero Animation Component Styles
 * Independent CSS for minimalist circle animation
 * Simple, serene design with subtle sky colors
 */

/* Hero Animation Container */
.hero-animation {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    will-change: transform;
    backface-visibility: hidden;
    perspective: 1000px;
    
    /* Vibrant sky gradient background inspired by op.png */
    background: linear-gradient(
        to bottom,
        rgba(0, 191, 255, 0.18) 0%,
        rgba(64, 224, 208, 0.15) 35%,
        rgba(152, 251, 152, 0.12) 70%,
        rgba(144, 238, 144, 0.08) 100%
    );
}

/* Three.js Canvas Styling */
.hero-animation canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    will-change: transform;
    mix-blend-mode: normal;
}

/* Loading state for smooth initialization */
.hero-animation:not(.initialized) {
    opacity: 0;
    transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-animation.initialized {
    opacity: 1;
}

/* Hide fallback elements when Three.js is successfully loaded */
.hero-animation.initialized:not(.fallback-animation) .wave-bar,
.hero-animation.initialized:not(.fallback-animation) .glass-shape,
.hero-animation.initialized:not(.fallback-animation) .liquid-flow {
    display: none;
}

/* Show fallback elements only when fallback mode is active */
.hero-animation.fallback-animation .wave-bar,
.hero-animation.fallback-animation .glass-shape,
.hero-animation.fallback-animation .liquid-flow {
    display: block;
}

/* Duplicate CSS removed */

/* Enhanced Fallback Animation - Vibrant circle design */
.hero-animation.fallback-animation {
    position: relative;
    background: linear-gradient(
        to bottom,
        rgba(0, 191, 255, 0.25) 0%,
        rgba(64, 224, 208, 0.2) 35%,
        rgba(152, 251, 152, 0.15) 70%,
        rgba(144, 238, 144, 0.12) 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Water horizon line */
.hero-animation.fallback-animation::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(30, 144, 255, 0.7) 20%,
        rgba(30, 144, 255, 0.9) 50%,
        rgba(30, 144, 255, 0.7) 80%,
        transparent 100%
    );
    animation: waterShimmer 3s ease-in-out infinite;
    z-index: 1;
}

/* Main circle ring fallback */
.hero-animation.fallback-animation::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120px;
    height: 60px;
    border: 6px solid rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: circleBreath 4s ease-in-out infinite;
    z-index: 2;
}

/* Water reflection circle - enhanced */
.hero-animation.fallback-animation .wave-bar {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120px;
    height: 60px;
    border: 3px solid rgba(255, 255, 255, 0.45);
    border-radius: 50%;
    transform: translate(-50%, 50%) scaleY(-0.9);
    animation: reflectionWave 4s ease-in-out infinite;
    z-index: 1;
    filter: blur(0.5px);
}

.hero-animation.fallback-animation .wave-bar:nth-child(1) { 
    animation-delay: -0.5s; opacity: 0.6;
}
.hero-animation.fallback-animation .wave-bar:nth-child(2) { 
    animation-delay: -1s; opacity: 0.5;
}
.hero-animation.fallback-animation .wave-bar:nth-child(3) { 
    animation-delay: -1.5s; opacity: 0.4;
}
.hero-animation.fallback-animation .wave-bar:nth-child(4) { 
    animation-delay: -2s; opacity: 0.3;
}
.hero-animation.fallback-animation .wave-bar:nth-child(5) { 
    animation-delay: -2.5s; opacity: 0.35;
}
.hero-animation.fallback-animation .wave-bar:nth-child(6) { 
    animation-delay: -3s; opacity: 0.4;
}
.hero-animation.fallback-animation .wave-bar:nth-child(7) { 
    animation-delay: -3.5s; opacity: 0.3;
}
.hero-animation.fallback-animation .wave-bar:nth-child(8) { 
    animation-delay: -4s; opacity: 0.25;
}
.hero-animation.fallback-animation .wave-bar:nth-child(9) { 
    animation-delay: -4.5s; opacity: 0.2;
}
.hero-animation.fallback-animation .wave-bar:nth-child(10) { 
    animation-delay: -5s; opacity: 0.15;
}

/* Glass shapes - hidden for minimalist design */
.hero-animation.fallback-animation .glass-shape {
    display: none;
}

/* Liquid flow effect - hidden for minimalist design */
.hero-animation.fallback-animation .liquid-flow {
    display: none;
}

/* Enhanced Keyframe Animations */
@keyframes waterShimmer {
    0%, 100% {
        opacity: 0.6;
        transform: scaleX(1);
    }
    50% {
        opacity: 0.8;
        transform: scaleX(1.05);
    }
}

@keyframes circleBreath {
    0% {
        transform: translate(-50%, -150%) scale(0.9);
        opacity: 0.6;
        border-width: 6px;
    }
    50% {
        transform: translate(-50%, -100%) scale(0.98);
        opacity: 0.8;
        border-width: 5px;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.02);
        opacity: 0.95;
        border-width: 4px;
    }
}

@keyframes reflectionWave {
    0%, 100% {
        transform: translate(-50%, 50%) scaleY(-0.8) scaleX(1);
        opacity: 0.3;
    }
    50% {
        transform: translate(-50%, 50%) scaleY(-0.75) scaleX(1.02);
        opacity: 0.5;
    }
}


/* Mobile Optimizations - Apple-style responsive design */
@media (max-width: 768px) {
    .hero-animation {
        /* Subtle scale reduction on mobile for performance */
        transform: scale(0.9);
        transform-origin: center center;
        
        /* Lighter background on mobile */
        background: linear-gradient(
            to bottom,
            rgba(0, 191, 255, 0.12) 0%,
            rgba(64, 224, 208, 0.08) 40%,
            rgba(152, 251, 152, 0.05) 70%,
            transparent 100%
        );
    }
    
    .hero-animation canvas {
        /* Optimized rendering quality on mobile */
        image-rendering: optimizeQuality;
    }
    
    .hero-animation.fallback-animation::before {
        width: 160px;
        height: 160px;
        filter: blur(1px);
        top: 20%;
        left: 30%;
    }
    
    .hero-animation.fallback-animation::after {
        width: 120px;
        height: 120px;
        filter: blur(0.8px);
        top: 50%;
        right: 25%;
    }
    
    .hero-animation.fallback-animation .fallback-shape-1 {
        width: 80px;
        height: 80px;
        filter: blur(0.5px);
    }
}

@media (max-width: 480px) {
    .hero-animation {
        transform: scale(0.85);
        
        /* Even lighter on small screens */
        background: linear-gradient(
            to bottom,
            rgba(0, 191, 255, 0.08) 0%,
            rgba(64, 224, 208, 0.05) 40%,
            transparent 70%
        );
    }
    
    .hero-animation.fallback-animation::before {
        width: 120px;
        height: 120px;
    }
    
    .hero-animation.fallback-animation::after {
        width: 90px;
        height: 90px;
    }
    
    .hero-animation.fallback-animation .fallback-shape-1 {
        width: 60px;
        height: 60px;
    }
}

/* Accessibility Support - Apple standards */
@media (prefers-reduced-motion: reduce) {
    .hero-animation canvas,
    .hero-animation.fallback-animation::before,
    .hero-animation.fallback-animation::after,
    .hero-animation.fallback-animation .fallback-shape-1 {
        animation-duration: 20s !important;
        animation-timing-function: linear !important;
    }
    
    .hero-animation {
        transform: none !important;
    }
    
    .hero-animation.fallback-animation::before,
    .hero-animation.fallback-animation::after {
        filter: blur(0.5px) !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .hero-animation {
        background: none;
    }
    
    .hero-animation.fallback-animation::before {
        background: radial-gradient(
            circle, 
            rgba(0, 0, 0, 0.25) 0%, 
            rgba(0, 0, 0, 0.1) 50%,
            transparent 80%
        );
    }
    
    .hero-animation.fallback-animation::after {
        background: radial-gradient(
            circle, 
            rgba(0, 0, 0, 0.2) 0%, 
            rgba(0, 0, 0, 0.08) 50%,
            transparent 80%
        );
    }
    
    .hero-animation.fallback-animation .fallback-shape-1 {
        background: radial-gradient(
            circle, 
            rgba(0, 0, 0, 0.15) 0%, 
            transparent 60%
        );
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .hero-animation {
        background: linear-gradient(
            to bottom,
            rgba(0, 191, 255, 0.06) 0%,
            rgba(64, 224, 208, 0.04) 35%,
            rgba(152, 251, 152, 0.03) 70%,
            transparent 100%
        );
    }
    
    .hero-animation.fallback-animation::before {
        background: radial-gradient(
            circle at 35% 35%, 
            rgba(0, 122, 255, 0.25) 0%, 
            rgba(0, 122, 255, 0.12) 50%, 
            rgba(0, 122, 255, 0.04) 80%,
            transparent 100%
        );
    }
    
    .hero-animation.fallback-animation::after {
        background: radial-gradient(
            circle at 45% 45%, 
            rgba(88, 86, 214, 0.22) 0%, 
            rgba(88, 86, 214, 0.1) 50%, 
            rgba(88, 86, 214, 0.03) 80%,
            transparent 100%
        );
    }
    
    .hero-animation.fallback-animation .fallback-shape-1 {
        background: radial-gradient(
            circle at center, 
            rgba(0, 199, 190, 0.18) 0%, 
            rgba(0, 199, 190, 0.06) 60%, 
            transparent 100%
        );
    }
}

/* Performance Optimizations */
.hero-animation * {
    transform-style: preserve-3d;
    will-change: transform, opacity;
}

/* Print Styles - Hide animation in print */
@media print {
    .hero-animation {
        display: none;
    }
}