/* Accessibility improvements for RR Hybrid */

/* Focus management */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Skip navigation link */
.skip-nav {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 1000;
    border-radius: 0 0 4px 4px;
}

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

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #000080;
        --text-dark: #000000;
        --bg-white: #ffffff;
        --border-color: #000000;
    }
    
    .card {
        border: 2px solid #000000;
    }
    
    .btn {
        border-width: 2px;
    }
}

/* Reduced motion preferences */
@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;
    }
    
    .card:hover {
        transform: none;
    }
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus indicators for interactive elements */
.btn:focus,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(25, 118, 210, 0.25);
}

/* Improved form labels */
.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-label[aria-required="true"]::after {
    content: " *";
    color: var(--danger);
}

/* Error state improvements */
.is-invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 0.25rem rgba(244, 67, 54, 0.25);
}

.invalid-feedback {
    display: block;
    color: var(--danger);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Progress indicators with ARIA */
.progress {
    background-color: #e9ecef;
    overflow: hidden;
}

.progress-bar {
    background-color: var(--primary-color);
    transition: width 0.6s ease;
}

.progress[aria-valuenow] .progress-bar::after {
    content: attr(aria-valuenow) "%";
    position: absolute;
    right: 10px;
    color: white;
    font-weight: bold;
}

/* Modal accessibility */
.modal-dialog {
    margin: 1.75rem auto;
}

.modal-header .btn-close {
    margin: -0.5rem -0.5rem -0.5rem auto;
}

/* Table accessibility */
table {
    border-collapse: collapse;
}

th {
    background-color: var(--bg-light);
    font-weight: 600;
    text-align: left;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
}

td {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
}

/* Navigation improvements */
.navbar-nav .nav-link {
    position: relative;
}

.navbar-nav .nav-link:focus {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Loading states */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin-top: -10px;
    margin-left: -10px;
    border: 2px solid var(--primary-color);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spinner 0.8s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Notification improvements */
.alert {
    border-radius: 4px;
    border-width: 2px;
}

.alert-dismissible {
    padding-right: 3rem;
}

/* File upload accessibility */
.file-upload-area {
    cursor: pointer;
    position: relative;
}

.file-upload-area:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(25, 118, 210, 0.25);
}

.file-upload-area input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* Workflow step accessibility */
.workflow-progress .step {
    position: relative;
}

.workflow-progress .step:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 4px;
}

.workflow-progress .step[aria-current="step"] .step-icon {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Enhanced tooltips */
.tooltip {
    font-size: 0.875rem;
}

.tooltip-inner {
    max-width: 200px;
    text-align: left;
    background-color: var(--text-dark);
    color: white;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-light: #121212;
        --bg-white: #1e1e1e;
        --text-dark: #ffffff;
        --text-medium: #b0b0b0;
        --border-color: #333333;
    }
    
    body {
        background-color: var(--bg-light);
        color: var(--text-dark);
    }
    
    .card {
        background-color: var(--bg-white);
        border-color: var(--border-color);
    }
    
    .form-control,
    .form-select {
        background-color: var(--bg-white);
        border-color: var(--border-color);
        color: var(--text-dark);
    }
    
    .table {
        color: var(--text-dark);
    }
    
    .table-striped tbody tr:nth-of-type(odd) {
        background-color: rgba(255, 255, 255, 0.05);
    }
} 