/*
 * Datei: css/cookie-consent.css
 * Zweck: Styling für den Cookie-Consent-Banner und das Einstellungs-Modal.
 * Version: 1.4
 */

/* Container für den Banner */
#cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #fff;
    padding: 20px;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    display: none; /* Wird per JS angezeigt */
    border-top: 1px solid #e0e0e0;
    font-size: 15px;
}

#cookie-consent-banner-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
    gap: 15px;
}

#cookie-consent-banner-text {
    flex-grow: 1;
    min-width: 300px;
}

#cookie-consent-banner-text p {
    margin: 0;
    line-height: 1.5;
}

#cookie-consent-banner-text a {
    color: #007AFF;
    text-decoration: underline;
}

#cookie-consent-banner-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Modal für die Einstellungen */
#cookie-consent-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 10000;
    display: none; /* Wird per JS angezeigt */
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

#cookie-consent-modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 12px;
    width: 100%;
    max-width: 550px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

#cookie-consent-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

#cookie-consent-modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

#cookie-close-modal {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

.cookie-category {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}
.cookie-category:last-of-type {
    border-bottom: none;
}

.cookie-category-description h4 {
    margin: 0 0 5px 0;
    font-size: 1rem;
}
.cookie-category-description p {
    margin: 0;
    font-size: 0.9rem;
    color: #555;
}

#cookie-consent-modal-footer {
    margin-top: 25px;
    text-align: right;
}

/* Buttons */
.cookie-btn {
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease, transform 0.1s ease;
}
.cookie-btn:active {
    transform: scale(0.98);
}
.cookie-btn.primary {
    background-color: #007AFF;
    color: white;
}
.cookie-btn.secondary {
    background-color: #e9ecef;
    color: #495057;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    flex-shrink: 0;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 28px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: #34C759;
}
input:checked + .slider:before {
    transform: translateX(22px);
}
input:disabled + .slider {
    background-color: #e9ecef;
    cursor: not-allowed;
}

/* Dark Mode Anpassungen */
body.dark-mode #cookie-consent-banner {
    background-color: #1c1c1e;
    border-top-color: #3a3a3c;
    color: #f5f5f7;
}
body.dark-mode #cookie-consent-banner a {
    color: #58a6ff;
}
body.dark-mode #cookie-consent-modal-content {
    background-color: #2c2c2e;
    color: #f5f5f7;
}
body.dark-mode #cookie-consent-modal-header {
    border-bottom-color: #3a3a3c;
}
body.dark-mode #cookie-close-modal,
body.dark-mode .cookie-category-description p {
    color: #a1a1a6;
}
body.dark-mode .cookie-category {
    border-bottom-color: #3a3a3c;
}
body.dark-mode .cookie-btn.secondary {
    background-color: #495057;
    color: #f8f9fa;
}
body.dark-mode .cookie-btn.primary {
    background-color: #007AFF;
}

/* --- KORREKTUR FÜR TOGGLE IM DARK MODE --- */
/* Farbe des Toggles im "Aus"-Zustand im Dark Mode */
body.dark-mode .slider {
    background-color: #495057;
}
/* Farbe des Toggles im "An"-Zustand im Dark Mode */
body.dark-mode input:checked + .slider {
    background-color: #007AFF; /* Verwendet die primäre Aktionsfarbe */
}
/* Farbe des deaktivierten Toggles im Dark Mode */
body.dark-mode input:disabled + .slider {
    background-color: #3a3a3c;
    cursor: not-allowed;
}
/* --- ENDE DER KORREKTUR --- */


/* Responsive Design */
@media (max-width: 768px) {
    /* --- ANPASSUNGEN FÜR MOBILGERÄTE (Version 1.4) --- */

    /* 1. Verkleinert den Cookie-Banner weiter, um weniger aufdringlich zu sein */
    #cookie-consent-banner {
        padding: 12px;
    }
    #cookie-consent-banner-text p {
        font-size: 13px; /* Text weiter verkleinert */
        line-height: 1.4;  /* Zeilenhöhe für Kompaktheit angepasst */
    }
    #cookie-consent-banner-content {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    #cookie-consent-banner-actions {
        justify-content: center;
        margin-top: 8px;
        gap: 8px; /* Abstand zwischen den Knöpfen reduziert */
    }
    /* Knöpfe im Banner spezifisch verkleinern */
    #cookie-consent-banner .cookie-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    /* 2. Stellt sicher, dass der Einstellungs-Modal scrollbar ist */
    #cookie-consent-modal-content {
        padding: 25px 20px;
        max-height: 85vh; /* Verhindert, dass der Modal grösser als der Bildschirm ist */
        overflow-y: auto;  /* Fügt eine Scrollleiste hinzu, wenn der Inhalt zu hoch ist */
    }

    .cookie-category {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .cookie-category-description h4 {
        font-size: 0.95rem;
    }
    .cookie-category-description p {
        font-size: 0.85rem;
    }
}