/**
 * Klaro Cookie Consent - Custom Styling
 * Angepasst an Schutzwehr Corporate Design
 */

/* ============================================
   Klaro Modal - Schutzwehr Branding
   ============================================ */

.klaro .cookie-modal,
.klaro .cookie-notice {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
}

/* Modal Hintergrund */
.klaro .cookie-modal .cm-modal {
    background-color: #ffffff !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 40px rgba(0, 82, 165, 0.2) !important;
    max-width: 900px !important;
}

/* Header Styling */
.klaro .cookie-modal .cm-header {
    background: linear-gradient(135deg, #0052A5 0%, #003366 100%) !important;
    color: #ffffff !important;
    padding: 2rem !important;
    border-radius: 12px 12px 0 0 !important;
}

.klaro .cookie-modal .cm-header h1.title {
    color: #ffffff !important;
    font-size: 1.75rem !important;
    font-weight: 700 !important;
    margin-bottom: 0.5rem !important;
}

.klaro .cookie-modal .cm-header p {
    color: #EEE9DB !important;
    opacity: 0.95 !important;
    font-size: 1rem !important;
    line-height: 1.6 !important;
}

/* Body Styling */
.klaro .cookie-modal .cm-body {
    padding: 2rem !important;
    background-color: #ffffff !important;
}

/* Service Items */
.klaro .cm-app {
    border: 2px solid #E0E0E0 !important;
    border-radius: 8px !important;
    margin-bottom: 1rem !important;
    padding: 1.25rem !important;
    transition: all 0.3s ease !important;
}

.klaro .cm-app:hover {
    border-color: #0052A5 !important;
    box-shadow: 0 4px 12px rgba(0, 82, 165, 0.1) !important;
    transform: translateY(-2px) !important;
}

.klaro .cm-app.cm-toggle {
    border-left: 4px solid #0052A5 !important;
}

.klaro .cm-app .cm-app-title {
    color: #0052A5 !important;
    font-weight: 600 !important;
    font-size: 1.1rem !important;
}

.klaro .cm-app .cm-app-description {
    color: #6C757D !important;
    line-height: 1.6 !important;
    margin-top: 0.5rem !important;
}

/* Required Badge */
.klaro .cm-app .cm-required {
    background-color: #849BB9 !important;
    color: #ffffff !important;
    padding: 0.25rem 0.75rem !important;
    border-radius: 20px !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

/* Purpose Tags */
.klaro .cm-app .cm-purpose {
    background-color: #F8F9FA !important;
    color: #0052A5 !important;
    padding: 0.25rem 0.75rem !important;
    border-radius: 4px !important;
    font-size: 0.85rem !important;
    margin-right: 0.5rem !important;
    display: inline-block !important;
    margin-bottom: 0.5rem !important;
}

/* Toggle Switch */
.klaro .cm-app-input:checked + .cm-app-label .slider {
    background-color: #0052A5 !important;
}

.klaro .cm-app-input:focus + .cm-app-label .slider {
    box-shadow: 0 0 0 3px rgba(0, 82, 165, 0.2) !important;
}

.klaro .cm-app-label .slider {
    background-color: #ccc !important;
    border-radius: 20px !important;
    transition: all 0.3s ease !important;
}

.klaro .cm-app-label .slider:before {
    background-color: white !important;
    border-radius: 50% !important;
}

/* Buttons */
.klaro .cookie-modal .cm-footer .cm-btn,
.klaro .cookie-notice .cm-btn {
    padding: 0.75rem 2rem !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    transition: all 0.3s ease !important;
    border: 2px solid transparent !important;
}

/* Primary Button (Alle akzeptieren) */
.klaro .cm-btn.cm-btn-success {
    background-color: #0052A5 !important;
    color: #ffffff !important;
    border-color: #0052A5 !important;
}

.klaro .cm-btn.cm-btn-success:hover {
    background-color: #003366 !important;
    border-color: #003366 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 82, 165, 0.3) !important;
}

/* Secondary Button (Auswahl speichern) */
.klaro .cm-btn.cm-btn-info {
    background-color: #EEE9DB !important;
    color: #0052A5 !important;
    border-color: #EEE9DB !important;
}

.klaro .cm-btn.cm-btn-info:hover {
    background-color: #ffffff !important;
    border-color: #0052A5 !important;
    color: #0052A5 !important;
    transform: translateY(-2px) !important;
}

/* Decline Button */
.klaro .cm-btn.cm-btn-decline {
    background-color: transparent !important;
    color: #6C757D !important;
    border-color: #E0E0E0 !important;
}

.klaro .cm-btn.cm-btn-decline:hover {
    background-color: #F8F9FA !important;
    color: #2C3E50 !important;
    border-color: #6C757D !important;
}

/* Footer */
.klaro .cookie-modal .cm-footer {
    padding: 1.5rem 2rem !important;
    background-color: #F8F9FA !important;
    border-radius: 0 0 12px 12px !important;
    display: flex !important;
    gap: 1rem !important;
    flex-wrap: wrap !important;
    justify-content: flex-end !important;
}

/* Notice (kleine Banner) */
.klaro .cookie-notice {
    background: linear-gradient(135deg, #0052A5 0%, #003366 100%) !important;
    color: #ffffff !important;
    padding: 1.5rem !important;
    border-radius: 12px 12px 0 0 !important;
    box-shadow: 0 -4px 20px rgba(0, 82, 165, 0.3) !important;
}

.klaro .cookie-notice .cn-body {
    max-width: 1200px !important;
    margin: 0 auto !important;
}

.klaro .cookie-notice p {
    color: #EEE9DB !important;
    margin-bottom: 1rem !important;
}

.klaro .cookie-notice .cn-buttons {
    display: flex !important;
    gap: 1rem !important;
    flex-wrap: wrap !important;
}

.klaro .cookie-notice .cn-learn-more {
    color: #EEE9DB !important;
    text-decoration: underline !important;
    font-weight: 500 !important;
}

.klaro .cookie-notice .cn-learn-more:hover {
    color: #ffffff !important;
}

/* Context Menu Button (Einstellungen-Button unten rechts) */
.klaro .cookie-notice-context {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    z-index: 999 !important;
}

.klaro .cookie-notice-context .cm-btn {
    background-color: #0052A5 !important;
    color: #ffffff !important;
    padding: 1rem 1.5rem !important;
    border-radius: 50px !important;
    box-shadow: 0 4px 12px rgba(0, 82, 165, 0.4) !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
}

.klaro .cookie-notice-context .cm-btn:hover {
    background-color: #003366 !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 6px 16px rgba(0, 82, 165, 0.5) !important;
}

.klaro .cookie-notice-context .cm-btn::before {
    content: "🍪 " !important;
    margin-right: 0.5rem !important;
}

/* Links */
.klaro a {
    color: #0052A5 !important;
    text-decoration: underline !important;
    transition: color 0.3s ease !important;
}

.klaro a:hover {
    color: #003366 !important;
}

/* Powered By - Optional ausblenden */
.klaro .cm-powered-by {
    display: none !important; /* Oder anpassen wenn gewünscht */
}

/* Consent Placeholder für externe Inhalte */
.consent-placeholder {
    background: linear-gradient(135deg, #F8F9FA 0%, #E0E0E0 100%) !important;
    border: 2px dashed #849BB9 !important;
    border-radius: 12px !important;
    padding: 3rem 2rem !important;
    text-align: center !important;
    min-height: 300px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
}

.consent-placeholder i {
    font-size: 4rem !important;
    color: #849BB9 !important;
    margin-bottom: 1.5rem !important;
}

.consent-placeholder strong {
    color: #0052A5 !important;
    font-size: 1.25rem !important;
    display: block !important;
    margin-bottom: 0.75rem !important;
}

.consent-placeholder p {
    color: #6C757D !important;
    margin-bottom: 1.5rem !important;
    max-width: 400px !important;
}

.consent-placeholder .btn {
    background-color: #0052A5 !important;
    color: #ffffff !important;
    padding: 0.75rem 2rem !important;
    border-radius: 6px !important;
    border: none !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.consent-placeholder .btn:hover {
    background-color: #003366 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 82, 165, 0.3) !important;
}

/* ============================================
   Responsive Anpassungen
   ============================================ */

@media (max-width: 768px) {
    .klaro .cookie-modal .cm-modal {
        max-width: 95% !important;
        margin: 1rem !important;
    }

    .klaro .cookie-modal .cm-header {
        padding: 1.5rem !important;
    }

    .klaro .cookie-modal .cm-header h1.title {
        font-size: 1.5rem !important;
    }

    .klaro .cookie-modal .cm-body {
        padding: 1.5rem !important;
    }

    .klaro .cookie-modal .cm-footer {
        padding: 1rem 1.5rem !important;
        flex-direction: column !important;
    }

    .klaro .cookie-modal .cm-footer .cm-btn {
        width: 100% !important;
        text-align: center !important;
    }

    .klaro .cookie-notice {
        border-radius: 0 !important;
        padding: 1rem !important;
    }

    .klaro .cookie-notice .cn-buttons {
        flex-direction: column !important;
    }

    .klaro .cookie-notice .cn-buttons .cm-btn {
        width: 100% !important;
        text-align: center !important;
    }

    .klaro .cookie-notice-context {
        bottom: 10px !important;
        right: 10px !important;
    }

    .klaro .cookie-notice-context .cm-btn {
        padding: 0.75rem 1rem !important;
        font-size: 0.9rem !important;
    }

    .consent-placeholder {
        padding: 2rem 1rem !important;
        min-height: 250px !important;
    }

    .consent-placeholder i {
        font-size: 3rem !important;
    }
}

/* ============================================
   Accessibility Verbesserungen
   ============================================ */

.klaro *:focus {
    outline: 2px solid #0066CC !important;
    outline-offset: 2px !important;
}

.klaro .cm-btn:focus {
    box-shadow: 0 0 0 3px rgba(0, 82, 165, 0.3) !important;
}

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

/* ============================================
   Animationen
   ============================================ */

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.klaro .cookie-modal {
    animation: fadeIn 0.3s ease !important;
}

.klaro .cookie-notice {
    animation: slideUp 0.5s ease !important;
}

/* ============================================
   Dark Mode Support (Optional)
   ============================================ */

@media (prefers-color-scheme: dark) {
    /* Hier können Dark Mode Styles hinzugefügt werden */
    /* Aktuell nicht implementiert, da Corporate Design hell ist */
}



/* ============================================
   MOBILE & RESPONSIVE FIXES (Ersetze den alten Media-Block damit)
   ============================================ */
@media (max-width: 768px) {

    /* 1. DAS EINSTELLUNGS-FENSTER (MODAL) */
    .klaro .cookie-modal .cm-modal {
        width: 95% !important;           /* fast volle Breite */
        max-width: none !important;      /* Begrenzung aufheben */
        height: auto !important;
        max-height: 90vh !important;     /* Maximal 90% der Bildschirmhöhe */
        margin: 0 !important;
        
        /* Zentrierung erzwingen */
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        
        /* Scrolling ermöglichen! Wichtig für kleine Handys */
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important; /* Scrollen nur im Body, nicht im ganzen Modal */
    }

    .klaro .cookie-modal .cm-body {
        overflow-y: auto !important;    /* Inhalt scrollbar machen */
        padding: 1rem !important;
        flex: 1 1 auto !important;      /* Nimmt den verfügbaren Platz */
    }

    .klaro .cookie-modal .cm-header,
    .klaro .cookie-modal .cm-footer {
        flex: 0 0 auto !important;      /* Header/Footer bleiben fest */
        padding: 1rem !important;
    }

    /* Footer Buttons untereinander auf dem Handy */
    .klaro .cookie-modal .cm-footer {
        flex-direction: column-reverse !important; /* "Speichern" nach oben, "Ablehnen" nach unten */
        gap: 10px !important;
    }

    .klaro .cookie-modal .cm-footer .cm-btn {
        width: 100% !important;
        margin: 0 !important;
        padding: 12px !important;       /* Größere Touch-Fläche */
        text-align: center !important;
    }

    /* 2. DAS BANNER UNTEN (NOTICE) */
    .klaro .cookie-notice {
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 12px 12px 0 0 !important;
        padding: 20px 15px !important;
        
        /* Sicherstellen, dass es über allem liegt, aber unter Back-To-Top */
        z-index: 20000 !important; 
    }

    .klaro .cookie-notice .cn-body {
        margin-bottom: 15px !important;
        padding-right: 0 !important;
    }

    /* Buttons im Banner stapeln */
    .klaro .cookie-notice .cn-buttons {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 10px !important;
    }

    .klaro .cookie-notice .cn-buttons .cm-btn {
        width: 100% !important;
        margin: 0 !important;
        display: block !important;
        text-align: center !important;
        padding: 14px !important; /* Einfach zu tippen */
    }
}

/* WICHTIG: Querformat auf Handys (Landscape) */
@media (max-width: 900px) and (orientation: landscape) {
    .klaro .cookie-modal .cm-modal {
        max-height: 95vh !important;
        top: 50% !important;
    }
    .klaro .cookie-modal .cm-body {
        padding: 0.5rem 1rem !important;
    }
}


