/* ================================================================
   MEDIOORA – COOKIE BANNER CSS
   DSGVO-konformes Cookie-Consent-Design
   ================================================================ */

/* ================================================================
   COOKIE BANNER (Erstanzeige)
   ================================================================ */
.cookie-banner {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    right: 1.5rem;
    max-width: 520px;
    z-index: 9998;
    background: rgba(20, 21, 48, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 1.25rem;
    padding: 1.75rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(91,78,255,0.1);
    transform: translateY(0);
    opacity: 1;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

/* Einblenden Animation */
.cookie-banner--hidden {
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
}

/* Ausblenden (nach Akzeptanz) */
.cookie-banner--leaving {
    transform: translateY(120%);
    opacity: 0;
}

/* Icon + Titel */
.cookie-banner__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.875rem;
}
.cookie-banner__icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}
.cookie-banner__title {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    letter-spacing: -0.01em;
}

/* Beschreibungstext */
.cookie-banner__text {
    font-size: 0.875rem;
    color: rgba(255,255,255,0.6);
    line-height: 1.6;
    margin-bottom: 1.25rem;
}
.cookie-banner__text a {
    color: rgba(123,112,255,0.9);
    text-decoration: underline;
    text-decoration-color: rgba(123,112,255,0.4);
    transition: color 0.15s ease;
}
.cookie-banner__text a:hover { color: #7B70FF; }

/* Toggle-Bereich (Kategorien) */
.cookie-banner__categories {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 0.875rem;
}

.cookie-category {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.cookie-category__info { flex: 1; min-width: 0; }
.cookie-category__name {
    font-size: 0.875rem;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    display: block;
    margin-bottom: 0.125rem;
}
.cookie-category__desc {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.4);
    display: block;
}

/* Toggle Switch */
.cookie-toggle { position: relative; flex-shrink: 0; }
.cookie-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0; height: 0;
}
.cookie-toggle__switch {
    display: block;
    width: 44px;
    height: 24px;
    background: rgba(255,255,255,0.15);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
    position: relative;
}
.cookie-toggle__switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.cookie-toggle input:checked + .cookie-toggle__switch {
    background: #5B4EFF;
}
.cookie-toggle input:checked + .cookie-toggle__switch::after {
    transform: translateX(20px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.3), 0 0 0 2px rgba(91,78,255,0.3);
}
.cookie-toggle input:disabled + .cookie-toggle__switch {
    opacity: 0.5;
    cursor: not-allowed;
}
.cookie-toggle input:focus-visible + .cookie-toggle__switch {
    outline: 2px solid #5B4EFF;
    outline-offset: 2px;
}

/* Button-Gruppe */
.cookie-banner__actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Cookie-Banner Buttons */
.cookie-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.125rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.cookie-btn--accept-all {
    background: #5B4EFF;
    color: #fff;
    flex: 1;
}
.cookie-btn--accept-all:hover {
    background: #7B70FF;
    box-shadow: 0 4px 20px rgba(91,78,255,0.4);
    transform: translateY(-1px);
}

.cookie-btn--save {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.8);
    border: 1px solid rgba(255,255,255,0.12);
}
.cookie-btn--save:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

.cookie-btn--reject {
    background: transparent;
    color: rgba(255,255,255,0.4);
    font-size: 0.8125rem;
    padding: 0.625rem 0.75rem;
    text-decoration: underline;
    text-decoration-color: transparent;
}
.cookie-btn--reject:hover {
    color: rgba(255,255,255,0.7);
    text-decoration-color: rgba(255,255,255,0.3);
}

/* ================================================================
   COOKIE SETTINGS MODAL
   ================================================================ */
.cookie-settings-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.cookie-settings-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.cookie-settings-modal {
    background: #141530;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 1.5rem;
    padding: 2.5rem;
    max-width: 680px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    transform: scale(0.92) translateY(20px);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}
.cookie-settings-overlay.is-open .cookie-settings-modal {
    transform: scale(1) translateY(0);
}

/* Scrollbar Styling */
.cookie-settings-modal::-webkit-scrollbar { width: 6px; }
.cookie-settings-modal::-webkit-scrollbar-track { background: transparent; }
.cookie-settings-modal::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
}

.cookie-settings-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.cookie-settings-modal__title {
    font-size: 1.375rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}
.cookie-settings-modal__subtitle {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.5);
    margin: 0.375rem 0 0;
}
.cookie-settings-modal__close {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: rgba(255,255,255,0.6);
    font-size: 1.25rem;
    line-height: 1;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.cookie-settings-modal__close:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

/* Cookie-Kategorien im Modal */
.cookie-settings-category {
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 0.875rem;
    margin-bottom: 0.875rem;
    overflow: hidden;
}
.cookie-settings-category__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.125rem 1.25rem;
    gap: 1rem;
    cursor: pointer;
    background: rgba(255,255,255,0.03);
    transition: background 0.15s ease;
}
.cookie-settings-category__header:hover { background: rgba(255,255,255,0.05); }
.cookie-settings-category__header-left { display: flex; align-items: center; gap: 0.875rem; flex: 1; min-width: 0; }
.cookie-settings-category__icon { font-size: 1.25rem; flex-shrink: 0; }
.cookie-settings-category__name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #fff;
    display: block;
}
.cookie-settings-category__count {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.35);
    display: block;
    margin-top: 2px;
}

.cookie-settings-category__body {
    padding: 0 1.25rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}
.cookie-settings-category.is-expanded .cookie-settings-category__body {
    max-height: 400px;
    padding-bottom: 1.25rem;
}
.cookie-settings-category__description {
    font-size: 0.875rem;
    color: rgba(255,255,255,0.5);
    line-height: 1.6;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255,255,255,0.06);
    margin: 0;
}

/* Modal Aktionen */
.cookie-settings-modal__actions {
    display: flex;
    gap: 0.875rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    flex-wrap: wrap;
}
.cookie-settings-modal__actions .cookie-btn--accept-all { flex: 1; min-width: 0; }

/* ================================================================
   COOKIE STATUS INDICATOR (Sticky Button nach Akzeptanz)
   ================================================================ */
.cookie-status-btn {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 9990;
    background: rgba(20, 21, 48, 0.9);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 9999px;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.8125rem;
    color: rgba(255,255,255,0.5);
    font-family: inherit;
    transition: all 0.2s ease;
    backdrop-filter: blur(12px);
}
.cookie-status-btn:hover {
    background: rgba(30, 32, 70, 0.95);
    color: rgba(255,255,255,0.8);
    border-color: rgba(91,78,255,0.4);
}
.cookie-status-btn__dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #22C55E;
    flex-shrink: 0;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 640px) {
    .cookie-banner {
        left: 0.75rem;
        right: 0.75rem;
        bottom: 0.75rem;
        border-radius: 1rem;
    }
    .cookie-banner__actions {
        flex-direction: column;
    }
    .cookie-btn--accept-all { order: -1; }
    .cookie-settings-modal {
        padding: 1.5rem;
        border-radius: 1.25rem;
    }
    .cookie-settings-modal__actions {
        flex-direction: column;
    }
}
