/* Luna's Magical Adventure - Storybook Styles */

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

body {
    font-family: 'Comic Sans MS', cursive, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

.storybook-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
    margin-bottom: 20px;
}

/* Header Styles */
.story-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(45deg, #ff9a9e 0%, #fecfef 50%, #fecfef 100%);
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

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

.subtitle {
    font-size: 1.2rem;
    color: #8b5cf6;
    font-style: italic;
}

/* Story Content */
.story-content {
    position: relative;
    min-height: 600px;
    margin-bottom: 30px;
}

.story-page {
    display: none;
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.5s ease-in-out;
    padding: 20px;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.story-page.active {
    display: block;
    opacity: 1;
    transform: translateX(0);
}

.illustration-container {
    position: relative;
    text-align: center;
    margin-bottom: 25px;
}

.story-illustration {
    width: 100%;
    max-width: 600px;
    height: 400px;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

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

.image-overlay {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(107, 70, 193, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 1.1rem;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.story-text {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
}

.story-text h2 {
    font-size: 2rem;
    color: #6b46c1;
    margin-bottom: 20px;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.story-text p {
    font-size: 1.3rem;
    color: #4a5568;
    margin-bottom: 15px;
    text-align: justify;
    text-indent: 2em;
}

.story-end {
    margin-top: 30px;
    padding: 20px;
    background: linear-gradient(45deg, #ffecd2 0%, #fcb69f 100%);
    border-radius: 15px;
    text-align: center;
}

.story-end h3 {
    font-size: 1.8rem;
    color: #d69e2e;
    margin-bottom: 15px;
}

.story-end p {
    font-size: 1.1rem;
    color: #744210;
    text-indent: 0;
    font-style: italic;
}

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

.nav-btn {
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.nav-btn:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.page-indicator {
    background: #f7fafc;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 1.1rem;
    font-weight: bold;
    color: #4a5568;
    border: 2px solid #e2e8f0;
}

/* Audio Controls */
.audio-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.audio-btn {
    background: linear-gradient(45deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

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

.audio-btn.playing {
    background: linear-gradient(45deg, #ed8936 0%, #dd6b20 100%);
}

/* Progress Bar */
.progress-container {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 16.67%; /* Start at page 1 of 6 */
}

/* Responsive Design */
@media (max-width: 768px) {
    .storybook-container {
        margin: 10px;
        padding: 15px;
    }
    
    .story-header h1 {
        font-size: 2rem;
    }
    
    .story-illustration {
        height: 300px;
    }
    
    .story-text h2 {
        font-size: 1.6rem;
    }
    
    .story-text p {
        font-size: 1.1rem;
        text-align: left;
    }
    
    .navigation-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-btn {
        width: 100%;
        max-width: 200px;
    }
    
    .audio-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .audio-btn {
        width: 100%;
        max-width: 250px;
    }
}

@media (max-width: 480px) {
    .story-header h1 {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .story-illustration {
        height: 250px;
    }
    
    .story-text h2 {
        font-size: 1.4rem;
    }
    
    .story-text p {
        font-size: 1rem;
    }
}

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

.story-page.active {
    animation: fadeInUp 0.6s ease-out;
}

/* Magical sparkle effect */
@keyframes sparkle {
    0%, 100% { opacity: 0; transform: scale(0); }
    50% { opacity: 1; transform: scale(1); }
}

.story-header::before {
    content: '✨';
    position: absolute;
    top: 10px;
    left: 20px;
    font-size: 2rem;
    animation: sparkle 2s infinite;
}

.story-header::after {
    content: '🌟';
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 2rem;
    animation: sparkle 2s infinite 1s;
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    .storybook-container {
        box-shadow: none;
        background: white;
    }
    
    .navigation-controls,
    .audio-controls,
    .progress-container {
        display: none;
    }
    
    .story-page {
        display: block !important;
        opacity: 1 !important;
        transform: none !important;
        page-break-after: always;
    }
    
    .story-page:last-child {
        page-break-after: avoid;
    }
}