@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #4F46E5;
    --primary-dark: #4338CA;
    --primary-light: #EEF2FF;
    --success: #10B981;
    --success-light: #D1FAE5;
    --error: #EF4444;
    --error-light: #FEE2E2;
    --neutral-50: #F9FAFB;
    --neutral-100: #F3F4F6;
    --neutral-200: #E5E7EB;
    --neutral-300: #D1D5DB;
    --neutral-400: #9CA3AF;
    --neutral-500: #6B7280;
    --neutral-600: #4B5563;
    --neutral-700: #374151;
    --neutral-800: #1F2937;
    --neutral-900: #111827;
    --radius: 12px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Dark mode colors */
.dark-mode {
    --primary: #6366F1;
    --primary-dark: #4F46E5;
    --primary-light: #1E1B4B;
    --neutral-50: #1F2937;
    --neutral-100: #1F2937;
    --neutral-200: #374151;
    --neutral-300: #4B5563;
    --neutral-400: #6B7280;
    --neutral-500: #9CA3AF;
    --neutral-600: #D1D5DB;
    --neutral-700: #E5E7EB;
    --neutral-800: #F3F4F6;
    --neutral-900: #F9FAFB;
    --success-light: #064E3B;
    --error-light: #7F1D1D;
}

/* Logo styling */
.app-logo img {
    height: 70px;
    width: auto;
}

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

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    background-color: var(--neutral-100);
    color: var(--neutral-800);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s, color 0.3s;
}

.app-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--neutral-200);
}

.app-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--neutral-600);
    font-size: 1.25rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    transition: background-color 0.2s, color 0.2s;
}

.theme-toggle:hover {
    background-color: var(--neutral-200);
    color: var(--neutral-800);
}

/* Quiz container */
.quiz-container {
    background-color: var(--neutral-50);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex: 1;
    transition: box-shadow 0.3s, background-color 0.3s;
}

.quiz-header {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    background-color: white;
    border-bottom: 1px solid var(--neutral-200);
    transition: background-color 0.3s;
}

.dark-mode .quiz-header {
    background-color: var(--neutral-800);
}

.quiz-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--neutral-900);
    margin-bottom: 0.5rem;
    transition: color 0.3s;
}

.quiz-description {
    font-size: 1rem;
    color: var(--neutral-600);
    margin-top: 0.25rem;
    transition: color 0.3s;
}

.lite-upgrade-banner {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.9fr);
    gap: 1.25rem;
    margin: 1.5rem 0 1.25rem;
    padding: 1.25rem;
    border: 1px solid rgba(79, 70, 229, 0.22);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(238, 242, 255, 0.96) 0%, rgba(240, 253, 250, 0.92) 100%),
        var(--neutral-50);
    box-shadow: 0 12px 28px rgba(17, 24, 39, 0.08);
}

.lite-upgrade-copy {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.lite-upgrade-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    align-self: flex-start;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(79, 70, 229, 0.12);
    color: var(--primary-dark);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.lite-upgrade-copy h2 {
    max-width: 680px;
    margin: 0;
    color: var(--neutral-900);
    font-size: clamp(1.25rem, 2vw, 1.75rem);
    line-height: 1.2;
}

.lite-upgrade-copy p {
    max-width: 720px;
    margin: 0;
    color: var(--neutral-700);
    font-size: 0.98rem;
}

.lite-upgrade-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

.lite-upgrade-primary,
.lite-upgrade-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s, color 0.2s;
}

.lite-upgrade-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.24);
}

