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

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 800px;
    position: relative;
}

/* Screen transitions */
.screen {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
    position: absolute;
    width: 100%;
    display: none;
}

.screen.active {
    opacity: 1;
    transform: translateY(0);
    display: block;
    position: relative;
}

/* Welcome Screen */
.welcome-content {
    text-align: center;
}

.app-title {
    font-size: 3em;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.app-subtitle {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 40px;
}

.input-group {
    margin-bottom: 30px;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: #333;
}

.input-group input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    font-size: 1em;
    transition: all 0.3s ease;
    outline: none;
}

.input-group input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.error-message {
    color: #e74c3c;
    font-size: 0.9em;
    margin-top: 5px;
    display: block;
}

/* Buttons */
.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 50px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    min-width: 150px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #e0e0e0;
}

.btn-secondary:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

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

.btn-revision {
    background: linear-gradient(135deg, #FF6B6B, #4ECDC4);
    color: white;
}

.btn-revision:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 107, 107, 0.3);
}

/* Theme Selection */
.theme-content {
    text-align: center;
}

.theme-content h2 {
    font-size: 2em;
    margin-bottom: 10px;
    color: #333;
}

.theme-content p {
    color: #666;
    margin-bottom: 30px;
}

.themes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.theme-card {
    background: white;
    border-radius: 15px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.theme-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.theme-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.theme-card h3 {
    font-size: 1.3em;
    margin-bottom: 10px;
    color: #333;
}

.theme-card p {
    color: #666;
    font-size: 0.9em;
}

/* Difficulty Selection */
.difficulty-content {
    text-align: center;
}

.difficulty-content h2 {
    font-size: 2em;
    margin-bottom: 10px;
    color: #333;
}

.difficulty-content p {
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1em;
}

.difficulty-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.difficulty-card {
    background: white;
    border-radius: 20px;
    padding: 30px 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

.difficulty-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    transition: all 0.3s ease;
}

.difficulty-card[data-difficulty="facile"]::before {
    background: linear-gradient(135deg, #4CAF50, #8BC34A);
}

.difficulty-card[data-difficulty="moyen"]::before {
    background: linear-gradient(135deg, #FF9800, #FFC107);
}

.difficulty-card[data-difficulty="difficile"]::before {
    background: linear-gradient(135deg, #F44336, #E91E63);
}

.difficulty-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.difficulty-card:hover[data-difficulty="facile"] {
    border-color: #4CAF50;
    box-shadow: 0 20px 40px rgba(76, 175, 80, 0.2);
}

.difficulty-card:hover[data-difficulty="moyen"] {
    border-color: #FF9800;
    box-shadow: 0 20px 40px rgba(255, 152, 0, 0.2);
}

.difficulty-card:hover[data-difficulty="difficile"] {
    border-color: #F44336;
    box-shadow: 0 20px 40px rgba(244, 67, 54, 0.2);
}

.difficulty-icon {
    font-size: 3.5em;
    margin-bottom: 15px;
}

.difficulty-card h3 {
    font-size: 1.4em;
    margin-bottom: 10px;
    color: #333;
    font-weight: 600;
}

.difficulty-card p {
    color: #666;
    font-size: 1em;
    margin-bottom: 15px;
    line-height: 1.4;
}

.difficulty-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.difficulty-details span {
    font-size: 0.9em;
    color: #888;
    text-align: left;
}

/* Quiz Screen */
.quiz-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.quiz-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

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

.progress-fill {
    height: 100%;
    background: white;
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 5%;
}

.progress-text {
    font-size: 0.9em;
    white-space: nowrap;
}

.question-container {
    margin-bottom: 30px;
}

.question-container h3 {
    font-size: 1.3em;
    color: #333;
    line-height: 1.5;
}

.answers-container {
    display: grid;
    gap: 15px;
    margin-bottom: 30px;
}

.answer-option {
    padding: 20px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
}

.answer-option:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

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

.answer-letter {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.answer-option.selected .answer-letter {
    background: white;
    color: #667eea;
}

.quiz-controls {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

/* Results Screen */
.results-content {
    text-align: center;
}

.results-content h2 {
    font-size: 2em;
    margin-bottom: 30px;
    color: #333;
}

.score-container {
    margin-bottom: 30px;
}

.score-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: white;
}

.score-percentage {
    font-size: 2.5em;
    font-weight: 700;
}

.score-text {
    font-size: 0.9em;
    opacity: 0.9;
}

.performance-message {
    font-size: 1.2em;
    margin-bottom: 30px;
    padding: 20px;
    border-radius: 15px;
    font-weight: 500;
}

.performance-message.excellent {
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
    color: white;
}

.performance-message.good {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
}

.performance-message.average {
    background: linear-gradient(135deg, #ffecd2, #fcb69f);
    color: #333;
}

.performance-message.poor {
    background: linear-gradient(135deg, #ff9a9e, #fecfef);
    color: #333;
}

.results-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0;
    }
    
    .screen {
        padding: 20px;
        border-radius: 0;
        min-height: 100vh;
    }
    
    .app-title {
        font-size: 2.5em;
    }
    
    .themes-grid {
        grid-template-columns: 1fr;
    }
    
    .difficulty-grid {
        grid-template-columns: 1fr;
    }
    
    .difficulty-card {
        padding: 25px 20px;
    }
    
    .quiz-info {
        flex-direction: column;
        text-align: center;
    }
    
    .progress-container {
        flex-direction: column;
        width: 100%;
    }
    
    .progress-bar {
        width: 100%;
    }
    
    .quiz-controls {
        flex-direction: column;
    }
    
    .results-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .app-title {
        font-size: 2em;
    }
    
    .score-circle {
        width: 150px;
        height: 150px;
    }
    
    .score-percentage {
        font-size: 2em;
    }
    
    .answer-option {
        padding: 15px;
    }
    
    .theme-card {
        padding: 20px 15px;
    }
}
