/* Interactive Indonesian Ocean Atlas Map Styling */

body {
    overflow: hidden !important; /* Lock scroll to allow canvas dragging */
    background-color: #000b18;
}

/* Layered Map Container Viewport */
.atlas-map-viewport {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background-color: #000b18;
    z-index: 5;
    cursor: grab;
}

.atlas-map-viewport:active {
    cursor: grabbing;
}

/* Map Canvas (Layered container loaded by JS) */
.atlas-map-canvas {
    position: absolute;
    width: 2200px;
    height: 1320px; /* 5:3 Aspect Ratio */
    background: transparent;
    background-size: 100% 100%;
    transform-origin: 0 0;
    will-change: transform;
    box-shadow: 0 25px 60px rgba(0,0,0,0.8), 0 0 100px rgba(0, 240, 255, 0.1);
}

/* Layer 1: Ocean grid lines & atmosphere */
.map-grid-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: 
        linear-gradient(rgba(0, 240, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.02) 1px, transparent 1px);
    background-size: 110px 110px;
    pointer-events: none;
    z-index: 1;
}

.map-atmosphere-rays {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.04) 0%, transparent 60%, rgba(0, 240, 255, 0.04) 100%);
    pointer-events: none;
    z-index: 4;
    mix-blend-mode: overlay;
    animation: atmosphere-light-shimmer 15s ease-in-out infinite alternate;
}

@keyframes atmosphere-light-shimmer {
    0% { opacity: 0.3; }
    100% { opacity: 0.8; }
}

/* Layer 2: Main Map Element */
.atlas-map {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
    z-index: 2;
    filter: brightness(1.05) contrast(1.05);
    pointer-events: none;
    user-select: none;
    animation: ambient-map-drift 18s ease-in-out infinite alternate;
}

@keyframes ambient-map-drift {
    0% { transform: translate(0, 0); }
    100% { transform: translate(3px, -2px); }
}

/* Ocean Overlay: Cinematic soft glowing ambient overlay and Shimmer */
.map-ocean-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(0, 240, 255, 0.08) 0%, transparent 80%),
                url('data:image/svg+xml;utf8,<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><filter id="noiseFilter"><feTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23noiseFilter)"/></svg>');
    background-blend-mode: overlay;
    opacity: 0.15;
    pointer-events: none;
    z-index: 3;
    animation: ocean-shimmer 20s linear infinite;
}

@keyframes ocean-shimmer {
    0% { background-position: 0% 0%; opacity: 0.1; }
    50% { opacity: 0.25; }
    100% { background-position: 100% 100%; opacity: 0.1; }
}

/* Layer 3: Floating Decorative Assets */
.map-whale {
    position: absolute;
    pointer-events: none;
    z-index: 10;
    opacity: 0.25;
    animation: whale-idle-swim 14s ease-in-out infinite alternate;
    top: 600px;
    left: 1100px;
}

@keyframes whale-idle-swim {
    0% { transform: translate(0, 0) rotate(-2deg); }
    100% { transform: translate(40px, -15px) rotate(2deg); }
}

.map-boat {
    position: absolute;
    pointer-events: none;
    z-index: 15;
    animation: boat-floating-bob 8s ease-in-out infinite;
}

.boat-1 { top: 24%; left: 16%; animation-delay: 0s; }
.boat-2 { top: 58%; left: 74%; animation-delay: 2s; }
.boat-3 { top: 82%; left: 40%; animation-delay: 4.5s; }

@keyframes boat-floating-bob {
    0% { transform: translateY(0) rotate(0deg); }
    33% { transform: translateY(-3px) rotate(1.5deg); }
    66% { transform: translateY(1px) rotate(-1deg); }
    100% { transform: translateY(0) rotate(0deg); }
}

.map-bird {
    position: absolute;
    pointer-events: none;
    z-index: 40;
    animation: bird-idle-fly 10s ease-in-out infinite alternate;
}

.bird-1 { top: 12%; left: 20%; animation-delay: 0s; }
.bird-2 { top: 42%; left: 60%; animation-delay: 3s; }

@keyframes bird-idle-fly {
    0% { transform: translate(0, 0) scale(0.7); }
    100% { transform: translate(30px, -15px) scale(0.7); }
}

.bird-wing-left {
    transform-origin: 20px 20px;
    animation: wing-flap 0.35s ease-in-out infinite alternate;
}