.lite-upgrade-primary:hover {
    background: var(--primary-dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(79, 70, 229, 0.28);
}

.lite-upgrade-secondary {
    border: 1px solid rgba(79, 70, 229, 0.24);
    background: rgba(255, 255, 255, 0.75);
    color: var(--primary-dark);
}

.lite-upgrade-secondary:hover {
    background: white;
    color: var(--primary);
}

.lite-upgrade-features {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.9rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(255, 255, 255, 0.75);
}

.lite-feature-row {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 0.65rem;
    align-items: start;
    color: var(--neutral-700);
    font-size: 0.92rem;
}

.lite-feature-row i {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.lite-feature-row strong {
    color: var(--neutral-900);
}

.dark-mode .lite-upgrade-banner {
    border-color: rgba(99, 102, 241, 0.35);
    background:
        linear-gradient(135deg, rgba(30, 27, 75, 0.96) 0%, rgba(67, 56, 202, 0.46) 100%),
        var(--neutral-800);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
}

.dark-mode .lite-upgrade-eyebrow {
    background: rgba(99, 102, 241, 0.18);
    color: #C7D2FE;
}

.dark-mode .lite-upgrade-copy h2,
.dark-mode .lite-feature-row strong {
    color: var(--neutral-900);
}

.dark-mode .lite-upgrade-copy p,
.dark-mode .lite-feature-row {
    color: var(--neutral-600);
}

.dark-mode .lite-upgrade-secondary {
    background: rgba(31, 41, 55, 0.7);
    border-color: rgba(165, 180, 252, 0.32);
    color: #C7D2FE;
}

.dark-mode .lite-upgrade-secondary:hover {
    background: rgba(55, 65, 81, 0.95);
    color: white;
}

.dark-mode .lite-upgrade-features {
    background: rgba(17, 24, 39, 0.34);
    border-color: rgba(165, 180, 252, 0.14);
}

.dark-mode .lite-feature-row i {
    background: rgba(17, 24, 39, 0.72);
    color: #A5B4FC;
}

/* Free tests visual refresh */
body.free-tests-page {
    background:
        linear-gradient(180deg, #F8FAFC 0%, #EEF2FF 42%, #F5F3FF 100%);
}

.dark-mode.free-tests-page {
    background:
        linear-gradient(180deg, #0F172A 0%, #111827 48%, #111827 100%);
}

.free-tests-page .app-container {
    max-width: 1240px;
}

.free-tests-page .quiz-container {
    border: 1px solid rgba(79, 70, 229, 0.16);
    border-radius: 8px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.12);
}

.free-tests-page .quiz-header {
    gap: 1.25rem;
    padding: clamp(1.25rem, 3vw, 2.5rem);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(238, 242, 255, 0.94) 58%, rgba(245, 243, 255, 0.94) 100%);
}

.dark-mode.free-tests-page .quiz-header {
    background:
        linear-gradient(135deg, rgba(31, 41, 55, 0.98) 0%, rgba(30, 27, 75, 0.88) 58%, rgba(67, 56, 202, 0.42) 100%);
}

.free-tests-page .quiz-title {
    max-width: 760px;
    margin-bottom: 0;
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1.08;
    letter-spacing: 0;
}

.free-tests-page .quiz-description {
    max-width: 760px;
    margin-top: 0;
    font-size: 1.04rem;
    color: var(--neutral-700);
}

.free-tests-page .quiz-description a {
    color: var(--primary-dark);
    font-weight: 700;
}

.free-tests-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
    gap: 1.5rem;
    align-items: center;
}

.free-tests-hero-copy {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.free-tests-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    align-self: flex-start;
    padding: 0.42rem 0.75rem;
    border: 1px solid rgba(79, 70, 229, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--primary-dark);
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
}

.free-tests-helper {
    max-width: 650px;
    margin: 0;
    color: var(--neutral-600);
    font-weight: 600;
}

.free-tests-hero-panel {
    display: grid;
    gap: 0.7rem;
    padding: 1rem;
    border: 1px solid rgba(79, 70, 229, 0.16);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.7);
}

.free-tests-hero-panel div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid rgba(79, 70, 229, 0.12);
}

.free-tests-hero-panel div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.free-tests-hero-panel span {
    color: var(--neutral-500);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
}

.free-tests-hero-panel strong {
    color: var(--neutral-900);
    text-align: right;
}

.free-tests-page .lite-upgrade-banner {
    gap: 1rem;
    margin: 0;
    padding: 1.35rem;
    border-color: rgba(124, 58, 237, 0.24);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.92) 0%, rgba(245, 243, 255, 0.9) 100%),
        var(--neutral-50);
    box-shadow: 0 12px 28px rgba(79, 70, 229, 0.1);
}

.free-tests-page .lite-upgrade-primary {
    background: var(--primary);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.22);
}

.free-tests-page .lite-upgrade-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 12px 26px rgba(79, 70, 229, 0.28);
}

.free-tests-page .lite-upgrade-features {
    background: rgba(255, 255, 255, 0.78);
    border-color: rgba(124, 58, 237, 0.14);
}

