/* Delphi's Ocean Adventure - Interactive Storybook Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Comic Sans MS', cursive, sans-serif;
    background: linear-gradient(135deg, #87CEEB 0%, #4682B4 50%, #191970 100%);
    min-height: 100vh;
    color: #2c3e50;
    overflow-x: hidden;
}

/* Animated ocean background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 219, 226, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(30, 144, 255, 0.2) 0%, transparent 50%);
    animation: oceanWaves 8s ease-in-out infinite;
    z-index: -1;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.header h1 {
    font-size: 2.5rem;
    color: #1e3a8a;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
}

.header p {
    font-size: 1.2rem;
    color: #3b82f6;
    font-weight: bold;
}

/* Story container */
.story-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 25px;
    padding: 30px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Story segment */
.story-segment {
    display: none;
    animation: fadeIn 0.8s ease-in-out;
}

.story-segment.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Illustration */
.illustration {
    width: 100%;
    max-width: 600px;
    height: auto;
    border-radius: 20px;
    margin: 0 auto 25px;
    display: block;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 4px solid #fff;
    transition: transform 0.3s ease;
}

.illustration:hover {
    transform: scale(1.02);
}

/* Story text */
.story-text {
    font-size: 1.3rem;
    line-height: 1.8;
    color: #2c3e50;
    text-align: center;
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(240, 248, 255, 0.8);
    border-radius: 15px;
    border-left: 5px solid #3b82f6;
}

/* Audio controls */
.audio-controls {
    text-align: center;
    margin: 25px 0;
}

.audio-btn {
    background: linear-gradient(45deg, #ff6b6b, #ffa500);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
    margin: 0 10px;
}

.audio-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
}

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

.audio-btn.playing {
    background: linear-gradient(45deg, #4ecdc4, #44a08d);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 5px 15px rgba(78, 205, 196, 0.3); }
    50% { box-shadow: 0 8px 25px rgba(78, 205, 196, 0.6); }
    100% { box-shadow: 0 5px 15px rgba(78, 205, 196, 0.3); }
}

/* Navigation */
.navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding: 20px 0;
}

.nav-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
    min-width: 120px;
}

.nav-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.nav-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

/* Page indicator */
.page-indicator {
    text-align: center;
    font-size: 1.1rem;
    font-weight: bold;
    color: #3b82f6;
    background: rgba(255, 255, 255, 0.8);
    padding: 10px 20px;
    border-radius: 20px;
    display: inline-block;
}

/* Progress bar */
.progress-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    margin: 20px 0;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b, #ffa500, #4ecdc4);
    border-radius: 4px;
    transition: width 0.5s ease;
    width: 16.67%; /* Start at segment 1 */
}

/* Auto-advance toggle */
.auto-advance {
    text-align: center;
    margin: 20px 0;
}

.auto-advance label {
    font-size: 1rem;
    color: #3b82f6;
    font-weight: bold;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.auto-advance input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .story-container {
        padding: 20px;
    }
    
    .story-text {
        font-size: 1.1rem;
        padding: 15px;
    }
    
    .navigation {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-btn {
        width: 100%;
        max-width: 200px;
    }
    
    .audio-btn {
        padding: 12px 25px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.8rem;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .story-text {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    .audio-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
        margin: 5px;
    }
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Floating sea creatures animation */
.sea-creature {
    position: fixed;
    font-size: 2rem;
    opacity: 0.6;
    animation: float 15s infinite linear;
    z-index: 0;
    pointer-events: none;
}

.sea-creature:nth-child(1) { animation-delay: 0s; top: 20%; }
.sea-creature:nth-child(2) { animation-delay: 5s; top: 60%; }
.sea-creature:nth-child(3) { animation-delay: 10s; top: 40%; }

@keyframes float {
    from { transform: translateX(-100px); }
    to { transform: translateX(calc(100vw + 100px)); }
}