:root {
    --primary: #1e3a8a;
    --primary-dark: #1e293b;
    --accent: #d4af37;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #0f172a;
    --text-light: #64748b;
    --success: #10b981;
    --error: #ef4444;
    --border: #e2e8f0;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 20px;
}

.app-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

header {
    margin-bottom: 30px;
    text-align: center;
}

h1 {
    color: var(--primary);
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.progress-container {
    width: 100%;
    height: 10px;
    background: var(--border);
    border-radius: 5px;
    margin-bottom: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.3s ease;
}

.stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 600;
}

.card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.question {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 25px;
    color: var(--primary-dark);
}

.options-grid {
    display: grid;
    gap: 15px;
}

.option-btn {
    padding: 15px 20px;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    text-align: right;
    transition: all 0.2s ease;
    display: block;
    width: 100%;
}

.option-btn:hover:not(:disabled) {
    border-color: var(--primary);
    background: rgba(30, 58, 138, 0.05);
}

.option-btn.selected {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.option-btn.correct {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.option-btn.wrong {
    background: var(--error);
    color: white;
    border-color: var(--error);
}

.feedback {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

#feedback-message {
    font-weight: 700;
    margin-bottom: 10px;
}

.explanation {
    background: #f1f5f9;
    padding: 15px;
    border-right: 4px solid var(--accent);
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.primary-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.2s, background 0.2s;
}

.primary-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.secondary-btn {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 10px 25px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.hidden {
    display: none !important;
}

.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 30px auto;
}

#final-score {
    font-size: 3rem;
    font-weight: 800;
}

#email-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

#user-email {
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
}

#user-email:focus {
    outline: none;
    border-color: var(--primary);
}

footer {
    text-align: center;
    margin-top: 40px;
    color: var(--text-light);
    font-size: 0.85rem;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary-dark);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@media (max-width: 600px) {
    .card {
        padding: 20px;
    }
    h1 {
        font-size: 1.4rem;
    }
}
