/* Splash's Ocean Adventure - 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%, #1E90FF 100%);
    min-height: 100vh;
    color: #2C3E50;
    overflow-x: hidden;
}

.storybook-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.story-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);
}

.story-header h1 {
    font-size: 2.5rem;
    color: #1E90FF;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
    animation: wave 2s ease-in-out infinite;
}

@keyframes wave {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

.subtitle {
    font-size: 1.2rem;
    color: #4682B4;
    font-weight: bold;
}

/* Main Story Area */
.story-main {
    flex: 1;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    margin-bottom: 20px;
}

.story-page {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    min-height: 500px;
    animation: fadeIn 0.5s ease-in-out;
}

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

.image-container {
    flex: 1;
    max-width: 500px;
}

.story-image {
    width: 100%;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.story-image:hover {
    transform: scale(1.02);
}

.text-container {
    flex: 1;
    padding-left: 20px;
}

.text-container h2 {
    font-size: 2rem;
    color: #1E90FF;
    margin-bottom: 20px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.text-container p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 15px;
    color: #2C3E50;
    text-align: justify;
}

/* Controls */
.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
}

.nav-btn, .audio-btn {
    padding: 12px 24px;
    font-size: 1.1rem;
    font-weight: bold;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.nav-btn {
    background: linear-gradient(45deg, #4682B4, #1E90FF);
    color: white;
    box-shadow: 0 4px 15px rgba(70, 130, 180, 0.3);
}

.nav-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(70, 130, 180, 0.4);
}

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

.audio-controls {
    display: flex;
    gap: 15px;
}

.audio-btn {
    background: linear-gradient(45deg, #FF6B6B, #FF8E53);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

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

.audio-btn.active {
    background: linear-gradient(45deg, #2ECC71, #27AE60);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3); }
    50% { box-shadow: 0 6px 25px rgba(46, 204, 113, 0.6); }
    100% { box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3); }
}

/* Page Indicator */
.page-indicator {
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

#page-info {
    font-size: 1.1rem;
    font-weight: bold;
    color: #4682B4;
}

/* Responsive Design */
@media (max-width: 768px) {
    .storybook-container {
        padding: 15px;
    }
    
    .story-header h1 {
        font-size: 2rem;
    }
    
    .story-page {
        flex-direction: column;
        gap: 20px;
    }
    
    .text-container {
        padding-left: 0;
    }
    
    .text-container h2 {
        font-size: 1.5rem;
    }
    
    .text-container p {
        font-size: 1rem;
    }
    
    .controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .audio-controls {
        order: -1;
    }
    
    .nav-btn, .audio-btn {
        padding: 10px 20px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .story-header h1 {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .story-main {
        padding: 20px;
    }
    
    .text-container h2 {
        font-size: 1.3rem;
    }
    
    .text-container p {
        font-size: 0.9rem;
    }
}

/* 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); }
}

/* Ocean Wave Animation */
.story-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 120" preserveAspectRatio="none"><path d="M0,0V46.29c47.79,22.2,103.59,32.17,158,28,70.36-5.37,136.33-33.31,206.8-37.5C438.64,32.43,512.34,53.67,583,72.05c69.27,18,138.3,24.88,209.4,13.08,36.15-6,69.85-17.84,104.45-29.34C989.49,25,1113-14.29,1200,52.47V0Z" opacity=".25" fill="%234682B4"></path><path d="M0,0V15.81C13,36.92,27.64,56.86,47.69,72.05,99.41,111.27,165,111,224.58,91.58c31.15-10.15,60.09-26.07,89.67-39.8,40.92-19,84.73-46,130.83-49.67,36.26-2.85,70.9,9.42,98.6,31.56,31.77,25.39,62.32,62,103.63,73,40.44,10.79,81.35-6.69,119.13-24.28s75.16-39,116.92-43.05c59.73-5.85,113.28,22.88,168.9,38.84,30.2,8.66,59,6.17,87.09-7.5,22.43-10.89,48-26.93,60.65-49.24V0Z" opacity=".5" fill="%234682B4"></path><path d="M0,0V5.63C149.93,59,314.09,71.32,475.83,42.57c43-7.64,84.23-20.12,127.61-26.46,59-8.63,112.48,12.24,165.56,35.4C827.93,77.22,886,95.24,951.2,90c86.53-7,172.46-45.71,248.8-84.81V0Z" fill="%234682B4"></path></svg>') repeat-x;
    background-size: 1200px 120px;
    animation: wave-animation 10s linear infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes wave-animation {
    0% { transform: translateX(0); }
    100% { transform: translateX(-1200px); }
}