/* ========================================
   Lab Effects - 実験室の世界観
   Water Bubbles + Video Background + Page Transitions
   ======================================== */

/* ===== Page Loading Overlay ===== */
.page-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #000000 0%, #001428 50%, #000a14 100%);
    z-index: 9999; /* Below mobile nav menu (10002) and header (10003) but above content */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease-out, visibility 0.8s ease-out;
}

.page-loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.page-loading-overlay .loading-content {
    text-align: center;
    z-index: 1;
}

.page-loading-overlay .loading-logo {
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 900;
    background: linear-gradient(135deg, #00a8ff, #0066cc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.1em;
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { filter: drop-shadow(0 0 20px rgba(0, 168, 255, 0.5)); }
    50% { filter: drop-shadow(0 0 40px rgba(0, 168, 255, 0.8)); }
}

/* ===== Bubbles Container ===== */
.bubbles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999; /* Below nav (1000) */
    overflow: hidden;
}

.bubble {
    position: absolute;
    bottom: -100px;
    background: radial-gradient(circle at 30% 30%, rgba(0, 168, 255, 0.4), rgba(0, 100, 200, 0.2));
    border-radius: 50%;
    border: 1px solid rgba(0, 168, 255, 0.3);
    animation: bubble-rise linear forwards;
    box-shadow: 
        inset 0 -5px 20px rgba(0, 168, 255, 0.2),
        0 0 20px rgba(0, 168, 255, 0.1);
}

.bubble::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 20%;
    width: 30%;
    height: 30%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.6), transparent);
    border-radius: 50%;
}

@keyframes bubble-rise {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-120vh) scale(0.5);
        opacity: 0;
    }
}

/* Bubble wobble effect */
.bubble.wobble {
    animation: bubble-rise-wobble linear forwards;
}

@keyframes bubble-rise-wobble {
    0% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    25% {
        transform: translateY(-30vh) translateX(20px) scale(0.9);
    }
    50% {
        transform: translateY(-60vh) translateX(-15px) scale(0.8);
    }
    75% {
        transform: translateY(-90vh) translateX(10px) scale(0.6);
    }
    100% {
        transform: translateY(-120vh) translateX(0) scale(0.4);
        opacity: 0;
    }
}

/* ===== Page Transition Overlay ===== */
.page-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #000000 0%, #001428 50%, #000a14 100%);
    z-index: 998; /* Below nav (1000) */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
    pointer-events: none;
}

.page-transition-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

/* ===== Hero Video Background ===== */
.hero-video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    /* Fallback gradient background for mobile */
    background: linear-gradient(
        135deg,
        #000814 0%,
        #001d3d 25%,
        #003566 50%,
        #001d3d 75%,
        #000814 100%
    );
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.hero-video-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.5) 0%,
        rgba(0, 20, 40, 0.4) 30%,
        rgba(0, 20, 40, 0.4) 70%,
        rgba(0, 0, 0, 0.7) 100%
    );
    z-index: 1;
}

.hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
    opacity: 0.7;
    z-index: 0;
}

/* Mobile: Show video with optimized settings */
@media (max-width: 767px) {
    .hero-video-container {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        overflow: hidden;
        background: #000;
    }
    
    /* Show video on mobile with adjusted opacity */
    .hero-video {
        display: block;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        opacity: 0.6;
        transform: none;
        min-width: auto;
        min-height: auto;
    }
    
    .hero-video-container::after {
        background: linear-gradient(
            180deg,
            rgba(0, 0, 0, 0.4) 0%,
            rgba(0, 20, 40, 0.3) 50%,
            rgba(0, 0, 0, 0.6) 100%
        );
    }
}

/* Tablet and up: Show video */
@media (min-width: 768px) {
    .hero-video {
        display: block;
    }
    
    .hero-video-container {
        animation: none;
        background: #000;
    }
}



/* Video in specific position (upper area) */
.hero-video-top {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1200px;
    height: auto;
    max-height: 40vh;
    object-fit: cover;
    opacity: 0.7;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0.8) 70%, rgba(0,0,0,0) 100%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0.8) 70%, rgba(0,0,0,0) 100%);
}

/* ===== Ambient Bubbles (Always visible) ===== */
.ambient-bubbles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.ambient-bubble {
    position: absolute;
    background: radial-gradient(circle at 30% 30%, rgba(0, 168, 255, 0.15), rgba(0, 100, 200, 0.05));
    border-radius: 50%;
    border: 1px solid rgba(0, 168, 255, 0.1);
    animation: ambient-float infinite ease-in-out;
}

@keyframes ambient-float {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 0.3;
    }
    25% {
        transform: translateY(-20px) translateX(10px);
        opacity: 0.5;
    }
    50% {
        transform: translateY(-40px) translateX(-5px);
        opacity: 0.3;
    }
    75% {
        transform: translateY(-20px) translateX(15px);
        opacity: 0.5;
    }
}

/* ===== Lab Glow Effects ===== */
.lab-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.3;
    pointer-events: none;
    animation: glow-pulse 4s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.2); opacity: 0.5; }
}

/* ===== Liquid Drip Effect ===== */
.liquid-drip {
    position: absolute;
    width: 4px;
    background: linear-gradient(to bottom, transparent, rgba(0, 168, 255, 0.6), transparent);
    animation: drip 3s ease-in-out infinite;
}

@keyframes drip {
    0% {
        height: 0;
        top: 0;
        opacity: 0;
    }
    50% {
        height: 100px;
        top: 0;
        opacity: 1;
    }
    100% {
        height: 0;
        top: 100%;
        opacity: 0;
    }
}

/* ===== Enhanced Dark Blue Theme ===== */
body {
    background: linear-gradient(180deg, #000000 0%, #000a14 50%, #001020 100%) !important;
}

.header {
    background: rgba(0, 10, 20, 0.95) !important;
    border-bottom: 1px solid rgba(0, 168, 255, 0.2) !important;
}

.section-gray,
.pv-money-section,
.pv-compare-section {
    background: linear-gradient(180deg, rgba(0, 20, 40, 0.5) 0%, rgba(0, 10, 20, 0.8) 100%) !important;
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    .bubble,
    .ambient-bubble,
    .lab-glow,
    .liquid-drip {
        animation: none;
    }
    
    .page-loading-overlay,
    .page-transition-overlay {
        transition: none;
    }
}