.bird-wing-right {
    transform-origin: 20px 20px;
    animation: wing-flap 0.35s ease-in-out infinite alternate-reverse;
}

@keyframes wing-flap {
    0% { transform: scaleY(0.25); }
    100% { transform: scaleY(1); }
}

/* Clouds Layer - Cloud Shadows */
.map-cloud {
    position: absolute;
    pointer-events: none;
    z-index: 8;
    opacity: 0.35;
    filter: blur(25px) drop-shadow(0 20px 30px rgba(0,0,0,0.8));
    animation: cloud-idle-drift var(--duration, 60s) ease-in-out infinite alternate;
}

.map-cloud svg path {
    fill: #000;
}

.cloud-1 { top: 15%; left: 20%; --duration: 25s; --cloud-scale: 1.5; }
.cloud-2 { top: 55%; left: 60%; --duration: 30s; animation-delay: 5s; --cloud-scale: 2; }

@keyframes cloud-idle-drift {
    0% { transform: translate(0, 0) scale(var(--cloud-scale, 1.5)); opacity: 0.2; }
    100% { transform: translate(50px, -20px) scale(calc(var(--cloud-scale, 1.5) + 0.05)); opacity: 0.4; }
}

/* Ambient Particles */
.map-ambient-particles {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 12;
}

.particle-bubble, .particle-plankton, .particle-glowdust {
    position: absolute;
    border-radius: 50%;
    animation: particle-idle-float 12s infinite ease-in-out alternate;
}

.particle-bubble {
    background: radial-gradient(circle, rgba(255, 255, 255, 0.4) 0%, rgba(0, 240, 255, 0.1) 70%);
    box-shadow: inset 0 0 4px rgba(255,255,255,0.5);
    border: 1px solid rgba(255,255,255,0.2);
}

.particle-plankton {
    background: #00f0ff;
    box-shadow: 0 0 10px #00f0ff, 0 0 20px #00f0ff;
    opacity: 0.6;
}

.particle-glowdust {
    background: #fff;
    box-shadow: 0 0 8px #fff;
    opacity: 0.3;
}

@keyframes particle-idle-float {
    0% { transform: translate(0, 0) scale(1); opacity: 0.2; }
    50% { transform: translate(var(--drift, 15px), -20px) scale(1.2); opacity: 0.8; }
    100% { transform: translate(calc(var(--drift, 15px) * -0.5), -40px) scale(0.9); opacity: 0.2; }
}

.hotspot {
    position: absolute;
    width: 130px;
    height: 130px;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.45s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Gentle floating/sway animation */
.hotspot-floater {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: floatIsland var(--anim-dur, 6s) ease-in-out infinite;
    will-change: transform;
}

/* Animation Offsets for Natural Variety */
.hotspot[data-region="laut-natuna"] { --anim-dur: 6.2s; --float-height: 8px; animation-delay: 0.1s; }
.hotspot[data-region="laut-jawa"] { --anim-dur: 8.5s; --float-height: 12px; animation-delay: 0.7s; }
.hotspot[data-region="selat-makassar"] { --anim-dur: 7.1s; --float-height: 10px; animation-delay: 1.4s; }
.hotspot[data-region="laut-sulawesi"] { --anim-dur: 9.3s; --float-height: 14px; animation-delay: 2.2s; }
.hotspot[data-region="laut-flores"] { --anim-dur: 6.8s; --float-height: 9px; animation-delay: 2.9s; }
.hotspot[data-region="laut-maluku"] { --anim-dur: 8.1s; --float-height: 11px; animation-delay: 3.6s; }
.hotspot[data-region="laut-banda"] { --anim-dur: 7.5s; --float-height: 10px; animation-delay: 4.3s; }
.hotspot[data-region="raja-ampat"] { --anim-dur: 10.2s; --float-height: 15px; animation-delay: 5.0s; }
.hotspot[data-region="laut-arafura"] { --anim-dur: 6.5s; --float-height: 7px; animation-delay: 1.1s; }

/* The island landmark component */
.island-landmark {
    width: 110px;
    height: 110px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Island image styling */
.island-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.75));
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    opacity: 0;
}

.island-image.loaded {
    opacity: 1;
}

/* Cinematic glowing aura behind the island */
.island-glow {
    position: absolute;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(0, 240, 255, 0.35) 0%, transparent 65%);
    pointer-events: none;
    z-index: -1;
    opacity: 0.65;
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    mix-blend-mode: screen;
}

