/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

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

/* Header styles */
header {
    text-align: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.title {
    font-family: 'Fredoka One', cursive;
    font-size: 3.5rem;
    color: #ff6b6b;
    text-shadow: 3px 3px 0px #4ecdc4;
    margin-bottom: 10px;
    animation: bounce 2s infinite;
}

.subtitle {
    font-size: 1.3rem;
    color: #6c5ce7;
    font-weight: 700;
}

/* Navigation styles */
.nav-links {
    text-align: center;
    margin-bottom: 30px;
}

.nav-links a {
    display: inline-block;
    background: rgba(255, 255, 255, 0.9);
    color: #6c5ce7;
    text-decoration: none;
    padding: 12px 25px;
    margin: 0 10px;
    border-radius: 25px;
    font-weight: 700;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.nav-links a:hover {
    background: #6c5ce7;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 92, 231, 0.3);
}

.nav-links a.active {
    background: #ff6b6b;
    color: white;
    border-color: #ff6b6b;
}

/* Main content */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.instructions {
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.instructions p {
    margin-bottom: 10px;
}

.instructions p:last-child {
    margin-bottom: 0;
    font-size: 1rem;
    color: #666;
}

/* Input section */
.input-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

#wordInput {
    width: 100%;
    padding: 15px;
    border: 3px solid #4ecdc4;
    border-radius: 15px;
    font-size: 1.1rem;
    font-family: 'Comic Neue', cursive;
    resize: vertical;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

#wordInput:focus {
    outline: none;
    border-color: #ff6b6b;
    box-shadow: 0 0 15px rgba(255, 107, 107, 0.3);
    background: white;
}

.button-group {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    padding: 15px 25px;
    border: none;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Comic Neue', cursive;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.surprise-btn {
    background: linear-gradient(45deg, #ff9a9e, #fecfef);
    color: #333;
}

.surprise-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 154, 158, 0.4);
}

.story-btn {
    background: linear-gradient(45deg, #a8edea, #fed6e3);
    color: #333;
}

.story-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(168, 237, 234, 0.4);
}

.new-story-btn {
    background: linear-gradient(45deg, #ffecd2, #fcb69f);
    color: #333;
    margin-top: 20px;
}

.new-story-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(252, 182, 159, 0.4);
}



/* Loading animation */
.loading {
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #ff6b6b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Story result */
.story-result {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.story-result h2 {
    color: #ff6b6b;
    font-family: 'Fredoka One', cursive;
    font-size: 2rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 0px #4ecdc4;
}

.story-text {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 25px;
    border-radius: 15px;
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.8;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Story content layout */
.story-content {
    text-align: left;
}

.story-text-content {
    margin-bottom: 20px;
    line-height: 1.8;
    font-size: 1.3rem;
    font-weight: 700;
}

.story-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 15px;
}

/* Error message */
.error {
    background: rgba(255, 107, 107, 0.1);
    border: 2px solid #ff6b6b;
    color: #d63031;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    font-weight: 700;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    font-weight: 700;
    color: #6c5ce7;
}

/* Utility classes */
.hidden {
    display: none;
}

/* Animations */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .title {
        font-size: 2.5rem;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .story-text {
        font-size: 1.1rem;
    }
    
    .story-text-content {
        font-size: 1.1rem;
    }
    
    .story-controls {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1.1rem;
    }
    
    .instructions {
        font-size: 1rem;
    }
} 

/* Story Actions */
.story-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

/* TTS Button */
.tts-btn {
    background: linear-gradient(45deg, #6c5ce7, #a29bfe);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 25px;
    font-family: 'Comic Neue', cursive;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
}

.tts-btn:hover {
    background: linear-gradient(45deg, #a29bfe, #6c5ce7);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(108, 92, 231, 0.4);
}

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

/* TTS Loading */
.tts-loading {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    margin: 20px 0;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border: 3px solid #6c5ce7;
}

.tts-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #6c5ce7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Responsive design for TTS */
@media (max-width: 768px) {
    .story-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .tts-btn {
        font-size: 1rem;
        padding: 12px 20px;
    }
}

/* Audio Controls Styling */
.audio-controls {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 2px solid #6c5ce7;
}

.audio-controls h4 {
    color: #6c5ce7;
    font-family: 'Fredoka One', cursive;
    font-size: 1.2rem;
    margin-bottom: 15px;
    text-align: center;
}

.audio-controls audio {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    display: block;
}

.audio-controls .audio-info {
    text-align: center;
    margin-top: 15px;
    color: #666;
    font-size: 0.9rem;
}

/* Responsive audio controls */
@media (max-width: 768px) {
    .audio-controls {
        padding: 15px;
    }
    
    .audio-controls h4 {
        font-size: 1.1rem;
    }
} 