.dark-mode.free-tests-page .quiz-description,
.dark-mode.free-tests-page .free-tests-helper,
.dark-mode.free-tests-page .free-tests-hero-panel span {
    color: var(--neutral-600);
}

.dark-mode.free-tests-page .free-tests-kicker,
.dark-mode.free-tests-page .free-tests-hero-panel {
    background: rgba(17, 24, 39, 0.42);
    border-color: rgba(165, 180, 252, 0.22);
}

.dark-mode.free-tests-page .free-tests-hero-panel strong {
    color: var(--neutral-900);
}

.dark-mode.free-tests-page .lite-upgrade-banner {
    border-color: rgba(167, 139, 250, 0.3);
}

.free-tests-start-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.8rem 1rem;
}

.free-tests-page #start-quiz-btn {
    min-width: 210px;
    min-height: 50px;
    border-radius: 8px;
    font-size: 1.05rem;
    box-shadow: 0 10px 24px rgba(79, 70, 229, 0.22);
}

.free-tests-start-row span {
    color: var(--neutral-500);
    font-size: 0.92rem;
    font-weight: 600;
}

.free-tests-page .selection-content {
    padding: clamp(1.25rem, 3vw, 2rem);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(249, 250, 251, 0.98) 100%);
}

.dark-mode.free-tests-page .selection-content {
    background:
        linear-gradient(180deg, rgba(31, 41, 55, 0.98) 0%, rgba(17, 24, 39, 0.98) 100%);
}

.free-tests-page .selection-form {
    max-width: 760px;
    padding: 1.25rem;
    gap: 1.25rem;
    border: 1px solid var(--neutral-200);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: var(--shadow-sm);
}

.dark-mode.free-tests-page .selection-form {
    background: rgba(31, 41, 55, 0.7);
    border-color: var(--neutral-600);
}

.selection-panel-heading {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-end;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--neutral-200);
}

.selection-panel-heading span {
    color: var(--neutral-900);
    font-size: 1.05rem;
    font-weight: 800;
}

.selection-panel-heading small {
    color: var(--neutral-500);
    font-weight: 600;
    text-align: right;
}

.dark-mode .selection-panel-heading {
    border-bottom-color: var(--neutral-600);
}

.dark-mode .selection-panel-heading span {
    color: var(--neutral-900);
}

.free-tests-page .source-options {
    width: 100%;
}

/* Progress section */
.stats-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.stats-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-primary {
    background-color: var(--primary-light);
    color: var(--primary);
}

.progress-container {
    width: 100%;
    height: 0.5rem;
    background-color: var(--neutral-200);
    border-radius: 9999px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary);
    border-radius: 9999px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Question info */
.question-info {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-light);
    color: var(--primary);
    font-size: 0.875rem;
    transition: background-color 0.3s, color 0.3s;
}

.dark-mode .question-info {
    color: var(--neutral-50);
}

/* Question content */
.quiz-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: white;
    transition: background-color 0.3s;
}

.dark-mode .quiz-content {
    background-color: var(--neutral-800);
}

.question {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    color: var(--neutral-900);
    transition: color 0.3s;
}