/* Expansive surrounding water glow effect on hover */
.spotlight-glow {
    position: absolute;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(0, 255, 255, 0.25) 0%, rgba(0, 150, 255, 0.05) 50%, transparent 75%);
    pointer-events: none;
    z-index: -2;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
    mix-blend-mode: screen;
}

/* Region Label (appears below floating island) */
.island-label {
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: rgba(0, 11, 24, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1.5px solid rgba(0, 240, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6), 0 0 10px rgba(0, 240, 255, 0.1);
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 0.76rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    opacity: 0; /* hidden by default, fades in smoothly on hover */
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    letter-spacing: 0.5px;
    z-index: 10;
}

/* Mini Preview Card styling */
.mini-preview-card {
    position: absolute;
    bottom: 125%; /* Positioned above the island */
    left: 50%;
    transform: translateX(-50%) translateY(15px) scale(0.92);
    width: 240px;
    background: rgba(0, 11, 24, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1.5px solid rgba(0, 240, 255, 0.25);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.8), 0 0 25px rgba(0, 240, 255, 0.15);
    border-radius: 16px;
    padding: 15px;
    opacity: 0;
    pointer-events: none;
    z-index: 100;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

/* Triangle caret pointing down */
.mini-preview-card::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px;
    border-style: solid;
    border-color: rgba(0, 11, 24, 0.88) transparent transparent transparent;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
    margin: 0;
}

.preview-depth {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary-cyan);
    background: rgba(0, 240, 255, 0.12);
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid rgba(0, 240, 255, 0.25);
}

.preview-tagline {
    font-size: 0.74rem;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.35;
    margin: 0;
}

.preview-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    width: 100%;
}

.preview-stats {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.4;
}

.preview-label {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
}

.preview-species-val {
    color: #a0c4ff;
    font-style: italic;
}

.preview-explore-btn {
    margin-top: 6px;
    width: 100%;
    padding: 6px 12px;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.15) 0%, rgba(0, 110, 255, 0.15) 100%);
    border: 1px solid rgba(0, 240, 255, 0.35);
    border-radius: 8px;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
}

.preview-explore-btn:hover {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.35) 0%, rgba(0, 110, 255, 0.35) 100%);
    border-color: var(--primary-cyan);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.25);
    transform: translateY(-1px);
}

/* Interactivity (Hover & Active States) */
.hotspot:hover .island-landmark,
.hotspot.active .island-landmark {
    transform: scale(1.15) translateY(-8px);
}

.hotspot:hover .island-image,
.hotspot.active .island-image {
    filter: drop-shadow(0 20px 30px rgba(0, 240, 255, 0.45)) drop-shadow(0 25px 35px rgba(0, 0, 0, 0.8));
}

.hotspot:hover .island-glow,
.hotspot.active .island-glow {
    opacity: 1;
    transform: scale(1.35);
    background: radial-gradient(circle, rgba(0, 240, 255, 0.55) 0%, transparent 70%);
}

.hotspot:hover .island-label,
.hotspot.active .island-label {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    border-color: var(--primary-cyan);
    box-shadow: 0 6px 20px rgba(0, 240, 255, 0.3);
}

.hotspot:hover .spotlight-glow {
    opacity: 1;
    transform: scale(1.15);
}

/* Show mini-preview on hover */
.hotspot:hover .mini-preview-card {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
    pointer-events: auto;
}

