:root {
    --primary: #e74c3c;
    --primary-light: #ec7063;
    --success: #2ecc71;
    --bg: #0f0f23;
    --surface: rgba(255,255,255,0.06);
    --border: rgba(255,255,255,0.08);
    --text: #f0f0f5;
    --text-sec: #a0a0b8;
    --text-dim: #5a5a70;
}

/* Light Mode */
[data-theme="light"] {
    --bg: #f5f5fa;
    --surface: rgba(0,0,0,0.06);
    --border: rgba(0,0,0,0.08);
    --text: #1a1a2e;
    --text-sec: #5a5a70;
    --text-dim: #a0a0b8;
}

[data-theme="light"] .ad-banner {
    background: rgba(0,0,0,0.03);
    border-color: rgba(0,0,0,0.08);
}
[data-theme="light"] .option-btn {
    background: rgba(0,0,0,0.04);
    border-color: rgba(0,0,0,0.1);
    color: var(--text);
}
[data-theme="light"] .option-btn:hover {
    background: rgba(231,76,60,0.1);
    border-color: rgba(231,76,60,0.3);
}
[data-theme="light"] .option-btn.selected {
    background: rgba(231,76,60,0.12);
    border-color: var(--primary);
}
[data-theme="light"] .progress-bar {
    box-shadow: 0 2px 8px rgba(231,76,60,0.1);
}
[data-theme="light"] .radar-bar-bg {
    background: rgba(0,0,0,0.08);
}
[data-theme="light"] .detail-section {
    background: rgba(0,0,0,0.03);
    border-color: rgba(0,0,0,0.08);
}
[data-theme="light"] .lang-btn,
[data-theme="light"] .theme-toggle {
    background: rgba(0,0,0,0.05);
    border-color: rgba(0,0,0,0.1);
    color: var(--text);
}
[data-theme="light"] .lang-btn:hover,
[data-theme="light"] .theme-toggle:hover {
    background: rgba(231,76,60,0.1);
}
[data-theme="light"] .lang-menu {
    background: rgba(245,245,250,0.98);
    border-color: rgba(0,0,0,0.1);
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}
[data-theme="light"] .lang-option {
    color: var(--text-sec);
}
[data-theme="light"] .lang-option:hover {
    background: rgba(231,76,60,0.08);
    color: var(--text);
}
[data-theme="light"] .rec-card {
    background: rgba(0,0,0,0.03);
    border-color: rgba(0,0,0,0.08);
}
[data-theme="light"] .rec-card:hover {
    background: rgba(231,76,60,0.06);
    border-color: rgba(231,76,60,0.2);
}
[data-theme="light"] .app-loader {
    background: #f5f5fa;
}
[data-theme="light"] ::-webkit-scrollbar-track {
    background: #f0f0f5;
}
[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.15);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.screen {
    display: none;
    width: 100%;
    max-width: 480px;
    animation: fadeIn 0.4s ease-out;
}

.screen.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

/* Ad Banner */
.ad-banner {
    width: 100%;
    max-width: 480px;
    padding: 12px;
    text-align: center;
    background: rgba(255,255,255,0.02);
    border-radius: 12px;
    color: var(--text-dim);
    font-size: 12px;
    margin: 10px 0;
    border: 1px solid var(--border);
}