.answers {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Answer styling */
.answer {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    background-color: var(--neutral-50);
    border: 1px solid var(--neutral-200);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.dark-mode .answer {
    background-color: var(--neutral-700);
    border-color: var(--neutral-600);
}

.answer:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.answer-letter {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background-color: var(--neutral-200);
    color: var(--neutral-700);
    font-weight: 600;
    margin-right: 1rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.dark-mode .answer-letter {
    background-color: var(--neutral-600);
    color: var(--neutral-200);
}

.answer-text {
    flex: 1;
}

.answer-selected {
    border-color: var(--primary);
    background-color: var(--primary-light);
}

.dark-mode .answer-selected {
    background-color: var(--primary-dark);
}

.answer-selected .answer-letter {
    background-color: var(--primary);
    color: white;
}

.answer-correct {
    border-color: var(--success);
    background-color: var(--success-light);
}

.answer-correct .answer-letter {
    background-color: var(--success);
    color: white;
}

.answer-incorrect {
    border-color: var(--error);
    background-color: var(--error-light);
}

.answer-incorrect .answer-letter {
    background-color: var(--error);
    color: white;
}

/* Results */
.result-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 2rem;
}

.result-icon {
    font-size: 4rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.result-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--neutral-900);
    transition: color 0.3s;
}

.result-score {
    font-size: 1.5rem;
    font-weight: 600;
    padding: 0.5rem 1.5rem;
    background-color: var(--primary-light);
    color: var(--primary);
    border-radius: 9999px;
    margin-bottom: 1.5rem;
    transition: background-color 0.3s, color 0.3s;
}

.dark-mode .result-score {
    color: white;
}

.result-message {
    font-size: 1.125rem;
    margin-bottom: 2rem;
    max-width: 500px;
    color: var(--neutral-600);
    transition: color 0.3s;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

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

/* Footer */
.app-footer {
    padding: 2rem 0;
    text-align: center;
    color: var(--neutral-500);
    font-size: 0.875rem;
    border-top: 1px solid var(--neutral-200);
    margin-top: 2rem;
    transition: color 0.3s;
}

/* Loading state */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
}

.loading-spinner {
    border: 3px solid var(--neutral-200);
    border-radius: 50%;
    border-top: 3px solid var(--primary);
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 1.5rem;
}

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

/* Animation */
@keyframes fadeIn {
    from { opacity: 0.2; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Visibility control */
.hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.visible {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.selection-content {
    display: flex;
    justify-content: center;
}

.selection-form {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.begin-button-form {
    margin: 0 auto;
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--neutral-700);
    transition: color 0.3s;
}

.dark-mode .form-group label {
    color: var(--neutral-300);
}

/* Random option */
.random-option {
    padding: 0.75rem;
    background-color: var(--primary-light);
    border-radius: var(--radius);
    border-left: 4px solid var(--primary);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    transition: background-color 0.3s, border-color 0.3s;
}

.dark-mode .random-option {
    background-color: var(--primary-dark);
    border-left-color: var(--primary);
}

.random-option input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.random-option label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
}

.dark-mode .random-option label {
    color: white;
}

.option-description {
    margin-left: 1.8rem;
    font-size: 0.85rem;
    color: var(--neutral-600);
}

.option-description2 {
    margin-left: 0rem;
    font-size: 0.85rem;
    color: var(--neutral-600);
}

.dark-mode .option-description {
    color: var(--neutral-300);
}

/* Source options */
.source-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 500px;
    width: 55vw; 
    overflow-y: auto;
    padding: 0.5rem;
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius);
    background-color: var(--neutral-50);
    transition: background-color 0.3s, border-color 0.3s;
}

.dark-mode .source-options {
    border-color: var(--neutral-600);
    background-color: var(--neutral-700);
}

.source-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: calc(var(--radius) / 2);
    transition: background-color 0.2s;
    cursor: pointer;
}

.source-checkbox:hover {
    background-color: var(--neutral-200);
}

.dark-mode .source-checkbox:hover {
    background-color: var(--neutral-600);
}

.source-checkbox input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.source-checkbox label {
    font-weight: normal;
    cursor: pointer;
}

/* Select input */
.select-input {
    padding: 0.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--neutral-300);
    background-color: var(--neutral-50);
    font-family: var(--font-sans);
    font-size: 1rem;
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='none' d='M0 0h24v24H0z'/%3E%3Cpath d='M12 15l-4.243-4.243 1.415-1.414L12 12.172l2.828-2.829 1.415 1.414z' fill='%236B7280'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

.dark-mode .select-input {
    background-color: var(--neutral-700);
    border-color: var(--neutral-600);
    color: var(--neutral-200);
}

.select-input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

/* Transitions */
.slide-in {
    animation: slideIn 0.4s ease-out forwards;
}

.slide-out {
    animation: slideOut 0.4s ease-out forwards;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(30px); visibility: visible; }
    to { opacity: 1; transform: translateX(0); visibility: visible; }
}

@keyframes slideOut {
    from { opacity: 1; transform: translateX(0); visibility: visible; }
    to { opacity: 0; transform: translateX(-30px); visibility: visible; }
}

#start-quiz-btn {
    margin-top: 1rem;
    align-self: center;
}

/* Result buttons */
.result-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Question history */
.question-history {
    margin-top: 2.5rem;
    width: 100%;
    border-top: 1px solid var(--neutral-200);
    padding-top: 2rem;
}

.question-history h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--neutral-800);
    text-align: center;
}

