/* ============================================
   BARRIEREFREIHEIT CSS
   WCAG AA Konform - Hohe Kontraste
   ============================================ */

/* ============================================
   CSS VARIABLEN - NORMALE FARBEN
   ============================================ */
:root {
    /* Primärfarben - WCAG AA konform */
    --color-primary: #3d4db7;           /* Dunkleres Blau (war #667eea) - Kontrast 4.5:1 */
    --color-primary-hover: #2e3d8f;     /* Noch dunkler für Hover */
    --color-primary-light: #e8eaf6;     /* Heller Hintergrund */
    
    /* Sekundärfarben */
    --color-success: #1e7e34;           /* Dunkleres Grün (war #28a745) - Kontrast 4.5:1 */
    --color-success-hover: #155724;
    --color-success-light: #d4edda;
    
    /* Grautöne */
    --color-gray-dark: #333333;
    --color-gray-medium: #666666;
    --color-gray-light: #f5f5f5;
    --color-border: #ddd;
    
    /* Hintergrundfarben */
    --bg-white: #ffffff;
    --bg-gradient-green: linear-gradient(135deg, #b8e986 0%, #94c41c 100%);
    
    /* Text */
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-white: #ffffff;
    
    /* Fehler */
    --color-error: #721c24;
    --color-error-bg: #f8d7da;
    --color-error-border: #f5c6cb;
    
    /* Warnung */
    --color-warning: #856404;
    --color-warning-bg: #fff3cd;
    --color-warning-border: #ffc107;
}

/* ============================================
   HOCHKONTRAST-MODUS
   Wird aktiviert wenn body.high-contrast gesetzt ist
   ============================================ */
body.high-contrast {
    /* Extreme Kontraste für maximale Lesbarkeit */
    --color-primary: #0000cc;           /* Reines dunkles Blau - Kontrast 8.6:1 */
    --color-primary-hover: #000099;
    --color-primary-light: #e6e6ff;
    
    --color-success: #006600;           /* Reines dunkles Grün - Kontrast 7.4:1 */
    --color-success-hover: #004400;
    --color-success-light: #e6ffe6;
    
    --color-gray-dark: #000000;
    --color-gray-medium: #333333;
    --text-primary: #000000;
    --text-secondary: #000000;
    
    --color-border: #000000;
    --bg-white: #ffffff;
    
    /* Stärkere Schatten im Hochkontrast-Modus */
    --shadow-normal: 0 4px 8px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 6px 12px rgba(0, 0, 0, 0.4);
}

body.high-contrast * {
    /* Alle Texte schwarz für maximalen Kontrast */
    color: #000000 !important;
}

body.high-contrast a,
body.high-contrast .agb-link-inline,
body.high-contrast .room-info-number,
body.high-contrast .back-link a {
    color: #0000cc !important;
    text-decoration: underline;
    font-weight: 600;
}

body.high-contrast .room-price {
    color: #006600 !important;
    font-weight: 700;
}

body.high-contrast .btn-primary,
body.high-contrast button[type="submit"] {
    background: #0000cc !important;
    color: #ffffff !important;
    border: 3px solid #000000 !important;
    font-weight: 700;
}

body.high-contrast .btn-primary:hover,
body.high-contrast button[type="submit"]:hover {
    background: #000099 !important;
    border-color: #000000 !important;
}

body.high-contrast input,
body.high-contrast select,
body.high-contrast textarea {
    border: 2px solid #000000 !important;
    background: #ffffff !important;
    color: #000000 !important;
}

body.high-contrast input:focus,
body.high-contrast select:focus,
body.high-contrast textarea:focus {
    border: 3px solid #0000cc !important;
    outline: 3px solid #0000cc !important;
}

/* ============================================
   SKIP NAVIGATION
   ============================================ */
.skip-navigation {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-primary);
    color: var(--text-white);
    padding: 8px 16px;
    text-decoration: none;
    font-weight: 600;
    z-index: 10000;
    border-radius: 0 0 4px 0;
}

.skip-navigation:focus {
    top: 0;
    outline: 3px solid #ffc107;
}

/* ============================================
   ACCESSIBILITY TOGGLE BUTTON
   ============================================ */
