/* Maya's Architectural Adventure - Storybook Styles */

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

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

.storybook-container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    box-shadow: 0 0 30px rgba(0,0,0,0.3);
    position: relative;
}

/* Header Styles */
.story-header {
    background: linear-gradient(45deg, #ff6b6b, #feca57, #48dbfb, #ff9ff3);
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
    text-align: center;
    padding: 2rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.story-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

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

/* Main Story Content */
.story-main {
    padding: 2rem;
    min-height: 600px;
}

.story-segment {
    display: none;
    animation: fadeIn 0.6s ease-in-out;
}

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

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

.story-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.illustration-container {
    text-align: center;
}

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

.story-illustration:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 35px rgba(0,0,0,0.2);
}

.text-content {
    padding: 1rem;
}

.text-content h2 {
    color: #2c3e50;
    font-size: 1.8rem;
    margin-bottom: 1rem;
    border-bottom: 3px solid #3498db;
    padding-bottom: 0.5rem;
}

.text-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #444;
    text-align: justify;
}

/* Navigation Styles */
.story-navigation {
    background: #f8f9fa;
    padding: 1.5rem 2rem;
    border-top: 3px solid #e9ecef;
    position: sticky;
    bottom: 0;
}

.nav-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

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

.nav-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

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

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

.audio-controls {
    display: flex;
    gap: 1rem;
}

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

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

.audio-btn.secondary {
    background: linear-gradient(45deg, #48dbfb, #0abde3);
    box-shadow: 0 4px 15px rgba(72, 219, 251, 0.4);
}

.audio-btn.secondary:hover {
    box-shadow: 0 6px 20px rgba(72, 219, 251, 0.6);
}

.audio-btn.playing {
    background: linear-gradient(45deg, #00d2d3, #54a0ff);
    animation: pulse 2s infinite;
}

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

/* Progress Indicator */
.progress-indicator {
    text-align: center;
}

.progress-text {
    font-size: 1rem;
    color: #666;
    margin-bottom: 0.5rem;
    display: block;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

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

/* Footer */
.story-footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 1.5rem;
    font-size: 0.9rem;
}

.story-footer p {
    margin-bottom: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .story-header h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .story-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .story-main {
        padding: 1rem;
    }
    
    .nav-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .audio-controls {
        flex-direction: column;
        width: 100%;
    }
    
    .nav-btn, .audio-btn {
        width: 100%;
        padding: 15px;
    }
    
    .text-content h2 {
        font-size: 1.5rem;
    }
    
    .text-content p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .story-header {
        padding: 1rem;
    }
    
    .story-header h1 {
        font-size: 1.8rem;
    }
    
    .story-navigation {
        padding: 1rem;
    }
    
    .text-content h2 {
        font-size: 1.3rem;
    }
}

/* Print Styles */
@media print {
    .story-navigation,
    .story-footer {
        display: none;
    }
    
    .story-segment {
        display: block !important;
        page-break-after: always;
    }
    
    .story-segment:last-child {
        page-break-after: avoid;
    }
    
    .storybook-container {
        box-shadow: none;
    }
    
    .story-header {
        background: #333 !important;
        color: white !important;
    }
}

/* Accessibility Enhancements */
.nav-btn:focus,
.audio-btn:focus {
    outline: 3px solid #ffd700;
    outline-offset: 2px;
}

/* Loading Animation */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Auto-play indicator */
.auto-play-active {
    background: linear-gradient(45deg, #00d2d3, #54a0ff) !important;
}

/* Special effects for magical elements */
.story-illustration {
    position: relative;
}

.story-illustration::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: linear-gradient(45deg, transparent, rgba(255, 215, 0, 0.3), transparent);
    border-radius: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.story-illustration:hover::before {
    opacity: 1;
}