/* Accessibility Enhancements */

/* Loading States */
.loading-state {
    position: relative;
    pointer-events: none;
}

.loading-state::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 1rem 2rem;
    border-radius: 4px;
    z-index: 1001;
    display: none;
}

.loading .loading-indicator {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Error States */
.error-message {
    color: var(--error-color);
    background: #fff;
    border: 2px solid var(--error-color);
    padding: 0.5rem 1rem;
    margin: 0.5rem 0;
    border-radius: 4px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.error-message::before {
    content: "⚠️";
}

/* Form Validation Styles */
.form-control.is-invalid {
    border-color: var(--error-color);
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* Reduced Motion */
@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;
    }

    .navbar-collapse {
        transition: none !important;
    }

    .loading-state::after {
        transition: none !important;
    }
}

/* High Contrast Mode Support */
@media (forced-colors: active) {
    .btn,
    .nav-link,
    .dropdown-item {
        border: 1px solid transparent;
    }

    .btn:focus,
    .nav-link:focus,
    .dropdown-item:focus {
        outline: 2px solid ButtonText;
    }
}

/* Live Region Styles */
.sr-live-region {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}