@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Modern Color Palette */
    --primary-500: #6366f1;
    --primary-600: #4f46e5;
    --primary-700: #4338ca;
    --primary-50: #eef2ff;
    --primary-100: #e0e7ff;
    
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    --success-500: #10b981;
    --success-50: #ecfdf5;
    --warning-500: #f59e0b;
    --warning-50: #fffbeb;
    --error-500: #ef4444;
    --error-50: #fef2f2;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-success: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    
    /* Shadows */
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-3xl: 2rem;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.6;
    color: var(--gray-900);
    position: relative;
    padding: 1rem;
}

/* Modern background with subtle patterns */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 25% 25%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
    pointer-events: none;
    z-index: -1;
}

.container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

.hidden {
    display: none !important;
}

/* Modern Card Design */
.form-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-3xl);
    padding: 3rem 2.5rem;
    box-shadow: var(--shadow-2xl);
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Subtle top accent */
.form-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

/* Floating elements for modern feel */
.form-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

/* Modern Typography */
.form-card h1 {
    color: var(--gray-900);
    margin-bottom: 0.75rem;
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.form-card p {
    color: var(--gray-600);
    margin-bottom: 2.5rem;
    font-size: 1rem;
    line-height: 1.6;
    font-weight: 400;
}

/* Modern Form Groups */
.form-group {
    margin-bottom: 1.75rem;
    text-align: left;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.75rem;
    color: var(--gray-700);
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: 0.025em;
}

/* Modern Input Design */
.form-group input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-xl);
    font-size: 1rem;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    color: var(--gray-900);
    box-shadow: var(--shadow-xs);
}

.form-group input::placeholder {
    color: var(--gray-400);
    font-weight: 400;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-500);
    background: white;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1), var(--shadow-sm);
    transform: translateY(-1px);
}

.form-group input:hover:not(:focus) {
    border-color: var(--gray-300);
    box-shadow: var(--shadow-sm);
}

/* Modern Button Design */
button {
    width: 100%;
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 1.125rem 2rem;
    border-radius: var(--radius-xl);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    margin-top: 0.5rem;
}

/* Subtle shine effect */
button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

button:hover::before {
    left: 100%;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
    background: linear-gradient(135deg, #5a67d8 0%, #667eea 100%);
}

button:active {
    transform: translateY(0);
    box-shadow: var(--shadow-md);
}

button:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
    transform: none;
    opacity: 0.6;
    box-shadow: none;
}

button:disabled::before {
    display: none;
}

/* Modern Error Message */
.error {
    color: var(--error-500);
    margin-top: 1rem;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 1rem 1.25rem;
    background: var(--error-50);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideInDown 0.3s ease-out;
}

.error::before {
    content: '⚠️';
    font-size: 1.125rem;
    flex-shrink: 0;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modern Quiz Interface */
.container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.quiz-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-2xl);
    padding: 2rem 2.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.quiz-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.quiz-header h2 {
    color: var(--gray-900);
    margin: 0;
    font-weight: 700;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.quiz-info {
    display: flex;
    gap: 1.5rem;
    font-weight: 500;
    font-size: 0.875rem;
}

.quiz-info span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    color: var(--gray-700);
    box-shadow: var(--shadow-xs);
    font-weight: 600;
}

.question-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-2xl);
    padding: 3rem 2.5rem;
    box-shadow: var(--shadow-xl);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.question-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-secondary);
}

#question-text {
    font-size: 1.375rem;
    color: var(--gray-900);
    margin-bottom: 2.5rem;
    line-height: 1.6;
    font-weight: 600;
    letter-spacing: -0.025em;
}

/* Modern Option Cards */
.option {
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: 1.5rem 1.75rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    font-weight: 500;
    color: var(--gray-800);
    box-shadow: var(--shadow-xs);
}

.option::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: transparent;
    transition: all 0.2s ease;
}

.option:hover {
    background: var(--primary-50);
    border-color: var(--primary-300);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: var(--gray-900);
}

.option:hover::before {
    background: var(--gradient-primary);
}

.option.selected {
    background: var(--gradient-primary);
    color: white;
    border-color: var(--primary-600);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    font-weight: 600;
}

.option.selected::before {
    background: rgba(255, 255, 255, 0.4);
    width: 6px;
}

/* Modern Navigation */
.navigation-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    gap: 1rem;
}

.navigation-buttons button {
    width: auto;
    min-width: 120px;
    padding: 0.875rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.navigation-buttons button:disabled {
    background: var(--gray-200);
    color: var(--gray-400);
}

/* Modern Progress Bar */
.progress-bar {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-2xl);
    height: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    position: relative;
    margin-top: 1rem;
}

.progress-fill {
    background: var(--gradient-success);
    height: 100%;
    width: 0%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border-radius: var(--radius-2xl);
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 30px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4));
    animation: shimmer 2s infinite;
    border-radius: var(--radius-2xl);
}

@keyframes shimmer {
    0% { transform: translateX(-30px); }
    100% { transform: translateX(30px); }
}

/* Modern Results Page */
.results-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-3xl);
    padding: 4rem 3rem;
    box-shadow: var(--shadow-2xl);
    text-align: center;
    position: relative;
    overflow: hidden;
    max-width: 600px;
    margin: 0 auto;
}

.results-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--gradient-success);
}

.results-card h2 {
    color: var(--gray-900);
    margin-bottom: 1.5rem;
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.score-display {
    font-size: 5rem;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 2rem 0;
    position: relative;
    line-height: 1;
}

.score-display::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: var(--radius-sm);
}

