/* Moderner Cookie-Banner mit Glasmorphism */
.cookie-banner {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
    max-width: 320px;
    animation: slideInLeft 0.4s ease-out;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.cookie-banner-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1), 0 4px 16px rgba(0,0,0,0.05);
    border-left: 4px solid #1976d2;
}

.cookie-banner p {
    margin: 0 0 15px 0;
    font-size: 15px;
    font-weight: 400; /* Normal statt 600 (fett) */
    color: #333;
    line-height: 1.4;
}

.cookie-policy-link {
    color: #1976d2;
    text-decoration: none;
    font-weight: 700;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.cookie-policy-link:hover {
    color: #1565c0;
    border-bottom-color: #1565c0;
    text-decoration: none;
}

.cookie-toggles {
    margin: 15px 0;
    background: rgba(249, 250, 251, 0.8);
    border-radius: 12px;
    padding: 16px;
}

.cookie-toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 12px 0;
    font-size: 14px;
    font-weight: 500;
    color: #555;
}

.cookie-toggle-item:first-child {
    margin-top: 0;
}

.cookie-toggle-item:last-child {
    margin-bottom: 0;
}

.cookie-toggle-item label {
    cursor: pointer;
    transition: color 0.2s ease;
    flex: 1;
    margin: 0;
    font-weight: 400; /* Normal statt 500 */
    user-select: none; /* Verhindert Textauswahl beim Klicken */
}

.cookie-toggle-item label:hover {
    color: #1976d2;
}

/* Toggle Switch Styling */
.toggle-switch {
    position: relative;
    width: 50px;
    height: 24px;
    display: inline-block;
    cursor: pointer; /* Klickbar machen */
}

.toggle-switch input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
    pointer-events: none; /* Verhindert direkte Klicks auf Input */
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s ease;
    border-radius: 24px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s ease;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Aktivierter Toggle - basierend auf checkbox:checked */
.toggle-switch input[type="checkbox"]:checked + .toggle-slider {
    background-color: #1976d2;
    box-shadow: inset 0 2px 4px rgba(25, 118, 210, 0.2);
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider:before {
    transform: translateX(26px);
}

/* Deaktivierter Toggle (für notwendige Cookies) */
.toggle-slider[data-disabled="true"] {
    background-color: #4caf50 !important;
    cursor: not-allowed;
    opacity: 0.8;
}

.toggle-slider[data-disabled="true"]:before {
    transform: translateX(26px);
    background-color: #e8f5e8;
}

/* Hover-Effekte */
.toggle-switch:hover .toggle-slider:not([data-disabled="true"]) {
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.15), 0 0 0 3px rgba(25, 118, 210, 0.1);
}

.toggle-switch input[type="checkbox"]:checked:hover + .toggle-slider:not([data-disabled="true"]) {
    background-color: #1565c0;
}

.cookie-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.cookie-actions button {
    flex: 1;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: none;
    min-height: 44px;
}

/* Einstellungen speichern Button (Sekundär) */
.cookie-actions button[data-action="save"] {
    background: #42a5f5;
    color: white;
    border: 2px solid transparent;
    font-weight: 700;
}

.cookie-actions button[data-action="save"]:hover {
    background: #1976d2;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(66, 165, 245, 0.4);
    border-color: transparent;
}

/* Alle akzeptieren Button (Primär) */
.cookie-actions button[data-action="accept"] {
    background: #4caf50;
    color: white;
    border: 2px solid transparent;
    font-weight: 700;
}

.cookie-actions button[data-action="accept"]:hover {
    background: #388e3c;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.4);
}

/* Aktive/Focus States */
.cookie-actions button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.2);
}

.cookie-actions button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Bug-Report Button - Maximale Spezifität */
button#bug-report-trigger.bug-report-trigger {
    position: fixed !important;
    bottom: 70px !important; /* 50px höher (war 20px, jetzt 70px) */
    right: 20px !important;
    z-index: 99999 !important;
    display: none !important; /* Initial versteckt, wird durch JavaScript aktiviert */
    visibility: hidden !important; /* Initial versteckt, wird durch JavaScript aktiviert */
    opacity: 0 !important; /* Initial versteckt, wird durch JavaScript aktiviert */
    background: rgba(255, 255, 255, 0.5) !important; /* Weißer Hintergrund mit 50% Transparenz */
    color: #333 !important; /* Dunkler Text für besseren Kontrast */
    border: none !important; /* Keine Umrandung */
    border-radius: 50% !important;
    width: 32px !important; /* 35% kleiner: 50px → 32px */
    height: 32px !important; /* 35% kleiner: 50px → 32px */
    cursor: pointer !important;
    font-size: 14px !important; /* Proportional angepasst: 18px → 14px */
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2) !important; /* Neutraler Schatten */
    transition: all 0.3s ease !important;
    margin: 0 !important;
    padding: 0 !important;
    outline: none !important;
    text-align: center !important;
    line-height: 32px !important; /* Angepasst an neue Höhe */
    backdrop-filter: blur(10px) !important; /* Glasmorphism-Effekt */
}

