/* ==========================================================================
   3D CINEMATIC ANIMATION STYLESHEET
   Full WebGL 3D immersion, cinematic camera modes, HUD overlay & tilt effects
   ========================================================================== */

/* WebGL Background Canvas */
#webgl-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    opacity: 0.95;
    transition: opacity 0.8s ease;
}

body.cinematic-active #webgl-canvas {
    pointer-events: auto;
    z-index: 99990;
    opacity: 1;
}

/* Subtle Cinematic Vignette */
.cinematic-vignette {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background: radial-gradient(circle at center, transparent 60%, rgba(9, 53, 50, 0.45) 100%);
    transition: opacity 0.8s ease;
}

/* 3D Perspective Tilt on Elements */
.tilt-card {
    transform-style: preserve-3d;
    perspective: 1200px;
    transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s ease;
    will-change: transform;
}

.tilt-inner {
    transform: translateZ(30px);
    transition: transform 0.2s ease;
}

/* 3D Floating Geometry Badges */
.floating-3d-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(239, 132, 81, 0.9), rgba(224, 153, 0, 0.9));
    color: #ffffff;
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 10px 25px rgba(239, 132, 81, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.4);
    animation: floatBadge 3.5s ease-in-out infinite;
}

@keyframes floatBadge {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-6px) rotate(1deg); }
}

/* ==========================================================================
   CINEMATIC DRONE TOUR HUD & LETTERBOX OVERLAY
   ========================================================================== */
.cinematic-overlay {
    position: fixed;
    inset: 0;
    z-index: 99995;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.6s;
}

body.cinematic-active .cinematic-overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Letterbox Cinema Bars */
.cinema-bar-top,
.cinema-bar-bottom {
    position: absolute;
    left: 0;
    width: 100%;
    height: 70px;
    background: #000000;
    z-index: 2;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.cinema-bar-top {
    top: 0;
    transform: translateY(-100%);
}

.cinema-bar-bottom {
    bottom: 0;
    transform: translateY(100%);
}

body.cinematic-active .cinema-bar-top,
body.cinematic-active .cinema-bar-bottom {
    transform: translateY(0);
}

/* Top HUD */
.cinematic-hud-top {
    position: absolute;
    top: 85px;
    left: 40px;
    right: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #ffffff;
    font-family: 'DM Sans', monospace;
    font-size: 0.85rem;
    z-index: 5;
    pointer-events: auto;
}

.hud-rec-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    padding: 6px 14px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.rec-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ff3b30;
    animation: blinkRec 1s ease-in-out infinite;
}

@keyframes blinkRec {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

.hud-cam-info {
    letter-spacing: 2px;
    font-weight: 700;
    color: #ffd700;
    text-transform: uppercase;
}

/* Bottom Controls */
.cinematic-hud-bottom {
    position: absolute;
    bottom: 85px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 5;
    pointer-events: auto;
}

.btn-hud-control {
    background: rgba(15, 57, 59, 0.85);
    color: #ffffff;
    border: 1px solid rgba(255, 215, 0, 0.5);
    padding: 10px 20px;
    border-radius: 50px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-hud-control:hover {
    background: #e09900;
    color: #093532;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(224, 153, 0, 0.4);
}

.btn-hud-exit {
    background: rgba(220, 38, 38, 0.85);
    border-color: rgba(255, 255, 255, 0.4);
}

.btn-hud-exit:hover {
    background: #ef4444;
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

/* 3D Holographic Card in Cinematic Tour */
.cinematic-tour-card {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: rgba(9, 53, 50, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 215, 0, 0.5);
    border-radius: 24px;
    padding: 40px;
    width: 90%;
    max-width: 650px;
    color: #ffffff;
    text-align: center;
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.6), 0 0 40px rgba(224, 153, 0, 0.2);
    z-index: 4;
    opacity: 0;
    pointer-events: none;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.cinematic-tour-card.active {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.tour-card-step {
    font-size: 0.8rem;
    color: #ffd700;
    letter-spacing: 3px;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.tour-card-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 16px;
    color: #ffffff;
    line-height: 1.25;
}

.tour-card-desc {
    font-size: 1.05rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 24px;
}

.tour-nav-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.tour-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.tour-dot.active {
    background: #ffd700;
    transform: scale(1.3);
    box-shadow: 0 0 10px #ffd700;
}

/* Floating Quick Toggle Pill */
.floating-cinematic-pill {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 900;
    background: rgba(9, 53, 50, 0.88);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 215, 0, 0.45);
    color: #ffd700;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.88rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.35s ease;
}

.floating-cinematic-pill:hover {
    background: rgba(224, 153, 0, 0.95);
    color: #093532;
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 15px 35px rgba(224, 153, 0, 0.4);
}

.floating-cinematic-pill .pulse-icon {
    font-size: 1.1rem;
    animation: pulseIcon 2s infinite;
}

@keyframes pulseIcon {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.25); }
}

/* Audio Ambient Visualizer */
.audio-visualizer-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 16px;
}

.vis-bar {
    width: 3px;
    background: #ffd700;
    border-radius: 2px;
    height: 4px;
    transition: height 0.2s ease;
}

body.audio-playing .vis-bar:nth-child(1) { animation: barDance 0.8s ease-in-out infinite; }
body.audio-playing .vis-bar:nth-child(2) { animation: barDance 1.2s ease-in-out infinite 0.2s; }
body.audio-playing .vis-bar:nth-child(3) { animation: barDance 0.9s ease-in-out infinite 0.4s; }
body.audio-playing .vis-bar:nth-child(4) { animation: barDance 1.1s ease-in-out infinite 0.1s; }

@keyframes barDance {
    0%, 100% { height: 4px; }
    50% { height: 16px; }
}