.score-details {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-2xl);
    padding: 2.5rem;
    margin: 2.5rem 0;
    text-align: left;
    box-shadow: var(--shadow-sm);
}

.score-details h3 {
    color: var(--gray-900);
    margin-bottom: 2rem;
    font-weight: 700;
    font-size: 1.375rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.score-details h3::before {
    content: '📊';
    font-size: 1.5rem;
}

.score-details p {
    margin-bottom: 1rem;
    color: var(--gray-600);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-200);
    font-size: 1rem;
}

.score-details p:last-child {
    border-bottom: none;
    font-weight: 700;
    color: var(--gray-900);
    font-size: 1.25rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid var(--gray-300);
}

.answer-review {
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--border-color);
    transition: all 0.2s ease;
}

.answer-review:hover {
    transform: translateX(4px);
}

.correct {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border-left-color: var(--success-color);
}

.incorrect {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
    border-left-color: var(--error-color);
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .form-card, .question-card, .results-card {
        padding: 20px;
    }
    
    .quiz-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .quiz-info {
        justify-content: center;
    }
    
    .navigation-buttons {
        flex-direction: column;
        gap: 10px;
    }
}

/* Additional styles for better quiz experience */
.excellent {
    color: #27ae60 !important;
}

.good {
    color: #2980b9 !important;
}

.average {
    color: #f39c12 !important;
}

.poor {
    color: #e74c3c !important;
}

.answer-item {
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #ddd;
}

.answer-item.correct {
    background: #d4edda;
    border-left-color: #28a745;
}

.answer-item.incorrect {
    background: #f8d7da;
    border-left-color: #dc3545;
}

.answer-item.unattempted {
    background: #fff3cd;
    border-left-color: #ffc107;
}

.answer-item strong {
    color: #333;
}

.answer-item small {
    color: #666;
    display: block;
    margin-top: 5px;
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive improvements */
@media (max-width: 480px) {
    .form-card h1 {
        font-size: 2em;
    }
    
    .score-display {
        font-size: 2.5em;
    }
    
    .quiz-info {
        flex-direction: column;
        gap: 5px;
    }
    
    .option {
        padding: 12px;
        font-size: 14px;
    }
}

/* Print styles for results */
@media print {
    body {
        background: white;
    }
    
    .container {
        box-shadow: none;
        max-width: 100%;
    }
    
    .results-card {
        box-shadow: none;
    }
    
    button {
        display: none;
    }
}
/* En
hanced Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.form-card {
    animation: fadeInUp 0.6s ease-out;
}

.quiz-header {
    animation: slideInRight 0.5s ease-out;
}

.question-card {
    animation: fadeInUp 0.4s ease-out;
}

.option {
    animation: fadeInUp 0.3s ease-out;
    animation-fill-mode: both;
}

.option:nth-child(1) { animation-delay: 0.1s; }
.option:nth-child(2) { animation-delay: 0.2s; }
.option:nth-child(3) { animation-delay: 0.3s; }
.option:nth-child(4) { animation-delay: 0.4s; }

.results-card {
    animation: fadeInUp 0.6s ease-out;
}

.score-display {
    animation: pulse 2s infinite;
}

/* Loading States */
.loading-state {
    opacity: 0.7;
    pointer-events: none;
}

.loading-state::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-gradient);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Enhanced Focus States */
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* Modern Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 0.5rem;
    }
    
    .container {
        max-width: 100%;
    }
    
    .form-card {
        padding: 2.5rem 2rem;
        border-radius: var(--radius-2xl);
    }
    
    .form-card h1 {
        font-size: 2rem;
    }
    
    .quiz-header {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
        padding: 1.5rem 2rem;
    }
    
    .quiz-info {
        justify-content: center;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .question-card {
        padding: 2.5rem 2rem;
    }
    
    .navigation-buttons {
        flex-direction: column;
        gap: 1rem;
    }
    
    .navigation-buttons button {
        width: 100%;
        min-width: auto;
    }
    
    .option {
        padding: 1.25rem 1.5rem;
        font-size: 1rem;
    }
    
    #question-text {
        font-size: 1.25rem;
    }
    
    .results-card {
        padding: 3rem 2rem;
    }
}

@media (max-width: 480px) {
    .form-card {
        padding: 2rem 1.5rem;
    }
    
    .form-card h1 {
        font-size: 1.875rem;
    }
    
    .score-display {
        font-size: 4rem;
    }
    
    .quiz-header {
        padding: 1.25rem 1.5rem;
    }
    
    .quiz-info span {
        padding: 0.5rem 0.875rem;
        font-size: 0.8125rem;
    }
    
    .question-card {
        padding: 2rem 1.5rem;
    }
    
    .option {
        padding: 1rem 1.25rem;
        font-size: 0.9375rem;
    }
    
    #question-text {
        font-size: 1.125rem;
    }
    
    .results-card {
        padding: 2.5rem 1.5rem;
    }
    
    .score-details {
        padding: 2rem 1.5rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f1f5f9;
        --text-secondary: #cbd5e1;
        --text-light: #64748b;
        --bg-primary: rgba(30, 41, 59, 0.95);
        --bg-secondary: rgba(51, 65, 85, 0.8);
        --bg-tertiary: rgba(71, 85, 105, 0.6);
        --border-color: rgba(148, 163, 184, 0.2);
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .option {
        border-width: 3px;
    }
    
    .option.selected {
        border-width: 4px;
    }
    
    button {
        border: 2px solid transparent;
    }
    
    button:focus-visible {
        border-color: currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .score-display {
        animation: none;
    }
}