.dark-mode .question-history h2 {
    color: var(--neutral-200);
}

.history-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-height: 500px;
    overflow-y: auto;
    padding: 0 1rem 1rem 1rem;
}

.history-item {
    padding: 1.25rem;
    border-radius: var(--radius);
    background-color: var(--neutral-50);
    border-left: 4px solid var(--neutral-400);
    transition: background-color 0.3s, border-color 0.3s;
    box-shadow: var(--shadow-sm);
}

.history-item.history-correct {
    border-left-color: var(--success);
}

.history-item.history-incorrect {
    border-left-color: var(--error);
}

.dark-mode .history-item {
    background-color: var(--neutral-700);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.history-number {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary);
}

.history-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--neutral-500);
}

.dark-mode .history-meta {
    color: var(--neutral-400);
}

.history-question {
    font-weight: 600;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.history-answers {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-left: 1rem;
}

.history-answer {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-radius: calc(var(--radius) / 2);
    background-color: var(--neutral-100);
    position: relative;
    transition: background-color 0.3s;
}

.dark-mode .history-answer {
    background-color: var(--neutral-600);
}

.history-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background-color: var(--neutral-300);
    color: var(--neutral-800);
    font-weight: 600;
    margin-right: 0.75rem;
}

.dark-mode .history-letter {
    background-color: var(--neutral-500);
    color: var(--neutral-800);
}

.history-text {
    flex: 1;
}

.history-correct-answer {
    background-color: var(--success-light);
}

.dark-mode .history-correct-answer {
    background-color: #064E3B;
}

.history-correct-answer .history-letter {
    background-color: var(--success);
    color: white;
}

.history-wrong-answer {
    background-color: var(--error-light);
}

.dark-mode .history-wrong-answer {
    background-color: #7F1D1D;
}

.history-wrong-answer .history-letter {
    background-color: var(--error);
    color: white;
}

.user-selected {
    position: absolute;
    right: 1rem;
    color: var(--neutral-600);
}

.dark-mode .user-selected {
    color: var(--neutral-300);
}

/* Cookie banner */
.cookie-banner {
    position: fixed;
    bottom: -100%;
    left: 0;
    width: 100%;
    background-color: var(--neutral-50);
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    padding: 0.75rem;
    transition: bottom 0.5s ease-in-out;
    border-top: 3px solid var(--primary);
}

.dark-mode .cookie-banner {
    background-color: var(--neutral-800);
    color: var(--neutral-200);
}

