/**
 * Minimal Cookie Banner Styling
 * Best Practices 2024:
 * - Desktop: Bottom-right corner floating box
 * - Mobile: Compact bottom bar (nicht fullscreen)
 * - GDPR-konform: Gleiche Prominenz für Accept/Decline Buttons
 *
 * Sources:
 * - https://www.cookieyes.com/blog/cookie-banner/
 * - https://transcend.io/blog/cookie-consent-banner
 */

/* ============================================
   BASE STYLES - Beide Plattformen
   ============================================ */
.klaro .cookie-notice:not(.cookie-modal-notice) {
    font-size: 13px;
    line-height: 1.4;
    background-color: rgba(51, 51, 51, 0.97);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Kompakteres Body-Padding */
.klaro .cookie-notice:not(.cookie-modal-notice) .cn-body {
    padding: 12px 16px;
}

/* Kleinerer Text für Beschreibung */
.klaro .cookie-notice:not(.cookie-modal-notice) .cn-body p {
    font-size: 12px;
    margin-bottom: 8px;
    opacity: 0.9;
}

/* ============================================
   BUTTONS - GDPR-konform gleiche Prominenz
   ============================================ */
.klaro .cookie-notice .cm-btn {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s ease;
    min-width: 100px;
    text-align: center;
    margin: 0 5px !important;
}

/* Accept Button - Grün mit weißer Schrift */
.klaro .cookie-notice .cm-btn.cm-btn-success {
    background-color: #10b981 !important;
    color: #fff !important;
    border: none !important;
}

.klaro .cookie-notice .cm-btn.cm-btn-success:hover {
    background-color: #059669 !important;
}

/* Decline Button - GDPR: Sichtbar mit grauem Hintergrund */
.klaro .cookie-notice .cm-btn.cm-btn-decline,
.klaro .cookie-notice .cm-btn:not(.cm-btn-success):not(.cm-btn-info) {
    background-color: #6b7280 !important;
    color: #fff !important;
    border: none !important;
}

.klaro .cookie-notice .cm-btn.cm-btn-decline:hover,
.klaro .cookie-notice .cm-btn:not(.cm-btn-success):not(.cm-btn-info):hover {
    background-color: #4b5563 !important;
}

/* Info/Settings Button */
.klaro .cookie-notice .cm-btn.cm-btn-info {
    background-color: transparent;
    color: #9ca3af;
    border: none;
    padding: 8px 12px;
    min-width: auto;
    font-size: 12px;
}

.klaro .cookie-notice .cm-btn.cm-btn-info:hover {
    color: #fafafa;
}

/* Button Container - Inline Layout */
.klaro .cookie-notice:not(.cookie-modal-notice) .cn-body .cn-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 0;
}

.klaro .cookie-notice:not(.cookie-modal-notice) .cn-body .cn-buttons button.cm-btn {
    margin: 0;
}

/* Learn More Link */
.klaro .cookie-notice .cn-learn-more {
    font-size: 11px;
}

.klaro .cookie-notice .cn-learn-more a {
    color: #9ca3af;
    text-decoration: underline;
}

.klaro .cookie-notice .cn-learn-more a:hover {
    color: #fafafa;
}

/* ============================================
   DESKTOP STYLES (>= 768px)
   Floating Corner Box - Bottom Right
   ============================================ */
@media (min-width: 768px) {
    .klaro .cookie-notice:not(.cookie-modal-notice) {
        position: fixed;
        bottom: 20px;
        right: 20px;
        left: auto;
        top: auto;
        max-width: 380px;
        width: auto;
        border-radius: 12px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
        animation: slideInRight 0.4s ease-out;
    }

    @keyframes slideInRight {
        from {
            opacity: 0;
            transform: translateX(100px);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    .klaro .cookie-notice:not(.cookie-modal-notice) .cn-body {
        padding: 16px 20px;
    }

    .klaro .cookie-notice:not(.cookie-modal-notice) .cn-body p {
        font-size: 13px;
    }

    /* Desktop: Buttons nebeneinander */
    .klaro .cookie-notice:not(.cookie-modal-notice) .cn-body .cn-buttons {
        justify-content: flex-start;
    }
}

/* ============================================
   TABLET STYLES (768px - 1023px)
   ============================================ */
@media (min-width: 768px) and (max-width: 1023px) {
    .klaro .cookie-notice:not(.cookie-modal-notice) {
        max-width: 340px;
        bottom: 16px;
        right: 16px;
    }
}

/* ============================================
   MOBILE STYLES (< 768px)
   Compact Bottom Bar - Nicht invasiv
   ============================================ */
@media (max-width: 767px) {
    .klaro .cookie-notice:not(.cookie-modal-notice) {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
        animation: slideUp 0.3s ease-out;
        /* Maximale Höhe begrenzen - nicht mehr als 40% des Screens */
        max-height: 40vh;
        overflow-y: auto;
    }

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

    .klaro .cookie-notice:not(.cookie-modal-notice) .cn-body {
        padding: 16px;
    }

    /* Mobile: Kompakterer Text */
    .klaro .cookie-notice:not(.cookie-modal-notice) .cn-body p {
        font-size: 12px;
        margin-bottom: 12px;
        /* Text auf 2 Zeilen begrenzen */
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* Mobile: Buttons in einer Reihe, volle Breite */
    .klaro .cookie-notice:not(.cookie-modal-notice) .cn-body .cn-buttons {
        display: flex;
        flex-wrap: nowrap;
        gap: 10px;
        width: 100%;
        justify-content: center;
    }

    .klaro .cookie-notice:not(.cookie-modal-notice) .cn-body .cn-buttons button.cm-btn {
        flex: 1;
        min-width: 120px;
        max-width: 160px;
        padding: 14px 20px;
        font-size: 15px;
        margin: 0 5px !important;
    }

    /* Mobile: Settings-Button kleiner und rechts */
    .klaro .cookie-notice:not(.cookie-modal-notice) .cn-body .cn-buttons .cm-btn.cm-btn-info {
        flex: 0 0 auto;
        padding: 14px;
        min-width: 50px;
        font-size: 14px;
    }

    /* Mobile: Learn More unter den Buttons */
    .klaro .cookie-notice:not(.cookie-modal-notice) .cn-body .cn-learn-more {
        display: block;
        width: 100%;
        text-align: center;
        margin-top: 8px;
        font-size: 11px;
    }
}

/* ============================================
   SEHR KLEINE SCREENS (< 380px)
   ============================================ */
@media (max-width: 379px) {
    .klaro .cookie-notice:not(.cookie-modal-notice) .cn-body {
        padding: 12px;
    }

    .klaro .cookie-notice .cm-btn {
        font-size: 12px;
        padding: 8px 10px;
    }
}

/* ============================================
   MODAL STYLES (wenn geöffnet)
   ============================================ */
.klaro .cookie-modal .cm-modal.cm-klaro {
    border-radius: 12px;
    max-height: 90vh;
    overflow-y: auto;
}

@media (max-width: 767px) {
    .klaro .cookie-modal .cm-modal.cm-klaro {
        border-radius: 16px 16px 0 0;
        position: fixed;
        bottom: 0;
        top: auto;
        transform: none;
        max-height: 85vh;
        width: 100%;
        max-width: 100%;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
.klaro .cookie-notice .cm-btn:focus {
    outline: 2px solid #10b981;
    outline-offset: 2px;
}

.klaro .cookie-notice .cm-btn:focus-visible {
    outline: 2px solid #10b981;
    outline-offset: 2px;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .klaro .cookie-notice:not(.cookie-modal-notice) {
        animation: none;
    }
}