/* Hide preview card when side panel is actively selected/zoomed */
.hotspot.active .mini-preview-card {
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Parallax shifts on map canvas layers */
.map-cloud {
    transform: translate3d(calc(var(--mouse-x, 0) * -15px), calc(var(--mouse-y, 0) * -15px), 0);
    transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.map-boat {
    transform: translate3d(calc(var(--mouse-x, 0) * -4px), calc(var(--mouse-y, 0) * -4px), 0);
    transition: transform 0.45s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.map-whale {
    transform: translate3d(calc(var(--mouse-x, 0) * -8px), calc(var(--mouse-y, 0) * -8px), 0);
    transition: transform 0.45s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.particle-bubble, .particle-plankton, .particle-glowdust {
    transform: translate3d(calc(var(--mouse-x, 0) * 18px), calc(var(--mouse-y, 0) * 18px), 0);
    transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Floating HUD Controls */
.map-hud-controls {
    position: absolute;
    bottom: 30px;
    left: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.hud-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 11, 24, 0.8);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), inset 0 0 10px rgba(255, 255, 255, 0.05);
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    padding: 0;
}

.hud-btn:hover {
    border-color: var(--primary-cyan);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.4), 0 4px 15px rgba(0, 0, 0, 0.5);
    transform: translateY(-2px);
    background: rgba(0, 240, 255, 0.1);
}

.hud-btn:active {
    transform: translateY(0);
}

.hud-btn.muted {
    border-color: rgba(255, 0, 80, 0.5);
    background: rgba(255, 0, 80, 0.08);
}

.hud-btn.muted:hover {
    border-color: rgb(255, 0, 80);
    box-shadow: 0 0 15px rgba(255, 0, 80, 0.4), 0 4px 15px rgba(0, 0, 0, 0.5);
    background: rgba(255, 0, 80, 0.15);
}

.hud-icon {
    font-size: 1.05rem;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Floating animation keyframe with soft vertical float and gentle sway */
@keyframes floatIsland {
    0% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(calc(var(--float-height, 8px) * -1)) rotate(0.8deg); }
    100% { transform: translateY(0) rotate(0deg); }
}

/* Responsive Scaling: Smaller islands on mobile/tablet to avoid cluttering */
@media (max-width: 1199px) {
    .hotspot {
        width: 100px;
        height: 100px;
    }
    .island-landmark {
        width: 70px;
        height: 70px;
    }
    .island-glow {
        width: 70px;
        height: 70px;
    }
    .island-label {
        font-size: 0.72rem;
        padding: 4px 12px;
        bottom: -12px;
    }
    .spotlight-glow {
        width: 220px;
        height: 220px;
    }
}

@media (max-width: 767px) {
    .hotspot {
        width: 70px;
        height: 70px;
    }
    .island-landmark {
        width: 48px;
        height: 48px;
    }
    .island-glow {
        width: 48px;
        height: 48px;
        opacity: 0.4;
    }
    .spotlight-glow {
        display: none !important;
    }
    .island-label {
        font-size: 0.64rem;
        padding: 3px 8px;
        bottom: -20px;
        opacity: 0.9; /* Maintain high readability on mobile without needing hover */
        transform: translateX(-50%) translateY(0);
    }
    .mini-preview-card {
        display: none !important; /* Hide preview panel on mobile to avoid overlap */
    }
    .map-hud-controls {
        bottom: 20px;
        left: 20px;
        gap: 8px;
    }
    .hud-btn {
        width: 38px;
        height: 38px;
    }
    .hud-icon {
        font-size: 0.95rem;
    }
    @keyframes floatIsland {
        0% { transform: translateY(0) rotate(0deg); }
        50% { transform: translateY(-4px) rotate(0.4deg); }
        100% { transform: translateY(0) rotate(0deg); }
    }
}

/* Map Zoom Controls */
.map-zoom-controls {
    position: absolute;
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 11, 24, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: 30px;
    padding: 15px 10px;
    gap: 15px;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), inset 0 0 10px rgba(0, 240, 255, 0.05);
}

.zoom-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 240, 255, 0.1);
    border: 1px solid rgba(0, 240, 255, 0.3);
    color: #fff;
    font-size: 1.2rem;
    font-weight: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.zoom-btn:hover {
    background: rgba(0, 240, 255, 0.25);
    border-color: #00f0ff;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
    transform: scale(1.05);
}

.zoom-btn:active {
    transform: scale(0.95);
}

.zoom-slider-container {
    height: 120px;
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
}