button#bug-report-trigger.bug-report-trigger:hover {
    transform: scale(1.1) !important; /* Hover-Skalierung bleibt gleich */
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3) !important;
    background: rgba(255, 255, 255, 0.8) !important; /* Mehr Deckkraft beim Hover */
}

/* Bug-Button für mobile Geräte und kleine Bildschirme ausblenden */
@media screen and (max-width: 768px) {
    button#bug-report-trigger.bug-report-trigger {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
}

/* Bug-Button auch für sehr kleine Desktop-Fenster ausblenden */
@media screen and (max-height: 600px) {
    button#bug-report-trigger.bug-report-trigger {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
}

/* Bug-Button für Touch-Geräte ausblenden (zusätzlicher Schutz) */
@media (hover: none) and (pointer: coarse) {
    button#bug-report-trigger.bug-report-trigger {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
}

/* Tasten-Icons für Buttons */
.key-icon {
    display: inline-block;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 4px 8px;
    margin-left: 8px;
    font-size: 12px;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1;
}

/* Cookie-Banner spezifische Key-Badge Styles */
.cookie-banner .keyboard-number-hint {
    position: absolute !important;
    top: -8px !important;
    left: -8px !important;
    background: #FF6B35 !important; /* Orange für Cookie-Banner */
    border-color: #E55A2B !important;
    color: white !important;
    border-radius: 50% !important;
    width: 20px !important;
    height: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 12px !important;
    font-weight: bold !important;
    z-index: 10001 !important;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.4) !important;
    border: 2px solid #E55A2B !important;
    animation: keyboardHintPulse 1s ease-in-out !important;
}

.cookie-banner .keyboard-number-hint.active {
    background: #4caf50 !important; /* Grün bei Aktivierung */
    border-color: #388e3c !important;
    animation: keyboardHintActive 0.3s ease-in-out !important;
}

/* Stelle sicher dass Cookie-Banner Buttons relative Position haben */
.cookie-banner .cookie-action-btn {
    position: relative !important;
}

/* Zentrale Key-Badges im Stil der Hauptanwendung (rechteckig mit weißem Rahmen) */
.central-key-badge {
    position: absolute;
    bottom: -12px; /* Tiefer positioniert (war -8px) */
    left: 50%; /* Horizontal mittig */
    transform: translateX(-50%); /* Perfekte Zentrierung */
    background: #666666 !important; /* Grauer Hintergrund */
    border: 1px solid #ffffff !important; /* Weißer dünner Rahmen */
    color: white !important;
    border-radius: 6px !important; /* Rechteckig mit abgerundeten Ecken */
    padding: 4px 8px !important; /* Rechteckige Form */
    min-width: 20px;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    z-index: 10001;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1;
    text-align: center;
}

/* Aktiver Zustand für zentrale Key-Badges */
.central-key-badge.active {
    background: #4caf50 !important; /* Grün bei Aktivierung */
    border-color: #388e3c !important;
    animation: keyboardHintActive 0.3s ease-in-out;
}

/* Verstecke zentrale Badges auf Touch-Geräten */
@media (hover: none) and (pointer: coarse) {
    .central-key-badge {
        display: none !important;
    }
}

/* Verstecke zentrale Badges auf kleinen Bildschirmen */
@media screen and (max-width: 768px) {
    .central-key-badge {
        display: none !important;
    }
}

/* Legacy: Verstecke alte manuelle Badges falls noch vorhanden */
.manual-key-badge {
    display: none !important;
}

/* Key-Badge Animationen für Cookie-Banner */
@keyframes keyboardHintPulse {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1); 
    }
    50% { 
        opacity: 0.8; 
        transform: scale(1.1); 
    }
}

@keyframes keyboardHintActive {
    0% { 
        transform: scale(1); 
    }
    50% { 
        transform: scale(1.2); 
    }
    100% { 
        transform: scale(1); 
    }
}

/* Responsives Verhalten für Cookie-Banner Key-Badges */
@media screen and (max-width: 768px) {
    .cookie-banner .keyboard-number-hint.touch-hidden {
        display: none !important;
    }
}

/* Touch-Geräte spezifisch */
@media (hover: none) and (pointer: coarse) {
    .cookie-banner .keyboard-number-hint.touch-hidden {
        display: none !important;
    }
    
    /* Smart TV Override */
    .cookie-banner .keyboard-number-hint.force-show {
        display: flex !important;
    }
}