/* ============================================
   ACCESSIBILITY FIXES - WCAG 2.1 Level AA
   ============================================ */

/* 1. KEYBOARD FOCUS INDICATORS */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 3px solid #a8d5ba;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Remove outline for mouse users */
button:focus:not(:focus-visible) {
    outline: none;
}

/* 2. PREFERS REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
    /* Disable all animations */
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    /* Specifically disable atmospheric effects */
    .ember,
    .firefly,
    .smoke,
    .spark,
    .flame-particle {
        display: none !important;
    }
}

/* 3. COLOR CONTRAST FIXES */

/* Auth modal - Better contrast */
.auth-modal-content {
    /* Use white panel instead of wood texture */
    background: #ffffff !important;
    color: #2d1b00 !important;
}

.auth-modal-title {
    color: #2d1b00 !important;
    text-shadow: none !important;
}

/* Mint accent text - Lighter shade */
.status-dot-green,
.profile-level {
    background: #b5ddc4 !important; /* Lighter mint for better contrast */
}

/* Fire orange buttons - Styles now in styles.css (carved wood design) */
.status-btn-coming {
    background: linear-gradient(135deg, #d94500 0%, #d46300 100%) !important;
}

/* 4. ARIA LABELS (via CSS content for visual hint) */
.settings-btn::after {
    content: 'Настройки';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -20px;
    font-size: 10px;
    color: #666;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
}

.settings-btn:focus-visible::after,
.settings-btn:hover::after {
    opacity: 1;
}

/* 5. MINIMUM TOUCH TARGETS - 44x44px */
.touch-target,
button,
.action-btn,
.tab-button {
    min-width: 44px !important;
    min-height: 44px !important;
}

/* Message reaction buttons */
.reaction-button {
    min-width: 48px !important;
    min-height: 32px !important;
    padding: 6px 12px !important;
}

/* 6. SKIP TO CONTENT LINK */
.skip-to-content {
    position: absolute;
    top: -100px;
    left: 0;
    background: #ff6b35;
    color: white;
    padding: 12px 24px;
    z-index: 10000;
    border-radius: 0 0 8px 0;
    font-weight: bold;
}

.skip-to-content:focus {
    top: 0;
}

/* 7. SCREEN READER ONLY TEXT */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* 8. HIGH CONTRAST MODE SUPPORT */
@media (prefers-contrast: high) {
    button,
    .action-btn,
    .tab-button {
        border: 2px solid currentColor !important;
    }

    .campfire-window,
    .profile-header,
    .around-fire-enhanced {
        border: 3px solid currentColor !important;
    }
}