.zoom-slider-track {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.zoom-slider-thumb {
    position: absolute;
    bottom: 0; /* Bottom means min scale */
    width: 16px;
    height: 16px;
    background: #00f0ff;
    border-radius: 50%;
    left: 50%;
    transform: translateX(-50%) translateY(50%); /* Center horizontally, adjust vertical offset */
    box-shadow: 0 0 10px #00f0ff;
    transition: bottom 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Layer 5: Desktop Glassmorphism Side Panel */
.region-detail-panel {
    position: fixed;
    top: 0;
    right: -480px;
    width: 460px;
    height: 100vh;
    background: linear-gradient(135deg, rgba(0, 11, 24, 0.85) 0%, rgba(0, 5, 15, 0.95) 100%);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-left: 1px solid rgba(0, 240, 255, 0.25);
    box-shadow: -10px 0 45px rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(0, 240, 255, 0.05);
    z-index: 1000;
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    color: var(--text-light);
}

.region-detail-panel.active {
    right: 0;
}

/* Panel Header */
.panel-header-hero {
    position: relative;
    height: 220px;
    min-height: 220px;
    width: 100%;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid rgba(0, 240, 255, 0.2);
}

.panel-header-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to top, #000b18 5%, rgba(0, 11, 24, 0.4) 60%, rgba(0, 0, 0, 0.1) 100%);
}

.panel-close-btn {
    position: absolute;
    top: 25px;
    left: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 11, 24, 0.60);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.panel-close-btn:hover {
    border-color: var(--primary-cyan);
    color: var(--primary-cyan);
    box-shadow: 0 0 10px var(--primary-cyan);
    transform: scale(1.05);
}

.panel-header-content {
    position: absolute;
    bottom: 20px;
    left: 25px;
    right: 25px;
    z-index: 5;
}

.panel-badge {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--primary-cyan);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 5px;
    display: inline-block;
    text-shadow: 0 0 5px rgba(0, 240, 255, 0.5);
}

.panel-title {
    font-size: clamp(1.6rem, 2.5vw, 2.1rem);
    font-weight: 700;
    color: #fff;
    line-height: 1.1;
    margin-bottom: 4px;
}

.panel-coords {
    font-size: 0.82rem;
    color: #a0c4ff;
    font-weight: 400;
}

/* Panel scrollable content */
.panel-scrollable {
    flex-grow: 1;
    overflow-y: auto;
    padding: 25px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-cyan) rgba(0, 0, 0, 0.1);
}

.panel-scrollable::-webkit-scrollbar {
    width: 6px;
}

.panel-scrollable::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.panel-scrollable::-webkit-scrollbar-thumb {
    background: var(--primary-cyan);
    border-radius: 10px;
}

/* Panel Sections */
.panel-section {
    margin-bottom: 25px;
}

.panel-section-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--primary-cyan);
    border-left: 3px solid var(--primary-cyan);
    padding-left: 10px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.panel-text {
    font-size: 0.90rem;
    color: #c2e0ff;
    line-height: 1.6;
    font-weight: 300;
}

/* Panel Quick Stats */
.panel-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.panel-stat-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 240, 255, 0.1);
    border-radius: 12px;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.panel-stat-icon {
    font-size: 1.4rem;
    filter: drop-shadow(0 0 5px rgba(0, 240, 255, 0.3));
}

.panel-stat-info {
    display: flex;
    flex-direction: column;
}

.panel-stat-label {
    font-size: 0.70rem;
    color: #8faedb;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.panel-stat-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
}

/* Species horizontal list inside panel */
.species-scroller {
    width: 100%;
    margin-top: 10px;
}

.species-track {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 8px 4px;
    scrollbar-width: none;
}

.species-track::-webkit-scrollbar {
    display: none;
}

.panel-spec-card {
    flex: 0 0 100px;
    width: 100px;
    background: rgba(0, 20, 40, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 10px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.panel-spec-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-cyan);
    background: rgba(0, 240, 255, 0.06);
    box-shadow: 0 4px 12px rgba(0, 240, 255, 0.2);
}

.panel-spec-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 6px;
    transition: transform 0.3s ease;
}

.panel-spec-card:hover .panel-spec-img {
    transform: scale(1.08);
    border-color: var(--primary-cyan);
}

.panel-spec-name {
    font-size: 0.70rem;
    font-weight: 600;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.25;
    height: 30px;
}

/* Panel Diving Action Container */
.panel-action-wrap {
    padding: 20px 25px 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 11, 24, 0.9);
}

.panel-dive-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-cyan), var(--primary-blue));
    background-size: 200% 200%;
    color: #000;
    font-weight: 700;
    font-size: 1.05rem;
    padding: 14px;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.35);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: all 0.3s ease;
    animation: shimmer-btn 6s ease infinite;
}

.panel-dive-btn:hover {
    box-shadow: 0 0 30px var(--primary-cyan), 0 0 10px rgba(255, 255, 255, 0.5);
    transform: translateY(-2px) scale(1.01);
}

.panel-detail-btn:hover {
    background: rgba(0, 240, 255, 0.2) !important;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.4) !important;
    transform: translateY(-2px) scale(1.01);
}

