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

:root {
    --primary-color: #3390ec;
    --secondary-color: #2c7fd4;
    --success-color: #4caf50;
    --error-color: #f44336;
    --text-color: #333;
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --border-radius: 12px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    padding: 16px;
}

/* Screens */
.screen {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading Screen */
#loading {
    display: hidden;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
}

.loader {
    display: hidden;
    width: 50px;
    height: 50px;
    border: 4px solid var(--bg-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

#loading p {
    margin-top: 20px;
    color: var(--primary-color);
    font-size: 16px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 24px;
}

.header h1 {
    font-size: 28px;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.subtitle {
    color: #666;
    font-size: 14px;
}

/* Tests Container */
.tests-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.test-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.test-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.test-card:active {
    transform: scale(0.98);
}

.test-card h3 {
    font-size: 18px;
    color: var(--text-color);
    margin-bottom: 8px;
}

.test-card .test-info {
    display: flex;
    gap: 16px;
    font-size: 14px;
    color: #666;
}

.test-info span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Test Screen */
.test-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.back-btn {
    background: var(--card-bg);
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.back-btn:hover {
    background: #f0f0f0;
}

.progress-info {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 24px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* Question Container */
.question-container {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

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

/* Options */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option {
    background: var(--card-bg);
    border: 2px solid #e0e0e0;
    border-radius: var(--border-radius);
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.option:hover {
    border-color: var(--primary-color);
    background: #f8f9fa;
}

.option.selected {
    border-color: var(--primary-color);
    background: #e3f2fd;
}

.option-letter {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.option.selected .option-letter {
    background: var(--secondary-color);
}

.option-text {
    flex: 1;
    font-size: 16px;
}

/* Next Button */
.next-btn {
    width: 100%;
    padding: 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.next-btn:hover:not(:disabled) {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.next-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Results Screen */
.results-container {
    text-align: center;
    padding: 24px;
}

.results-icon {
    font-size: 80px;
    margin-bottom: 16px;
    animation: bounce 0.6s ease;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

.results-container h1 {
    font-size: 28px;
    color: var(--text-color);
    margin-bottom: 32px;
}

/* Score Card */
.score-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 32px;
}

.score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #f0f0f0;
}

.score-item:last-child {
    border-bottom: none;
}

.score-label {
    font-size: 16px;
    color: #666;
}

.score-value {
    font-size: 24px;
    font-weight: 700;
}

.score-value.correct {
    color: var(--success-color);
}

.score-value.wrong {
    color: var(--error-color);
}

.score-value.percentage {
    color: var(--primary-color);
}

/* Finish Button */
.finish-btn {
    width: 100%;
    padding: 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.finish-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Responsive */
@media (max-width: 480px) {
    body {
        padding: 12px;
    }

    .question-text {
        font-size: 18px;
    }

    .option-text {
        font-size: 14px;
    }
}