/* Global Styles for Quiz Platform */

:root {
    --primary: #667eea;
    --primary-dark: #764ba2;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --light: #f8f9fa;
    --dark: #2c3e50;
    --border-radius: 12px;
    --shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7ff 0%, #f0e6ff 100%);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
}

/* Header Navigation */
header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

header h1 {
    margin-bottom: 5px;
}

/* Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Quiz Container */
.quiz-container {
    background: white;
    border-radius: var(--border-radius);
    padding: 40px;
    margin: 40px auto;
    box-shadow: var(--shadow-lg);
    max-width: 900px;
    animation: slideUp 0.5s ease;
}

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

/* Quiz Header */
.quiz-header-top {
    text-align: center;
    margin-bottom: 40px;
}

.quiz-header-top h1 {
    font-size: 32px;
    color: var(--primary-dark);
    margin-bottom: 10px;
}

.quiz-info {
    color: #666;
    font-size: 16px;
    margin-bottom: 30px;
}

/* Question Styles */
.question-wrapper {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 25px;
    border-radius: var(--border-radius);
    margin-bottom: 25px;
    border-left: 5px solid var(--primary);
    transition: all 0.3s ease;
}

.question-wrapper:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow);
}

.question-number {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.question-text {
    font-size: 17px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Code in questions */
code {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 10px 0;
    font-size: 13px;
    line-height: 1.4;
}

pre code {
    background: none;
    padding: 0;
}

/* Options */
.options-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 20px 0;
}

.option-item {
    background: white;
    padding: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
}

.option-item:hover {
    border-color: var(--primary);
    background: #f8f9ff;
    transform: translateX(8px);
}

.option-item.selected {
    border-color: var(--primary);
    background: linear-gradient(135deg, #e7eaff 0%, #f0e6ff 100%);
    font-weight: 600;
}

.option-item.correct {
    border-color: var(--success);
    background: #d4edda;
    color: #155724;
}

.option-item.incorrect {
    border-color: var(--danger);
    background: #f8d7da;
    color: #721c24;
}

.option-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.option-item.selected .option-letter {
    background: var(--primary);
}

.option-item.correct .option-letter {
    background: var(--success);
}

.option-item.incorrect .option-letter {
    background: var(--danger);
}

/* Explanation */
.explanation {
    background: linear-gradient(135deg, #fff9e6 0%, #fffbf0 100%);
    border-left: 4px solid var(--warning);
    padding: 15px;
    margin-top: 15px;
    border-radius: 6px;
    display: none;
    font-size: 15px;
    line-height: 1.6;
}

.explanation.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.explanation strong {
    color: #d39e00;
    display: block;
    margin-bottom: 8px;
}

/* Buttons */
.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 40px 0;
    flex-wrap: wrap;
}

button {
    padding: 14px 32px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

button:active:not(:disabled) {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    filter: brightness(1.1);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
}

/* Score Display */
.score-display {
    text-align: center;
    margin: 40px 0;
    padding: 30px;
    background: linear-gradient(135deg, #e7eaff 0%, #f0e6ff 100%);
    border-radius: var(--border-radius);
    display: none;
}

.score-display.show {
    display: block;
    animation: slideUp 0.5s ease;
}

.score-number {
    font-size: 48px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 10px;
}

.score-text {
    font-size: 18px;
    color: #666;
}

.score-percentage {
    font-size: 24px;
    font-weight: 600;
    margin: 15px 0;
    color: var(--primary);
}

/* Responsive */
@media (max-width: 768px) {
    .quiz-container {
        padding: 25px;
        margin: 25px auto;
    }
    
    .quiz-header-top h1 {
        font-size: 24px;
    }
    
    .question-wrapper {
        padding: 20px;
    }
    
    .options-container {
        gap: 10px;
    }
    
    .option-item {
        padding: 14px;
        font-size: 15px;
    }
    
    button {
        padding: 12px 24px;
        font-size: 14px;
    }
    
    .button-group {
        gap: 10px;
    }
    
    .score-number {
        font-size: 36px;
    }
}

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.loading {
    animation: pulse 2s infinite;
}

/* Print Styles */
@media print {
    .button-group,
    .quiz-header {
        display: none;
    }
    
    .quiz-container {
        box-shadow: none;
        margin: 0;
        padding: 0;
    }
    
    .option-item {
        page-break-inside: avoid;
    }
}
