/* Root Variables */
:root {
    --primary-color: #7B4BAF;
    --accent-color: #C6A758;
    --text-dark: #333333;
    --text-light: #666666;
    --background-light: #F9F9F9;
    --white: #FFFFFF;
    --success-color: #4CAF50;
    --error-color: #F44336;
    --border-color: #E0E0E0;
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Raleway', sans-serif;
    background: linear-gradient(135deg, #7B4BAF 0%, #5a3a8a 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-dark);
}

/* Navigation Menu */
.main-nav {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.nav-logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 20px;
}

.nav-link {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 20px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.nav-link:hover {
    background: var(--background-light);
    color: var(--primary-color);
}

.nav-link.active {
    background: var(--primary-color);
    color: var(--white);
}

body {
    padding-top: 60px;
}

.container {
    max-width: 900px;
    margin: 20px auto 0;
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #5a3a8a 100%);
    color: var(--white);
    padding: 40px;
    text-align: center;
}

header .logo {
    width: 150px;
    height: 150px;
    margin: 0 auto 20px;
    display: block;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
}

header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    margin-bottom: 10px;
}

.tagline {
    font-size: 1.2rem;
    font-weight: 300;
    letter-spacing: 2px;
}

/* Main Content */
main {
    padding: 40px;
    min-height: 500px;
}

main h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    text-align: center;
}

.intro {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 40px;
    font-size: 1.1rem;
}

/* Screen Management */
.screen {
    display: none;
    animation: fadeIn 0.5s ease;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Course Selection */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.course-option {
    background: var(--background-light);
    border: 3px solid var(--border-color);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.course-option:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(123, 75, 175, 0.2);
}

.course-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.course-option h3 {
    font-family: 'Playfair Display', serif;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.course-option p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Raleway', sans-serif;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 14px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Raleway', sans-serif;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-color) 0%, #b89748 100%);
    color: var(--white);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(198, 167, 88, 0.4);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: var(--white);
}

/* Quiz Styles */
.quiz-header {
    margin-bottom: 30px;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: var(--border-color);
    border-radius: 5px;
    margin: 20px 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    width: 0%;
    transition: width 0.5s ease;
}

.question-counter {
    text-align: center;
    color: var(--text-light);
    font-weight: 600;
}

.question-container {
    background: var(--background-light);
    padding: 40px;
    border-radius: 15px;
    margin-bottom: 30px;
}

#questionText {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 30px;
    line-height: 1.6;
}

.answers-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.answer-option {
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    font-size: 1.05rem;
}

.answer-option:hover {
    border-color: var(--primary-color);
    background: #f5f0ff;
}

.answer-option.selected {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: var(--white);
}

.answer-option.correct {
    border-color: var(--success-color);
    background: var(--success-color);
    color: var(--white);
}

.answer-option.incorrect {
    border-color: var(--error-color);
    background: var(--error-color);
    color: var(--white);
}

.answer-option.disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.answer-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: var(--primary-color);
    color: var(--white);
    font-weight: 700;
    margin-right: 15px;
    flex-shrink: 0;
}

.answer-option.selected .answer-letter,
.answer-option.correct .answer-letter,
.answer-option.incorrect .answer-letter {
    background: rgba(255, 255, 255, 0.3);
}

.quiz-navigation {
    text-align: center;
}

/* Results */
.results-container {
    text-align: center;
}

.score-display {
    margin: 40px 0;
}

.score-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: var(--white);
    font-size: 3rem;
    font-weight: 700;
    box-shadow: 0 10px 30px rgba(123, 75, 175, 0.3);
}

.level-recommendation {
    margin: 40px 0;
}

.level-recommendation h3 {
    font-family: 'Playfair Display', serif;
    color: var(--text-dark);
    margin-bottom: 20px;
}

.level-badge {
    display: inline-block;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.level-badge.beginner {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.level-badge.intermediate {
    background: linear-gradient(135deg, #FF9800, #F57C00);
    color: white;
}

.level-badge.advanced {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
}

#levelDescription {
    color: var(--text-light);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.8;
}

.feedback-section {
    background: var(--background-light);
    padding: 30px;
    border-radius: 15px;
    margin: 30px 0;
    text-align: left;
}

.feedback-item {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.feedback-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.feedback-item h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.feedback-correct {
    color: var(--success-color);
    font-weight: 600;
}

.feedback-incorrect {
    color: var(--error-color);
    font-weight: 600;
}

.results-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 40px;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    main h2 {
        font-size: 1.8rem;
    }
    
    .course-grid {
        grid-template-columns: 1fr;
    }
    
    main {
        padding: 20px;
    }
    
    .results-actions {
        flex-direction: column;
    }
    
    .results-actions button {
        width: 100%;
    }
}