/* Mobile Bottom Sheet Layout */
.mobile-bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80vh;
    background: linear-gradient(to top, rgba(0, 5, 15, 0.98) 0%, rgba(0, 11, 24, 0.95) 100%);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-top: 1.5px solid rgba(0, 240, 255, 0.3);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 240, 255, 0.12);
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: none;
    flex-direction: column;
}

/* Drag Handle */
.bottom-sheet-drag-handle {
    width: 100%;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    touch-action: none;
}

.bottom-sheet-handle-bar {
    width: 44px;
    height: 4px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 2px;
    transition: background 0.3s ease;
}

.bottom-sheet-drag-handle:active .bottom-sheet-handle-bar {
    background: var(--primary-cyan);
}

/* Mobile sheet scrollable content */
.bottom-sheet-scrollable {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0 20px 120px;
    -webkit-overflow-scrolling: touch;
}

.bottom-sheet-header-info {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
}

.bottom-sheet-title {
    font-size: clamp(1.4rem, 4vw, 1.8rem);
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.bottom-sheet-coords {
    font-size: 0.78rem;
    color: #a0c4ff;
}

.bottom-sheet-close-btn {
    position: absolute;
    top: -5px;
    right: 5px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #fff;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Media Queries for Responsive Panels */
@media (min-width: 768px) {
    .region-detail-panel {
        display: flex;
    }
    .mobile-bottom-sheet {
        display: none !important;
    }
}

@media (max-width: 767px) {
    .region-detail-panel {
        display: none !important;
    }
    .mobile-bottom-sheet {
        display: flex;
    }
    .atlas-map-viewport {
        height: calc(100vh - 70px) !important;
    }
    
    /* Performance optimizations for mobile map dragging */
    .atlas-map-canvas {
        box-shadow: none !important;
        will-change: transform;
    }
    .atlas-map {
        filter: none !important;
        animation: none !important;
    }
    .map-cloud {
        display: none !important; /* Heavy blur filter kills GPU */
    }
    .map-atmosphere-rays {
        display: none !important; /* mix-blend-mode kills GPU during drag */
    }
    .map-ocean-overlay {
        animation: none !important;
        background-blend-mode: normal !important;
        opacity: 0.05 !important;
    }
    .map-ambient-particles {
        display: none !important; /* Too many animated DOM nodes for mobile */
    }
    .map-whale, .map-boat, .map-bird {
        animation: none !important;
        transform: none !important;
        transition: none !important;
    }
}

/* Cinematic Bubble Transition Overlay */
#dive-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, #001226 0%, #000814 100%);
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#dive-transition-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.transition-bubbles-layer {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.transition-bubble {
    position: absolute;
    bottom: -50px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.65) 0%, rgba(0, 240, 255, 0.1) 70%, rgba(0, 240, 255, 0.65) 100%);
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.2), inset 0 0 8px rgba(255,255,255,0.4);
    animation: transition-bubble-rise var(--duration, 2s) linear forwards;
    will-change: transform;
}

@keyframes transition-bubble-rise {
    0% { transform: translateY(0) scale(0.6) translateX(0); opacity: 0.1; }
    15% { opacity: 0.95; }
    85% { opacity: 0.95; }
    100% { transform: translateY(-115vh) scale(1.3) translateX(var(--drift, 60px)); opacity: 0; }
}

.transition-message {
    z-index: 10;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.dive-text {
    font-size: clamp(1.5rem, 5vw, 2.2rem);
    font-weight: 700;
    color: var(--primary-cyan);
    text-shadow: 0 0 20px var(--primary-cyan), 0 0 40px var(--primary-cyan);
    letter-spacing: 4px;
    text-transform: uppercase;
    animation: transition-glow-pulsing 1.8s ease-in-out infinite alternate;
}

@keyframes transition-glow-pulsing {
    0% { opacity: 0.5; transform: scale(0.96); }
    100% { opacity: 1; transform: scale(1.02); text-shadow: 0 0 35px var(--primary-cyan), 0 0 10px #fff; }
}

.dive-loader {
    width: 240px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    box-shadow: 0 0 8px rgba(0,0,0,0.5);
}

.dive-loader-bar {
    width: 0%;
    height: 100%;
    background: var(--primary-cyan);
    box-shadow: 0 0 10px var(--primary-cyan);
    animation: dive-loader-progress 1.5s cubic-bezier(0.1, 0.6, 0.2, 1) forwards;
}

@keyframes dive-loader-progress {
    to { width: 100%; }
}
