/*
Accessibility CSS Framework voor Routemeister
==============================================
WCAG 2.1 AA compliant accessibility features
*/

/* ========================================
   FOCUS MANAGEMENT
   ======================================== */

/* Focus indicators - zichtbaar en duidelijk */
*:focus {
    outline: 3px solid #007bff;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

/* Focus voor buttons */
button:focus,
.btn:focus,
input[type="button"]:focus,
input[type="submit"]:focus {
    outline: 3px solid #28a745;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.25);
}

/* Focus voor form inputs */
input:focus,
select:focus,
textarea:focus {
    outline: 3px solid #007bff;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
    border-color: #007bff;
}

/* Focus voor links */
a:focus {
    outline: 3px solid #007bff;
    outline-offset: 2px;
    text-decoration: underline;
}

/* ========================================
   KEYBOARD NAVIGATION
   ======================================== */

/* Skip links voor keyboard users */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

/* Keyboard navigation voor dropdowns */
.dropdown-menu {
    display: none;
}

.dropdown-menu.show {
    display: block;
}

/* Keyboard navigation voor modals */
.modal {
    display: none;
}

.modal.show {
    display: block;
}

/* Focus trap voor modals */
.modal:focus-within {
    outline: none;
}

/* ========================================
   SCREEN READER SUPPORT
   ======================================== */

/* 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: 0;
}

/* Screen reader only but focusable */
.sr-only-focusable:focus {
    position: static;
    width: auto;
    height: auto;
    padding: inherit;
    margin: inherit;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* ========================================
   ARIA LABELS EN ROLES
   ======================================== */

/* ARIA landmarks */
[role="banner"] {
    /* Header content */
}

[role="navigation"] {
    /* Navigation content */
}

[role="main"] {
    /* Main content */
}

[role="complementary"] {
    /* Sidebar content */
}

[role="contentinfo"] {
    /* Footer content */
}

/* ARIA live regions voor dynamic content */
[aria-live="polite"] {
    /* Non-intrusive announcements */
}

[aria-live="assertive"] {
    /* Urgent announcements */
}

/* ARIA expanded states */
[aria-expanded="true"] {
    /* Expanded state styling */
}

[aria-expanded="false"] {
    /* Collapsed state styling */
}

/* ========================================
   COLOR CONTRAST EN VISIBILITY
   ======================================== */

/* High contrast mode support */
@media (prefers-contrast: high) {
    * {
        border-color: currentColor;
    }
    
    button, .btn {
        border: 2px solid currentColor;
    }
    
    input, select, textarea {
        border: 2px solid currentColor;
    }
}

/* 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;
    }
}

/* ========================================
   FORM ACCESSIBILITY
   ======================================== */

/* Required field indicators */
.required::after {
    content: " *";
    color: #dc3545;
    font-weight: bold;
}

/* Error states */
.form-error {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.25);
}

.error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

/* Success states */
.form-success {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.25);
}

.success-message {
    color: #28a745;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

/* Field descriptions */
.field-description {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* ========================================
   TABLE ACCESSIBILITY
   ======================================== */

/* Table headers */
th {
    background-color: #f8f9fa;
    font-weight: 600;
    text-align: left;
    padding: 0.75rem;
}

/* Table captions */
caption {
    font-weight: 600;
    text-align: left;
    margin-bottom: 0.5rem;
}

/* Table with proper spacing */
table {
    border-collapse: collapse;
    width: 100%;
}

td, th {
    border: 1px solid #dee2e6;
    padding: 0.75rem;
}

/* ========================================
   BUTTON ACCESSIBILITY
   ======================================== */

/* Button states */
button:disabled,
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Button loading states */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   MODAL ACCESSIBILITY
   ======================================== */

/* Modal backdrop */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
}

/* Modal content */
.modal-content {
    position: relative;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1050;
}

/* Modal header */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
}

/* Modal body */
.modal-body {
    padding: 1rem;
}

/* Modal footer */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem;
    border-top: 1px solid #dee2e6;
}

/* ========================================
   DRAG & DROP ACCESSIBILITY
   ======================================== */

/* Drag and drop indicators */
.drag-handle {
    cursor: grab;
    padding: 0.5rem;
    border-radius: 4px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
}

.drag-handle:active {
    cursor: grabbing;
}

/* Drop zones */
.drop-zone {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    background: #f8f9fa;
    transition: all 0.2s ease;
}

.drop-zone.drag-over {
    border-color: #007bff;
    background: rgba(0, 123, 255, 0.1);
}

/* ========================================
   MAP ACCESSIBILITY
   ======================================== */

/* Map controls */
.map-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.map-control {
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
}

.map-control:hover {
    background: #f8f9fa;
}

.map-control:focus {
    outline: 3px solid #007bff;
    outline-offset: 2px;
}

/* ========================================
   LOADING STATES
   ======================================== */

/* Loading spinners */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Loading text */
.loading-text {
    color: #6c757d;
    font-style: italic;
}

/* ========================================
   ERROR STATES
   ======================================== */

/* Error alerts */
.alert-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

/* Warning alerts */
.alert-warning {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

/* Success alerts */
.alert-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

/* Text sizes */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }

/* Font weights */
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* Spacing */
.m-0 { margin: 0; }
.m-1 { margin: 0.25rem; }
.m-2 { margin: 0.5rem; }
.m-3 { margin: 1rem; }
.m-4 { margin: 1.5rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }

