/**
 * Accessibility Enhancements
 * Phase 4: Polish & Interaction
 */

/* ===== Focus Indicators ===== */
*:focus-visible {
    outline: 2px solid var(--robinhood-success);
    outline-offset: 2px;
    border-radius: var(--robinhood-radius-sm);
}

/* Skip to main content link (for screen readers) */
.robinhood-skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--robinhood-success);
    color: white;
    padding: var(--robinhood-space-2) var(--robinhood-space-4);
    text-decoration: none;
    border-radius: 0 0 var(--robinhood-radius-sm) 0;
    z-index: var(--robinhood-z-modal);
    font-weight: var(--robinhood-weight-semibold);
}

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

/* ===== Color Contrast Improvements ===== */
/* 텍스트와 배경의 대비를 높이기 위한 유틸리티 클래스 */
.robinhood-text-high-contrast {
    color: var(--robinhood-text-primary);
    font-weight: var(--robinhood-weight-medium);
}

/* ===== Keyboard Navigation ===== */
/* 키보드로 접근 가능한 모든 인터랙티브 요소 */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus,
[tabindex]:focus {
    outline: 2px solid var(--robinhood-success);
    outline-offset: 2px;
}

/* ===== Screen Reader Only ===== */
.robinhood-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;
}

/* ===== ARIA Labels Support ===== */
[aria-label] {
    position: relative;
}

[aria-label]:hover::after {
    content: attr(aria-label);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--robinhood-text-primary);
    color: white;
    padding: var(--robinhood-space-2) var(--robinhood-space-3);
    border-radius: var(--robinhood-radius-sm);
    font-size: var(--robinhood-font-caption);
    white-space: nowrap;
    margin-bottom: var(--robinhood-space-1);
    z-index: var(--robinhood-z-dropdown);
    pointer-events: none;
}

/* ===== 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;
        scroll-behavior: auto !important;
    }
}

/* ===== High Contrast Mode Support ===== */
@media (prefers-contrast: high) {
    .robinhood-card,
    .robinhood-metric-card {
        border: 2px solid var(--robinhood-text-primary);
    }
    
    .robinhood-btn {
        border: 2px solid currentColor;
    }
}

/* ===== Touch Target Sizes (Mobile Accessibility) ===== */
@media (max-width: 768px) {
    a,
    button,
    input[type="button"],
    input[type="submit"],
    .robinhood-btn {
        min-height: 44px;
        min-width: 44px;
    }
}