.cookie-banner-visible {
    bottom: 0;
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cookie-message h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.cookie-message p {
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    line-height: 1.4;
}

.cookie-link {
    color: var(--primary);
    text-decoration: underline;
    transition: color 0.2s;
}

.cookie-link:hover {
    color: var(--primary-dark);
}

.cookie-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.cookie-btn {
    padding: 0.4rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.cookie-accept {
    background-color: var(--primary);
    color: white;
}

.cookie-accept:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

/* BuyCoffee container */
.buycoffee-container {
    width: 100%;
    max-width: 470px;
    margin: 2rem auto 0;
    font-family: var(--font-sans);
    transition: all 0.3s ease;
    padding: 0 1rem;
}

.buycoffee-header {
    box-sizing: border-box;
    background-color: white;
    padding: 12px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    color: var(--neutral-900);
    text-align: center;
    transition: background-color 0.3s, color 0.3s;
}

.dark-mode .buycoffee-header {
    background-color: var(--neutral-800);
    color: var(--neutral-100);
}

.buycoffee-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    margin: 0;
}

.buycoffee-options {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    justify-content: center;
}

.buycoffee-option {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 12px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    text-align: center;
    background-color: white;
    color: var(--neutral-900);
    text-decoration: none;
    transition: all 0.3s ease;
}

.dark-mode .buycoffee-option {
    background-color: var(--neutral-800);
    color: var(--neutral-100);
}

.buycoffee-option:hover {
    transform: translateY(-4px);
}

.buycoffee-price {
    font-size: 14px;
    font-weight: 700;
    margin-top: 8px;
    line-height: 1.5;
}

.coffee-icon {
    transition: filter 0.3s ease;
}

.dark-mode .coffee-icon {
    filter: invert(0.8);
}

/* Responsive design */
@media (max-width: 768px) {
    .app-container {
        padding: 1rem;
    }
    
    .quiz-header, .quiz-content {
        padding: 1rem;
    }
    
    .question {
        font-size: 1.125rem;
    }
    
    .answer {
        padding: 0.75rem 1rem;
    }
    
    .answer-letter {
        width: 1.75rem;
        height: 1.75rem;
        margin-right: 0.75rem;
    }
    
    .result-title {
        font-size: 1.5rem;
    }
    
    .result-score {
        font-size: 1.25rem;
    }
    
    .result-message {
        font-size: 1rem;
    }

    .source-options {
        width: 100% !important;
        max-width: none !important;
        margin: 0 auto;
    }
    
    .form-group {
        width: 100% !important;
        margin: 0 auto;
    }

    .select-input {
        width: 100% !important;
    }

    .quiz-content {
        padding: 10px !important;
    }

    .lite-upgrade-banner {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .lite-upgrade-actions {
        flex-direction: column;
    }

    .lite-upgrade-primary,
    .lite-upgrade-secondary {
        width: 100%;
    }
    
    .result-buttons {
        flex-direction: column;
    }
    
    .history-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .history-meta {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .history-answer {
        padding: 0.5rem;
    }
    
    .history-letter {
        min-width: 1.5rem;
        height: 1.5rem;
        margin-right: 0.5rem;
    }

    .buycoffee-container {
        width: 100%;
        max-width: 470px;
        margin: 2rem auto 0;
        font-family: var(--font-sans);
        transition: all 0.3s ease;
        padding: 0 1rem;
    }

    .buycoffee-header {
        box-sizing: border-box;
        background-color: white;
        padding: 12px;
        border-radius: 16px;
        box-shadow: var(--shadow-lg);
        width: 100%;
        color: var(--neutral-900);
        text-align: center;
        transition: background-color 0.3s, color 0.3s;
    }

    .dark-mode .buycoffee-header {
        background-color: var(--neutral-800);
        color: var(--neutral-100);
    }

    .buycoffee-title {
        font-size: 14px;
        font-weight: 600;
        line-height: 1.5;
        margin: 0;
    }

    .buycoffee-options {
        display: flex;
        gap: 8px;
        margin-top: 12px;
        justify-content: center;
    }

    .buycoffee-option {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 12px;
        border-radius: 16px;
        box-shadow: var(--shadow-lg);
        width: 100%;
        text-align: center;
        background-color: white;
        color: var(--neutral-900);
        text-decoration: none;
        transition: all 0.3s ease;
    }

    .dark-mode .buycoffee-option {
        background-color: var(--neutral-800);
        color: var(--neutral-100);
    }

    .buycoffee-option:hover {
        transform: translateY(-4px);
    }

    .buycoffee-price {
        font-size: 14px;
        font-weight: 700;
        margin-top: 8px;
        line-height: 1.5;
    }

    .coffee-icon {
        transition: filter 0.3s ease;
    }

    .dark-mode .coffee-icon {
        filter: invert(0.8);
    }
}

@media (min-width: 768px) {
    .cookie-content {
        flex-direction: row;
        align-items: center;
    }
    
    .cookie-message {
        flex: 1;
    }
    
    .cookie-buttons {
        flex-shrink: 0;
        align-self: center;
    }
}

@media (max-width: 900px) {
    .free-tests-hero,
    .free-tests-page .lite-upgrade-banner {
        grid-template-columns: 1fr;
    }

    .free-tests-hero-panel {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .free-tests-hero-panel div {
        flex-direction: column;
        gap: 0.25rem;
        padding-bottom: 0;
        border-bottom: 0;
    }

    .free-tests-hero-panel strong {
        text-align: left;
    }
}

@media (max-width: 640px) {
    .free-tests-page .nav-tab {
        max-width: none;
        min-width: 0;
        flex: 1 1 145px;
    }

    .free-tests-page .quiz-title {
        font-size: clamp(1.75rem, 8vw, 2.35rem);
    }

    .free-tests-hero-panel {
        grid-template-columns: 1fr;
    }

    .selection-panel-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .selection-panel-heading small {
        text-align: left;
    }

    .free-tests-start-row {
        align-items: stretch;
        flex-direction: column;
    }

    .free-tests-start-row span {
        text-align: center;
    }
}
