/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: white;
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    margin-top: 20px;
    margin-bottom: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Screen Management */
.screen {
    display: none;
    width: 100%;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    animation: slideIn 0.5s ease-out;
}

.screen.active {
    display: block;
}

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

/* Welcome Screen */
.welcome-content {
    padding: 60px 40px;
    text-align: center;
}

.title {
    font-size: 3rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    font-size: 1.5rem;
    color: #764ba2;
    margin-bottom: 30px;
    font-weight: 600;
}

.description {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 30px;
    line-height: 1.6;
}

.level-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 30px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.level-item {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    padding: 20px;
    border-radius: 15px;
    color: white;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.level-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(245, 87, 108, 0.4);
}

.level-item:active {
    transform: translateY(-2px);
}

.level-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.level-name {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 8px;
}

.level-questions {
    font-size: 0.8rem;
    opacity: 0.9;
    font-weight: 400;
}

.level-image {
    display: block;
    margin-bottom: 8px;
}

.level-desc {
    display: block;
    font-size: 0.95rem;
    color: #f8e9ff;
    margin-bottom: 8px;
    font-style: italic;
    line-height: 1.3;
}

/* Buttons */
.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    box-shadow: 0 10px 20px rgba(245, 87, 108, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(245, 87, 108, 0.4);
}

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

/* Quiz Screen */
.quiz-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 40px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.home-btn {
    padding: 8px 16px;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    transition: all 0.3s ease;
}

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

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.level-indicator {
    font-size: 1.2rem;
}

.question-counter {
    font-size: 1rem;
    opacity: 0.9;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f093fb 0%, #f5576c 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.score-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.score, .streak {
    font-size: 1.1rem;
}

.question-container {
    padding: 40px;
}

.category-badge {
    display: inline-block;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.question-text {
    font-size: 1.4rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 30px;
    line-height: 1.5;
}

.options-container {
    display: grid;
    gap: 15px;
}

.option-btn {
    display: flex;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.option-btn:hover {
    background: #e9ecef;
    border-color: #667eea;
    transform: translateX(5px);
}

.option-btn.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.option-btn.correct {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
    color: white;
    border-color: #56ab2f;
}

.option-btn.incorrect {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
    color: white;
    border-color: #ff416c;
}

.option-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    font-weight: 700;
    margin-right: 15px;
    flex-shrink: 0;
}

.option-text {
    font-size: 1rem;
    line-height: 1.4;
}

.quiz-footer {
    padding: 20px 40px;
    text-align: right;
    border-top: 1px solid #e9ecef;
}

/* Level Complete Screen */
.level-complete-content {
    padding: 60px 40px;
    text-align: center;
}

.celebration h1 {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 20px;
}

.level-badge {
    display: inline-block;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 40px;
}

.level-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    border: 2px solid #e9ecef;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 10px;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
}

.level-feedback {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 40px;
}

.level-feedback p {
    font-size: 1.1rem;
    font-weight: 500;
}

.level-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Game Complete Screen */
.game-complete-content {
    padding: 60px 40px;
    text-align: center;
}

.final-celebration h1 {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 10px;
}

.final-celebration h2 {
    font-size: 1.5rem;
    color: #764ba2;
    margin-bottom: 40px;
}

.final-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.final-stat {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 30px;
    border-radius: 20px;
}

.final-stat-label {
    display: block;
    font-size: 1rem;
    margin-bottom: 10px;
    opacity: 0.9;
}

.final-stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
}

.achievement-badge {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #333;
    padding: 20px 40px;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 40px;
    font-size: 1.2rem;
    font-weight: 700;
}

.achievement-icon {
    font-size: 2rem;
}

.final-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Feedback Overlay */
.feedback-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.feedback-overlay.show {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.feedback-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.feedback-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.feedback-title {
    font-size: 1.5rem;
    color: #667eea;
    margin-bottom: 10px;
}

.feedback-message {
    color: #666;
    margin-bottom: 20px;
}

.feedback-stats {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    color: #667eea;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .welcome-content,
    .question-container,
    .level-complete-content,
    .game-complete-content {
        padding: 30px 20px;
    }
    
    .quiz-header {
        padding: 20px;
    }
    
    .header-top {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .home-btn {
        align-self: flex-start;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1.2rem;
    }
    
    .question-text {
        font-size: 1.2rem;
    }
    
    .level-info {
        grid-template-columns: 1fr;
    }
    
    .level-stats,
    .final-stats {
        grid-template-columns: 1fr;
    }
    
    .level-actions,
    .final-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .progress-info {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .score-info {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.8rem;
    }
    
    .question-text {
        font-size: 1.1rem;
    }
    
    .option-btn {
        padding: 15px;
    }
    
    .option-letter {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
}

.motivation-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}
.motivation-popup.show {
    display: flex;
}
.motivation-content {
    background: white;
    border-radius: 20px;
    padding: 40px 30px 30px 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.25);
    max-width: 350px;
    margin: auto;
}
.motivation-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}
#motivation-title {
    color: #764ba2;
    font-size: 1.3rem;
    margin-bottom: 10px;
}
#motivation-message {
    color: #333;
    font-size: 1.05rem;
    margin-bottom: 20px;
}
#motivation-close-btn {
    margin-top: 10px;
}

.success-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}
.success-popup.show {
    display: flex;
}
.success-content {
    background: white;
    border-radius: 20px;
    padding: 40px 30px 30px 30px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    max-width: 350px;
    margin: auto;
    animation: scaleIn 0.3s;
}
.success-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}
#success-title {
    color: #f5576c;
    font-size: 1.3rem;
    margin-bottom: 10px;
}
#success-message {
    color: #333;
    font-size: 1.05rem;
    margin-bottom: 20px;
}
#success-close-btn {
    margin-top: 10px;
}

/* Theme Selector */
.theme-selector {
    margin-top: 40px;
    text-align: center;
}

.theme-selector h4 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.theme-options {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.theme-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
}

.theme-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.theme-btn.active {
    border-color: #667eea;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.theme-preview {
    width: 40px;
    height: 20px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.theme-name {
    font-size: 0.8rem;
    color: #666;
    font-weight: 500;
}

/* Theme Previews */
.default-theme {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.ocean-theme {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.sunset-theme {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.forest-theme {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* Ocean Theme */
body.ocean-theme .container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

body.ocean-theme .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

body.ocean-theme .quiz-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Sunset Theme */
body.sunset-theme .container {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

body.sunset-theme .btn-primary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

body.sunset-theme .quiz-header {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* Forest Theme */
body.forest-theme .container {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

body.forest-theme .btn-primary {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

body.forest-theme .quiz-header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
} 