/* Arundathi's Underwater Adventure - Child-Friendly Styles */

:root {
    --ocean-surface: #87CEEB;
    --ocean-mid: #4682B4;
    --ocean-deep: #1e3a8a;
    --ocean-darkest: #0f172a;
    --coral-accent: #FF6B6B;
    --gold-treasure: #FFD700;
    --bubble-blue: #E3F2FD;
    --text-light: #ffffff;
    --text-dark: #1e293b;
    --secondary-color: #64748b;
}

/* Base Styles */
body {
    font-family: 'Nunito', sans-serif;
    overflow-x: hidden;
    overflow-y: auto;
    background: linear-gradient(180deg, #87CEEB 0%, #B0E0E6 30%, var(--ocean-surface) 70%, var(--ocean-surface) 100%);
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* Adventure Container */
.adventure-container {
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow: visible;
}

/* Shipwreck Container */
#shipwreckContainer {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Ocean Background with Parallax */
.ocean-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    transition: background 0.5s ease;
}

.ocean-sky {
    background: linear-gradient(180deg, 
        #87CEEB 0%, 
        #B0E0E6 30%, 
        var(--ocean-surface) 70%, 
        var(--ocean-surface) 100%);
}

/* Animated Sea Level Line */
.sea-level-line {
    position: fixed;
    top: 70vh;
    left: 0;
    width: 100%;
    height: 30px;
    z-index: 10;
    pointer-events: none;
}

.sea-level-line svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.sea-level-line path {
    fill: var(--ocean-surface);
    stroke: #1e90ff;
    stroke-width: 2;
    stroke-linejoin: round;
    animation: wave 4s ease-in-out infinite;
}

.sea-level-line path:nth-child(2) {
    animation-delay: -2s;
    opacity: 0.8;
    fill: rgba(30, 144, 255, 0.3);
}

.sea-level-line path:nth-child(3) {
    animation-delay: -1s;
    opacity: 0.6;
    fill: rgba(255, 255, 255, 0.2);
}

/* Foam effect */
.sea-level-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.3) 20%, 
        rgba(255, 255, 255, 0.6) 50%, 
        rgba(255, 255, 255, 0.3) 80%, 
        transparent 100%);
    animation: foam 6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes wave {
    0%, 100% {
        d: path("M0,15 Q20,8 40,15 Q60,22 80,15 Q100,8 120,15 L120,30 L0,30 Z");
    }
    25% {
        d: path("M0,15 Q20,22 40,15 Q60,8 80,15 Q100,22 120,15 L120,30 L0,30 Z");
    }
    50% {
        d: path("M0,15 Q20,8 40,15 Q60,22 80,15 Q100,8 120,15 L120,30 L0,30 Z");
    }
    75% {
        d: path("M0,15 Q20,22 40,15 Q60,8 80,15 Q100,22 120,15 L120,30 L0,30 Z");
    }
}

@keyframes foam {
    0%, 100% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(100%);
    }
}

/* Sea level line visibility based on depth */
.sea-level-line.hidden {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.sea-level-line.visible {
    opacity: 1;
    transition: opacity 0.5s ease;
}

.ocean-surface {
    background: linear-gradient(180deg, 
        var(--ocean-surface) 0%, 
        #5F9EA0 30%, 
        var(--ocean-mid) 70%, 
        var(--ocean-deep) 100%);
}

.ocean-mid {
    background: linear-gradient(180deg, 
        var(--ocean-mid) 0%, 
        #2E5A88 40%, 
        var(--ocean-deep) 80%, 
        var(--ocean-darkest) 100%);
}

.ocean-deep {
    background: linear-gradient(180deg, 
        var(--ocean-deep) 0%, 
        #1e3a8a 50%, 
        var(--ocean-darkest) 100%);
}

/* Sunlight Rays */
.sunlight-rays {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.3;
    background: 
        radial-gradient(circle at 20% 0%, rgba(255,255,255,0.4) 0%, transparent 50%),
        radial-gradient(circle at 80% 0%, rgba(255,255,255,0.3) 0%, transparent 50%);
    transition: opacity 1s ease;
}

.sunlight-rays.sky {
    opacity: 0.6;
    background: 
        radial-gradient(circle at 20% 0%, rgba(255,255,255,0.6) 0%, transparent 50%),
        radial-gradient(circle at 80% 0%, rgba(255,255,255,0.5) 0%, transparent 50%);
}

.sunlight-rays.fade {
    opacity: 0.1;
}

.sunlight-rays.hidden {
    opacity: 0;
}

/* Bioluminescent Particles */
.bioluminescent-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0;
    transition: opacity 1s ease;
}

