/* Основные стили для детской книжки */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Comic Sans MS', cursive, sans-serif;
    background: linear-gradient(135deg, #87CEEB 0%, #98FB98 50%, #FFE4B5 100%);
    min-height: 100vh;
    color: #2C3E50;
    line-height: 1.6;
}

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

/* Заголовок */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(45deg, #FF6B6B, #4ECDC4);
    border-radius: 15px;
    color: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

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

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Страницы истории */
.story-content {
    position: relative;
    min-height: 600px;
}

.story-page {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

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

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

/* Иллюстрации */
.illustration-container {
    text-align: center;
    margin-bottom: 20px;
}

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

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

/* Текст истории */
.text-container {
    margin-bottom: 20px;
}

.text-container h2 {
    font-size: 1.8rem;
    color: #E74C3C;
    margin-bottom: 15px;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.story-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #2C3E50;
    text-align: justify;
    padding: 0 10px;
    background: #F8F9FA;
    border-radius: 10px;
    padding: 20px;
    border-left: 5px solid #3498DB;
}

/* Аудио контролы */
.audio-controls {
    text-align: center;
    margin-top: 20px;
}

.audio-btn {
    background: linear-gradient(45deg, #FF6B6B, #FF8E53);
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 1.1rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    font-family: inherit;
}

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

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

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

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Навигация */
.navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 30px 0;
    padding: 20px;
    background: linear-gradient(45deg, #3498DB, #2980B9);
    border-radius: 15px;
    color: white;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 12px 20px;
    font-size: 1rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.page-indicator {
    font-size: 1.2rem;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

/* Контролы */
.controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.control-btn {
    background: linear-gradient(45deg, #9B59B6, #8E44AD);
    color: white;
    border: none;
    padding: 12px 20px;
    font-size: 1rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.3);
    font-family: inherit;
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(155, 89, 182, 0.4);
}

.control-btn.active {
    background: linear-gradient(45deg, #27AE60, #2ECC71);
}

/* Подвал */
.footer {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    background: linear-gradient(45deg, #34495E, #2C3E50);
    color: white;
    border-radius: 15px;
    font-size: 1rem;
}

/* Адаптивность */
@media (max-width: 768px) {
    .storybook-container {
        margin: 10px;
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .story-illustration {
        max-height: 300px;
    }
    
    .story-text {
        font-size: 1rem;
        padding: 15px;
    }
    
    .navigation {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-btn {
        width: 100%;
        max-width: 200px;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .control-btn {
        width: 100%;
        max-width: 250px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .story-text {
        font-size: 0.95rem;
    }
    
    .text-container h2 {
        font-size: 1.5rem;
    }
}

/* Специальные эффекты */
.story-page {
    position: relative;
    overflow: hidden;
}

.story-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: shimmer 3s infinite;
    pointer-events: none;
}

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

/* Загрузка изображений */
.story-illustration {
    background: linear-gradient(45deg, #f0f0f0, #e0e0e0);
    background-size: 20px 20px;
    background-image: 
        linear-gradient(45deg, transparent 25%, rgba(255,255,255,.2) 25%, rgba(255,255,255,.2) 50%, transparent 50%, transparent 75%, rgba(255,255,255,.2) 75%);
}

/* Анимация для кнопок */
.nav-btn, .audio-btn, .control-btn {
    position: relative;
    overflow: hidden;
}

.nav-btn::after, .audio-btn::after, .control-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.nav-btn:active::after, .audio-btn:active::after, .control-btn:active::after {
    width: 300px;
    height: 300px;
}