/* Animations */
@keyframes fadeIn { 0% { opacity: 0; } 100% { opacity: 1; } }
@keyframes slideInDown { 0% { opacity: 0; transform: translateY(-20px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes slideInUp { 0% { opacity: 0; transform: translateY(20px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes scaleInUp { 0% { opacity: 0; transform: scale(0.8) translateY(20px); } 100% { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes brainFloat { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-15px) scale(1.05); } }
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes cta-pulse {
    0% { transform: scale(1); box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3); }
    50% { transform: scale(1.03); box-shadow: 0 6px 25px rgba(231, 76, 60, 0.5); }
    100% { transform: scale(1); box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3); }
}

@media (prefers-reduced-motion: reduce) {
    .btn-start {
        animation: none !important;
    }
}

/* === INTRO SCREEN === */
.intro-screen {
    gap: 16px;
    justify-content: center;
    text-align: center;
}

.intro-icon {
    font-size: 80px;
    animation: brainFloat 3s ease-in-out infinite;
}

.intro-title {
    font-size: 32px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), #e91e63);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: slideInDown 0.4s ease-out;
}

.intro-subtitle {
    color: var(--text-sec);
    font-size: 16px;
    line-height: 1.6;
    animation: slideInUp 0.4s ease-out 0.05s both;
}

.intro-desc {
    color: var(--text-sec);
    font-size: 15px;
    line-height: 1.6;
    max-width: 360px;
    white-space: pre-line;
    animation: slideInUp 0.4s ease-out 0.1s both;
}

.intro-meta {
    display: flex;
    gap: 12px;
    color: var(--text-sec);
    font-size: 13px;
    justify-content: center;
    flex-wrap: wrap;
    animation: slideInUp 0.4s ease-out 0.12s both;
}

.intro-meta span {
    background: rgba(231,76,60,0.12);
    border: 1px solid rgba(231,76,60,0.25);
    padding: 6px 12px;
    border-radius: 20px;
}

.btn-start {
    padding: 16px 48px;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), #c0392b);
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 52px;
    animation: scaleInUp 0.4s ease-out 0s both, cta-pulse 2.5s ease-in-out 0.5s infinite;
    position: relative;
    overflow: hidden;
}

.btn-start::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-start:hover::before { opacity: 1; }
.btn-start:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(231,76,60,0.5), inset 0 0 20px rgba(255,255,255,0.1);
}

.btn-start:active { transform: scale(0.98); }

.social-proof {
    animation: slideInUp 0.4s ease-out 0.15s both;
    font-size: 13px;
    color: var(--text-sec);
}

.social-proof .count {
    color: var(--primary-light);
    font-weight: 700;
}

/* === QUESTION SCREEN === */
.question-screen {
    justify-content: flex-start;
    padding-top: 40px;
    gap: 20px;
}

.progress-area {
    width: 100%;
    animation: slideInDown 0.5s ease-out;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--surface);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(231,76,60,0.15);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #e91e63);
    transition: width 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border-radius: 4px;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

.progress-text {
    text-align: center;
    color: var(--text-sec);
    font-size: 14px;
    margin-top: 8px;
    font-weight: 600;
}

.question-card {
    width: 100%;
    animation: slideIn 0.4s ease;
    gap: 16px;
}

.q-text {
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    line-height: 1.5;
}

.q-category {
    font-size: 12px;
    color: var(--text-sec);
    text-align: center;
    background: rgba(231,76,60,0.12);
    padding: 4px 12px;
    border-radius: 12px;
    display: inline-block;
    margin: 0 auto;
}

.q-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

.option-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 16px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text);
    font-size: 15px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    text-align: left;
    min-height: 48px;
    position: relative;
    overflow: hidden;
}

.option-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(231,76,60,0.2) 0%, transparent 70%);
    transition: left 0.3s ease;
}

.option-btn:hover {
    background: rgba(231,76,60,0.15);
    border-color: var(--primary);
    transform: translateX(4px);
    box-shadow: 0 4px 15px rgba(231,76,60,0.2);
}

.option-btn:hover::before { left: 100%; }

.option-btn.selected {
    background: rgba(231,76,60,0.25);
    border-color: var(--primary);
    transform: scale(0.97);
    box-shadow: 0 0 20px rgba(231,76,60,0.3);
}

.option-btn:disabled {
    opacity: 0.5;
    cursor: default;
    background: rgba(255,255,255,0.02);
}

.opt-emoji { font-size: 22px; flex-shrink: 0; }
.opt-text { flex: 1; }

/* === LOADING SCREEN === */
.loading-screen {
    text-align: center;
    gap: 24px;
}

.loading-icon {
    font-size: 72px;
    animation: brainFloat 2s ease-in-out infinite;
}

.loading-bar {
    width: 280px;
    height: 6px;
    background: var(--surface);
    border-radius: 3px;
    overflow: hidden;
}

.loading-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #e91e63);
    transition: width 0.3s ease;
    border-radius: 3px;
}

.loading-text {
    color: var(--text-sec);
    font-size: 15px;
}

/* === RESULT SCREEN === */
.result-screen {
    justify-content: flex-start;
    padding-top: 24px;
    gap: 0;
}

.result-title {
    font-size: 24px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 20px;
    animation: slideInDown 0.5s ease-out;
}

/* Gauge */
.gauge-area {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    animation: fadeUp 0.5s ease-out 0.1s both;
}

