/* Styles for Bernoulli's Principle Children's Storybook */

/* Base styles and reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4a90e2;
    --secondary-color: #f9a826;
    --background-color: #f0f9ff;
    --text-color: #333333;
    --accent-color: #ff6b6b;
    --success-color: #66bb6a;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --font-main: 'Comic Sans MS', 'Chalkboard SE', 'Comic Neue', sans-serif;
    --font-title: 'Bubblegum Sans', 'Comic Sans MS', cursive;
}

body {
    font-family: var(--font-main);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

/* Header styles */
.storybook-header {
    text-align: center;
    padding: 20px 0;
    margin-bottom: 20px;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 4px 8px var(--shadow-color);
}

.storybook-title {
    font-family: var(--font-title);
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    text-shadow: 2px 2px 0px var(--shadow-color);
}

.storybook-subtitle {
    font-size: 1.2rem;
    color: var(--secondary-color);
}

/* Main content area */
.storybook-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 4px 8px var(--shadow-color);
    overflow: hidden;
}

/* Scene container */
.scene-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    min-height: 500px;
}

/* Image container */
.image-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto 20px;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px var(--shadow-color);
}

.scene-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
}

/* Text overlay for images */
.text-overlay {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.85);
    padding: 12px 20px;
    text-align: center;
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--primary-color);
    border-radius: 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

/* Text container */
.text-container {
    width: 100%;
    max-width: 800px;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    box-shadow: 0 4px 8px var(--shadow-color);
    font-size: 1.2rem;
    line-height: 1.8;
    margin-bottom: 20px;
}

/* Navigation controls */
.navigation-controls {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 800px;
    margin: 20px auto;
}

.nav-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 24px;
    font-size: 1rem;
    font-family: var(--font-main);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 8px var(--shadow-color);
}

.nav-button:hover {
    background-color: #3a7bc8;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px var(--shadow-color);
}

.nav-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.nav-button i {
    margin: 0 8px;
}

/* Audio controls */
.audio-controls {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.audio-button {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 24px;
    font-size: 1rem;
    font-family: var(--font-main);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 8px var(--shadow-color);
}

.audio-button:hover {
    background-color: #e89921;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px var(--shadow-color);
}

.audio-button i {
    margin-right: 8px;
}

/* Progress indicator */
.progress-indicator {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.progress-dot {
    width: 12px;
    height: 12px;
    background-color: #cccccc;
    border-radius: 50%;
    margin: 0 8px;
    transition: all 0.3s ease;
}

.progress-dot.active {
    background-color: var(--primary-color);
    transform: scale(1.2);
}

/* Footer */
.storybook-footer {
    text-align: center;
    padding: 20px 0;
    margin-top: 20px;
    font-size: 0.9rem;
    color: #666666;
}

/* Responsive design */
@media (max-width: 768px) {
    .storybook-title {
        font-size: 2rem;
    }
    
    .storybook-subtitle {
        font-size: 1rem;
    }
    
    .text-container {
        font-size: 1rem;
        padding: 15px;
    }
    
    .text-overlay {
        font-size: 1.1rem;
        padding: 10px 15px;
    }
    
    .nav-button, .audio-button {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

/* Animation for page transitions */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

/* Cloud decoration elements */
.cloud-decoration {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    z-index: -1;
}

.cloud-1 {
    width: 100px;
    height: 100px;
    top: 10%;
    left: 5%;
}

.cloud-2 {
    width: 150px;
    height: 150px;
    bottom: 15%;
    right: 8%;
}

.cloud-3 {
    width: 80px;
    height: 80px;
    top: 30%;
    right: 15%;
}

/* Loading indicator */
.loading-indicator {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--primary-color);
    border-top: 5px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Audio player styling */
.audio-player {
    display: none;
}