/* CSS Variables for Theme Switching */
:root {
    --primary-color: #4a6fa5;
    --secondary-color: #6b8cbc;
    --accent-color: #ff7e5f;
    --text-color: #333;
    --bg-color: #f5f7fa;
    --card-bg: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --primary-color: #6b8cbc;
    --secondary-color: #4a6fa5;
    --accent-color: #ff9e7d;
    --text-color: #f0f0f0;
    --bg-color: #1a1a2e;
    --card-bg: #16213e;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: var(--transition);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 800px;
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    justify-content: flex-end;
    padding: 15px 20px;
}

.theme-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
}

.theme-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

/* Header */
.header {
    text-align: center;
    padding: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.header p {
    opacity: 0.8;
}

/* Screens */
.screen {
    display: none;
    padding: 30px;
    animation: fadeIn 0.5s ease;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Quiz Selection */
.quiz-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.quiz-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.05);
    text-align: center;
}

.quiz-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.quiz-card h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.quiz-card p {
    margin-bottom: 20px;
    opacity: 0.8;
}

.select-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    width: 100%;
}

.select-btn:hover {
    background: var(--secondary-color);
}

/* Quiz Screen */
.quiz-header {
    margin-bottom: 30px;
}

.quiz-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-weight: 600;
}

#quiz-title {
    color: var(--primary-color);
}

.progress-container {
    margin-top: 10px;
}

.progress-bar {
    height: 8px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background-color: var(--accent-color);
    width: 0%;
    transition: width 0.5s ease;
}

.question-container {
    margin-bottom: 30px;
}

#question-text {
    font-size: 1.5rem;
    margin-bottom: 25px;
    line-height: 1.4;
}

.options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.option {
    background: var(--card-bg);
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    padding: 15px 20px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
}

.option:hover {
    border-color: var(--primary-color);
    transform: translateX(5px);
}

.option.selected {
    border-color: var(--accent-color);
    background-color: rgba(255, 126, 95, 0.1);
}

.option-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    margin-right: 15px;
    font-weight: bold;
}

.navigation {
    display: flex;
    justify-content: space-between;
}

.nav-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.nav-btn:hover:not(:disabled) {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.nav-btn:disabled {
    background: rgba(0, 0, 0, 0.2);
    cursor: not-allowed;
}

/* Results Screen */
.results-container {
    text-align: center;
}

.score-card {
    margin: 30px 0;
}

.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: conic-gradient(var(--accent-color) 0% 80%, rgba(0, 0, 0, 0.1) 80% 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    position: relative;
}

.score-circle::before {
    content: '';
    position: absolute;
    width: 120px;
    height: 120px;
    background: var(--card-bg);
    border-radius: 50%;
}

#score-percentage {
    position: relative;
    z-index: 1;
    font-size: 2rem;
    font-weight: bold;
    color: var(--accent-color);
}

.performance-feedback {
    margin: 30px 0;
}

#performance-text {
    color: var(--accent-color);
    margin-bottom: 10px;
}

.results-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.action-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.action-btn.secondary {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.action-btn.secondary:hover {
    background: var(--primary-color);
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        border-radius: 10px;
    }
    
    .screen {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .quiz-cards {
        grid-template-columns: 1fr;
    }
    
    #question-text {
        font-size: 1.3rem;
    }
    
    .navigation {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-btn {
        width: 100%;
    }
    
    .results-actions {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .header {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .quiz-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .score-circle {
        width: 120px;
        height: 120px;
    }
    
    .score-circle::before {
        width: 90px;
        height: 90px;
    }
    
    #score-percentage {
        font-size: 1.5rem;
    }
}