.gauge-ring {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

#gauge-fill {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: conic-gradient(var(--primary) 0deg, var(--primary) 0deg, rgba(255,255,255,0.08) 0deg);
    transition: background 1.2s ease;
}

.gauge-inner {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--surface);
}

.gauge-percent {
    font-size: 42px;
    font-weight: 900;
    color: var(--text);
}

.gauge-label {
    font-size: 12px;
    color: var(--text-sec);
    margin-top: 2px;
}

.result-emoji {
    font-size: 56px;
    text-align: center;
    margin: 16px 0 8px;
    animation: fadeUp 0.5s ease-out 0.2s both;
}

.result-level-title {
    font-size: 26px;
    font-weight: 800;
    text-align: center;
    animation: fadeUp 0.5s ease-out 0.25s both;
}

.result-level-subtitle {
    font-size: 15px;
    color: var(--text-sec);
    text-align: center;
    margin-bottom: 16px;
    animation: fadeUp 0.5s ease-out 0.3s both;
}

.result-desc {
    font-size: 14px;
    color: var(--text-sec);
    line-height: 1.7;
    text-align: center;
    padding: 0 8px;
    margin-bottom: 20px;
    animation: fadeUp 0.5s ease-out 0.35s both;
}

.detail-section {
    width: 100%;
    max-width: 480px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 12px;
    animation: fadeUp 0.5s ease;
}

.detail-section h3 {
    font-size: 16px;
    margin-bottom: 12px;
    font-weight: 700;
}

.detail-section ul {
    list-style: none;
}

.detail-section li {
    padding: 6px 0;
    font-size: 14px;
    color: var(--text-sec);
    border-bottom: 1px solid var(--border);
    line-height: 1.5;
}

.detail-section li:last-child {
    border-bottom: none;
}

.detail-section li::before {
    content: '✓';
    color: var(--success);
    margin-right: 8px;
    font-weight: 700;
}

/* Radar bars */
.radar-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radar-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.radar-label {
    font-size: 13px;
    color: var(--text-sec);
    min-width: 100px;
    white-space: nowrap;
}

.radar-bar-bg {
    flex: 1;
    height: 10px;
    background: rgba(255,255,255,0.06);
    border-radius: 5px;
    overflow: hidden;
}

.radar-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #e91e63);
    border-radius: 5px;
    transition: width 1s ease;
}

.radar-value {
    font-size: 13px;
    font-weight: 700;
    min-width: 40px;
    text-align: right;
    color: var(--primary-light);
}

/* Premium button */
.btn-premium {
    width: 100%;
    max-width: 480px;
    padding: 16px;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 12px 0;
    min-height: 52px;
    position: relative;
    overflow: hidden;
    animation: slideInUp 0.6s ease-out 0.2s both;
}

.btn-premium::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-premium:hover::before { opacity: 1; }
.btn-premium:hover {
    transform: scale(1.04);
    box-shadow: 0 10px 35px rgba(243,156,18,0.5);
}

.btn-premium:active { transform: scale(0.98); }

/* Action buttons */
.action-buttons {
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 480px;
    margin: 8px 0;
    flex-wrap: wrap;
    animation: slideInUp 0.6s ease-out 0.25s both;
}

.btn-share, .btn-save-image, .btn-retry {
    flex: 1;
    min-width: 120px;
    padding: 14px 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    min-height: 48px;
    position: relative;
}

.btn-share:hover, .btn-save-image:hover, .btn-retry:hover {
    background: rgba(231,76,60,0.15);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(231,76,60,0.15);
}

/* Ad overlay */
.ad-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 20px;
}

.ad-overlay.active { display: flex; }

.ad-modal {
    text-align: center;
    color: var(--text);
}

.ad-modal p {
    font-size: 14px;
    color: var(--text-sec);
    margin-bottom: 16px;
}

.ad-placeholder {
    width: 300px;
    height: 250px;
    background: var(--surface);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    font-size: 13px;
    margin: 0 auto 16px;
}

#ad-countdown {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-light);
}

#ad-close {
    display: none;
    padding: 14px 40px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: var(--primary);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    min-height: 48px;
}

/* === RECOMMENDATIONS === */
.recommendations-section {
    width: 100%;
    max-width: 480px;
    margin-top: 24px;
    padding: 0 4px;
    animation: slideInUp 0.6s ease-out 0.3s both;
}

.rec-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-sec);
    margin-bottom: 12px;
    text-align: center;
    letter-spacing: 0.5px;
}