.accessibility-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    background: var(--color-primary);
    color: var(--text-white);
    border: 2px solid var(--color-primary);
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.accessibility-toggle:hover {
    background: var(--color-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.accessibility-toggle:focus {
    outline: 3px solid #ffc107;
    outline-offset: 2px;
}

.accessibility-toggle .icon {
    font-size: 18px;
}

body.high-contrast .accessibility-toggle {
    background: #0000cc !important;
    color: #ffffff !important;
    border: 3px solid #000000 !important;
    font-weight: 700;
}

body.high-contrast .accessibility-toggle:hover {
    background: #000099 !important;
}

/* ============================================
   SEMANTISCHE HTML5 ELEMENTE
   ============================================ */
header {
    background: var(--bg-white);
    padding: 20px;
    border-bottom: 2px solid var(--color-border);
}

nav {
    background: var(--color-primary-light);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

main {
    min-height: 60vh;
}

footer {
    background: var(--color-gray-light);
    padding: 20px;
    margin-top: 40px;
    border-top: 2px solid var(--color-border);
    text-align: center;
}

/* ============================================
   FOKUS-INDIKATOREN
   Verbesserte Sichtbarkeit für Tastaturnavigation
   ============================================ */
*:focus {
    outline: 3px solid #ffc107;
    outline-offset: 2px;
}

body.high-contrast *:focus {
    outline: 4px solid #ffc107 !important;
    outline-offset: 3px;
}

/* ============================================
   ARIA LIVE REGIONS
   ============================================ */
[aria-live="polite"],
[aria-live="assertive"] {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ============================================
   TABELLEN ACCESSIBILITY
   ============================================ */
table {
    border-collapse: collapse;
    width: 100%;
}

body.high-contrast table,
body.high-contrast th,
body.high-contrast td {
    border: 2px solid #000000 !important;
}

body.high-contrast th {
    background: #e6e6e6 !important;
    font-weight: 700;
}

/* ============================================
   FORMULARE ACCESSIBILITY
   ============================================ */
label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

body.high-contrast label {
    font-weight: 700;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
select,
textarea {
    border: 2px solid var(--color-border);
    padding: 12px;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--color-primary);
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

/* Fehlermeldungen */
.errorlist {
    background: var(--color-error-bg);
    border: 2px solid var(--color-error-border);
    color: var(--color-error);
    padding: 10px;
    border-radius: 5px;
    margin-top: 5px;
    font-weight: 600;
}

body.high-contrast .errorlist {
    border: 3px solid #cc0000 !important;
    background: #ffe6e6 !important;
    color: #cc0000 !important;
    font-weight: 700;
}

/* ============================================
   BUTTONS ACCESSIBILITY
   ============================================ */
button,
.btn-primary,
.btn-secondary {
    padding: 12px 30px;
    font-size: 16px;
    border: 2px solid transparent;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.btn-primary,
button[type="submit"] {
    background: var(--color-primary);
    color: var(--text-white);
    border-color: var(--color-primary);
}

.btn-primary:hover,
button[type="submit"]:hover {
    background: var(--color-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(61, 77, 183, 0.4);
}

/* ============================================
   LINKS ACCESSIBILITY
   ============================================ */
a {
    color: var(--color-primary);
    text-decoration: underline;
    font-weight: 500;
}

a:hover {
    color: var(--color-primary-hover);
}

a:focus {
    outline: 3px solid #ffc107;
    outline-offset: 2px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    .accessibility-toggle {
        top: 10px;
        right: 10px;
        padding: 10px 15px;
        font-size: 12px;
    }
    
    .skip-navigation {
        font-size: 14px;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .accessibility-toggle,
    .skip-navigation {
        display: none;
    }
    
    body.high-contrast {
        background: white;
    }
}

/* ============================================
   SCREEN READER ONLY
   ============================================ */
.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;
}

/* ============================================
   KONTRAST-FIXES FÜR SPEZIFISCHE ELEMENTE
   ============================================ */
.room-info-number {
    color: var(--color-primary);
    font-weight: 700;
}

.room-price {
    color: var(--color-success);
    font-weight: 700;
}

.agb-link-inline {
    color: var(--color-primary);
    text-decoration: underline;
    font-weight: 600;
}

.back-link a {
    color: var(--color-primary);
    text-decoration: underline;
}

/* ============================================
   HOCHKONTRAST INDIKATOR
   ============================================ */
body.high-contrast::before {
    content: "Hochkontrast-Modus aktiv";
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: #000000;
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    z-index: 9998;
    border: 2px solid #ffc107;
}

@media (max-width: 768px) {
    body.high-contrast::before {
        bottom: 10px;
        left: 10px;
        font-size: 10px;
        padding: 6px 12px;
    }
}