.bioluminescent-particles.visible {
    opacity: 0.6;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #00FFFF;
    border-radius: 50%;
    animation: float 6s infinite ease-in-out;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) scale(1); opacity: 0.7; }
    50% { transform: translateY(-20px) scale(1.2); opacity: 1; }
}

/* Arundathi Character */
.arundathi {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 120px;
    z-index: 100;
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.arundathi-character {
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 120"><circle cx="60" cy="40" r="25" fill="%23FFB6C1"/><circle cx="60" cy="35" r="3" fill="%23000"/><circle cx="56" cy="32" r="1" fill="%23000"/><circle cx="64" cy="32" r="1" fill="%23000"/><path d="M55 45 Q60 50 65 45" stroke="%23000" stroke-width="2" fill="none"/><rect x="40" y="65" width="40" height="35" fill="%2300BFFF" rx="5"/><rect x="35" y="70" width="50" height="25" fill="%2300BFFF" rx="5"/><circle cx="45" cy="80" r="8" fill="%23FFB6C1"/><circle cx="75" cy="80" r="8" fill="%23FFB6C1"/><rect x="50" y="100" width="20" height="15" fill="%23000080"/><circle cx="60" cy="115" r="5" fill="%23000080"/></svg>') no-repeat center;
    background-size: contain;
    animation: swim 2s infinite ease-in-out;
}

/* Floating animation for surface */
.arundathi.floating .arundathi-character {
    animation: float 3s infinite ease-in-out;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(-8px) rotate(1deg); }
    50% { transform: translateY(-12px) rotate(0deg); }
    75% { transform: translateY(-8px) rotate(-1deg); }
}

@keyframes swim {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(-5px) rotate(2deg); }
    75% { transform: translateY(5px) rotate(-2deg); }
}

/* Depth Indicator */
.depth-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    padding: 15px 20px;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 200;
    font-weight: 600;
    color: var(--text-dark);
    backdrop-filter: blur(10px);
}

.depth-number {
    font-size: 1.5rem;
    color: var(--ocean-deep);
    font-weight: 800;
}

/* Welcome Section */
.welcome-section {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-light);
    z-index: 10;
}

.welcome-content {
    max-width: 800px;
    padding: 2rem;
}

.welcome-title {
    font-family: 'Fredoka One', cursive;
    font-size: 3.5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.welcome-message {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    line-height: 1.6;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.scroll-prompt {
    font-size: 1.1rem;
    opacity: 0.8;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* Shipwreck Icons */
.shipwreck-icon {
    position: absolute;
    width: 60px;
    height: 60px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 50;
}

.shipwreck-icon:hover {
    transform: scale(1.2);
    filter: drop-shadow(0 0 10px var(--gold-treasure));
}

.shipwreck-icon svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}

/* Shipwreck Popup */
.shipwreck-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bubble-blue);
    border-radius: 20px;
    padding: 2rem;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.shipwreck-popup.show {
    opacity: 1;
    visibility: visible;
}

.popup-header {
    text-align: center;
    margin-bottom: 1rem;
}

.popup-title {
    font-family: 'Fredoka One', cursive;
    color: var(--ocean-deep);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.popup-year {
    color: var(--coral-accent);
    font-weight: 600;
    font-size: 1.1rem;
}

.popup-description {
    color: var(--text-dark);
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.popup-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-explore {
    background: var(--coral-accent);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-explore:hover {
    background: #ff5252;
    transform: translateY(-2px);
    color: white;
}

.btn-close {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-close:hover {
    background: #5a6c7d;
    transform: translateY(-2px);
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Bubbles */
.bubbles {
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.bubble {
    position: absolute;
    bottom: -100px;
    width: 40px;
    height: 40px;
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0.1) 70%);
    border-radius: 50%;
    animation: rise 10s infinite ease-in;
}

@keyframes rise {
    0% {
        bottom: -100px;
        transform: translateX(0);
    }
    50% {
        transform: translateX(100px);
    }
    100% {
        bottom: 1080px;
        transform: translateX(-200px);
    }
}

/* Loading Animation */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #87CEEB 0%, #B0E0E6 30%, var(--ocean-surface) 70%, var(--ocean-surface) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

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

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid var(--coral-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .welcome-title {
        font-size: 2.5rem;
    }
    
    .welcome-message {
        font-size: 1.1rem;
    }
    
    .arundathi {
        width: 80px;
        height: 80px;
    }
    
    .depth-indicator {
        top: 10px;
        right: 10px;
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .depth-number {
        font-size: 1.2rem;
    }
    
    .shipwreck-icon {
        width: 50px;
        height: 50px;
    }
    
    .shipwreck-popup {
        max-width: 90%;
        margin: 1rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .shipwreck-icon {
        filter: contrast(1.5);
    }
    
    .depth-indicator {
        background: rgba(0, 0, 0, 0.9);
        color: white;
    }
} 