.rec-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rec-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
}

.rec-card:hover, .rec-card:active {
    background: rgba(255,255,255,0.1);
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(231,76,60,0.2);
}

.rec-icon {
    font-size: 28px;
    flex-shrink: 0;
    width: 40px;
    text-align: center;
    transition: transform 0.3s;
}

.rec-card:hover .rec-icon {
    transform: scale(1.2) rotate(10deg);
}

.rec-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.rec-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rec-desc {
    font-size: 12px;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* App Loader */
.app-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.app-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-content {
    text-align: center;
}

.loader-emoji {
    font-size: 64px;
    margin-bottom: 20px;
    animation: brainFloat 2s ease-in-out infinite;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 20px;
    border: 3px solid var(--surface);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loader-text {
    color: var(--text-sec);
    font-size: 14px;
}

/* Responsive */
@media (max-width: 360px) {
    .intro-title { font-size: 28px; }
    .q-text { font-size: 17px; }
    .gauge-percent { font-size: 36px; }
    .result-title { font-size: 22px; }
}

/* Accessibility */
button:focus-visible,
a:focus-visible,
input:focus-visible,
[role="button"]:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

button, a[href], input[type="button"], input[type="submit"], [role="button"] {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus { top: 0; }

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@media (prefers-contrast: more) {
    button { border: 2px solid var(--primary); }
}

.rec-card:focus-visible, .option-btn:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 4px;
}

/* === LANGUAGE SELECTOR === */
.language-selector {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999;
}

.lang-btn {
    background: rgba(231,76,60,0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(231,76,60,0.4);
    color: #fff;
    font-size: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.lang-btn:hover {
    background: rgba(231,76,60,0.5);
    transform: scale(1.05);
}

.lang-menu {
    position: absolute;
    top: 52px;
    right: 0;
    background: rgba(15,10,30,0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(231,76,60,0.3);
    border-radius: 12px;
    padding: 8px;
    min-width: 150px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.lang-menu.hidden {
    display: none;
}

.lang-option {
    width: 100%;
    padding: 10px 14px;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    border-radius: 8px;
    font-size: 14px;
    color: #e0d8f8;
    transition: background 0.2s;
    min-width: 44px;
    min-height: 44px;
}

.lang-option:hover {
    background: rgba(231,76,60,0.2);
}

.lang-option.active {
    background: rgba(231,76,60,0.3);
    font-weight: 600;
    color: #fff;
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 76px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(231,76,60,0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(231,76,60,0.4);
    color: var(--text);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle:hover {
    background: rgba(231,76,60,0.5);
    transform: scale(1.05);
}

.theme-toggle:active {
    transform: scale(0.95);
}

/* Enhanced button accessibility */
button:focus-visible,
input[type="button"]:focus-visible,
input[type="submit"]:focus-visible,
[role="button"]:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 2px;
}

button:active,
input[type="button"]:active,
input[type="submit"]:active,
[role="button"]:active {
    transform: scale(0.98);
}

/* High contrast mode */
@media (prefers-contrast: more) {
    button,
    input[type="button"],
    input[type="submit"],
    [role="button"] {
        border: 2px solid currentColor;
        font-weight: bold;
    }
}

/* Enhanced form accessibility */
label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    font-size: 16px;
    min-height: 44px;
    padding: 10px 12px;
}

input[type="text"]:focus-visible,
input[type="email"]:focus-visible,
input[type="password"]:focus-visible,
input[type="number"]:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 1px;
}

/* Error handling accessibility */
.error-message,
[aria-invalid="true"] {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

[aria-invalid="true"] {
    border-color: #dc2626;
}

/* Non-color focus indicators */
:focus-visible {
    outline-width: 3px;
}

/* Icon patterns for colorblind users */
.error::before {
    content: "x ";
}

.success::before {
    content: "✓ ";
}

.warning::before {
    content: "! ";
}

.info::before {
    content: "i ";
}

/* High contrast scrollbar */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark, #f1f5f9);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color, #3b82f6);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark, #1e40af);
}

/* Firefox scrollbar */
* {
    scrollbar-color: var(--primary-color, #3b82f6) var(--bg-dark, #f1f5f9);
    scrollbar-width: thin;
}

/* Selection Color */
::selection {
    background: #e74c3c;
    color: white;
}

::-moz-selection {
    background: #e74c3c;
    color: white;
}
