/**
 * TSB Cookie Consent - Banner Styles
 * Design: Blue box (TSB style) with kulturBdigital colors
 *
 * @author Leicht Digital GmbH
 */

/* ===========================================
   CSS Variables
   =========================================== */
:root {
    --tsb-primary-blue: #1e3791;
    --tsb-primary-white: #ffffff;
    --tsb-text-light: #ffffff;
    --tsb-border-light: rgba(255, 255, 255, 0.3);
    --tsb-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --tsb-transition: 0.25s ease;
    --tsb-z-index: 999999;
    --tsb-box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

/* ===========================================
   Cookie Banner - Bottom Right Blue Box
   =========================================== */
.tsb-cookie-banner {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: var(--tsb-z-index);
    font-family: var(--tsb-font-family);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity var(--tsb-transition), visibility var(--tsb-transition), transform var(--tsb-transition);
}

.tsb-cookie-banner[data-visible="true"] {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.tsb-cookie-banner__box {
    background-color: var(--tsb-primary-blue);
    color: var(--tsb-primary-white);
    box-shadow: var(--tsb-box-shadow);
    width: 480px;
    max-width: calc(100vw - 48px);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 32px 36px;
}

/* ===========================================
   Title
   =========================================== */
.tsb-cookie-banner__title {
    font-size: 27px;
    font-weight: 700;
    color: var(--tsb-primary-white);
    margin: 0 0 16px 0;
    line-height: 1.3;
}

/* ===========================================
   Content / Text
   =========================================== */
.tsb-cookie-banner__content {
    margin-bottom: 20px;
}

.tsb-cookie-banner__text {
    font-size: 13px;
    font-weight: 400;
    line-height: 1.6;
    color: var(--tsb-text-light);
    margin: 0;
    text-align: justify;
}

/* ===========================================
   Categories Row (horizontal)
   =========================================== */
.tsb-cookie-banner__categories {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 32px;
}

.tsb-cookie-category {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.tsb-cookie-category__checkbox-wrap {
    position: relative;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.tsb-cookie-category__checkbox {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    margin: 0;
}

.tsb-cookie-category__checkbox:disabled {
    cursor: default;
}

.tsb-cookie-category__checkmark {
    position: absolute;
    top: 0;
    left: 0;
    width: 18px;
    height: 18px;
    background-color: transparent;
    border: 2px solid var(--tsb-primary-white);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--tsb-transition);
}

.tsb-cookie-category__checkmark svg {
    opacity: 0;
    color: var(--tsb-primary-blue);
    transition: opacity var(--tsb-transition);
}

.tsb-cookie-category__checkbox:checked + .tsb-cookie-category__checkmark {
    background-color: var(--tsb-primary-white);
}

.tsb-cookie-category__checkbox:checked + .tsb-cookie-category__checkmark svg {
    opacity: 1;
}

.tsb-cookie-category__checkbox:focus-visible + .tsb-cookie-category__checkmark {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.tsb-cookie-category__name {
    font-size: 14px;
    font-weight: 500;
    color: var(--tsb-primary-white);
    white-space: nowrap;
    margin-top: 3px;
}

/* ===========================================
   Details Section (collapsible)
   =========================================== */
.tsb-cookie-banner__details {
    margin-bottom: 20px;
    padding: 16px;
    background-color: rgba(255, 255, 255, 0.1);
    max-height: 25vh;
    overflow-y: auto;
}

.tsb-cookie-banner__details[hidden] {
    display: none;
}

.tsb-cookie-detail {
    margin-bottom: 12px;
}

.tsb-cookie-detail:last-child {
    margin-bottom: 0;
}

.tsb-cookie-detail__name {
    font-size: 13px;
    font-weight: 600;
    color: var(--tsb-primary-white);
    display: block;
    margin-bottom: 4px;
}

.tsb-cookie-detail__description {
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--tsb-text-light);
    margin: 0;
}

/* ===========================================
   Buttons
   =========================================== */
.tsb-cookie-banner__buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.tsb-cookie-banner__btn {
    flex: 1;
    font-family: var(--tsb-font-family);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    line-height: 1;
    padding: 12px 16px;
    border: 2px solid var(--tsb-primary-white);
    cursor: pointer;
    transition: all var(--tsb-transition);
    text-transform: uppercase;
}

/* Both buttons: Outlined, equal weight (no nudging) */
.tsb-cookie-banner__btn--primary,
.tsb-cookie-banner__btn--secondary {
    background-color: transparent;
    color: var(--tsb-primary-white);
}

.tsb-cookie-banner__btn--primary:hover,
.tsb-cookie-banner__btn--secondary:hover {
    background-color: var(--tsb-primary-white);
    color: var(--tsb-primary-blue);
}

.tsb-cookie-banner__btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* ===========================================
   Footer
   =========================================== */
.tsb-cookie-banner__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--tsb-border-light);
}

.tsb-cookie-banner__footer-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Toggle Details */
.tsb-cookie-banner__toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    padding: 0;
    font-family: var(--tsb-font-family);
    font-size: 13px;
    font-weight: 400;
    color: var(--tsb-primary-white);
    cursor: pointer;
    transition: opacity var(--tsb-transition);
}

.tsb-cookie-banner__toggle:hover {
    opacity: 0.8;
}

.tsb-cookie-banner__toggle:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.tsb-cookie-banner__toggle-icon {
    transition: transform var(--tsb-transition);
}

.tsb-cookie-banner__toggle[aria-expanded="true"] .tsb-cookie-banner__toggle-icon {
    transform: rotate(180deg);
}

/* Links */
.tsb-cookie-banner__links {
    display: flex;
    gap: 16px;
}

.tsb-cookie-banner__link {
    font-size: 13px;
    font-weight: 400;
    color: var(--tsb-primary-white);
    text-decoration: none;
    transition: opacity var(--tsb-transition);
}

.tsb-cookie-banner__link:hover {
    opacity: 0.8;
}

/* ===========================================
   Light Style (White Banner)
   =========================================== */
.tsb-cookie-banner[data-style="light"] .tsb-cookie-banner__box {
    background-color: var(--tsb-primary-white);
    color: var(--tsb-primary-blue);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

.tsb-cookie-banner[data-style="light"] .tsb-cookie-banner__title {
    color: var(--tsb-primary-blue);
}

.tsb-cookie-banner[data-style="light"] .tsb-cookie-banner__text {
    color: #333;
}

.tsb-cookie-banner[data-style="light"] .tsb-cookie-category__checkmark {
    border-color: var(--tsb-primary-blue);
}

.tsb-cookie-banner[data-style="light"] .tsb-cookie-category__checkbox:checked + .tsb-cookie-category__checkmark {
    background-color: var(--tsb-primary-blue);
}

.tsb-cookie-banner[data-style="light"] .tsb-cookie-category__checkmark svg {
    color: var(--tsb-primary-white);
}

.tsb-cookie-banner[data-style="light"] .tsb-cookie-category__checkbox:focus-visible + .tsb-cookie-category__checkmark {
    outline-color: var(--tsb-primary-blue);
}

.tsb-cookie-banner[data-style="light"] .tsb-cookie-category__name {
    color: var(--tsb-primary-blue);
}

.tsb-cookie-banner[data-style="light"] .tsb-cookie-banner__details {
    background-color: rgba(30, 55, 145, 0.05);
}

.tsb-cookie-banner[data-style="light"] .tsb-cookie-detail__name {
    color: var(--tsb-primary-blue);
}

.tsb-cookie-banner[data-style="light"] .tsb-cookie-detail__description {
    color: #555;
}

/* Light: Buttons — filled blue with white text */
.tsb-cookie-banner[data-style="light"] .tsb-cookie-banner__btn {
    border-color: var(--tsb-primary-blue);
}

.tsb-cookie-banner[data-style="light"] .tsb-cookie-banner__btn--primary,
.tsb-cookie-banner[data-style="light"] .tsb-cookie-banner__btn--secondary {
    background-color: var(--tsb-primary-blue);
    color: var(--tsb-primary-white);
}

.tsb-cookie-banner[data-style="light"] .tsb-cookie-banner__btn--primary:hover,
.tsb-cookie-banner[data-style="light"] .tsb-cookie-banner__btn--secondary:hover {
    background-color: transparent;
    color: var(--tsb-primary-blue);
}

.tsb-cookie-banner[data-style="light"] .tsb-cookie-banner__btn:focus-visible {
    outline-color: var(--tsb-primary-blue);
}

/* Light: Footer */
.tsb-cookie-banner[data-style="light"] .tsb-cookie-banner__footer {
    border-top-color: rgba(30, 55, 145, 0.2);
}

.tsb-cookie-banner[data-style="light"] .tsb-cookie-banner__toggle {
    color: var(--tsb-primary-blue);
}

.tsb-cookie-banner[data-style="light"] .tsb-cookie-banner__toggle:focus-visible {
    outline-color: var(--tsb-primary-blue);
}

.tsb-cookie-banner[data-style="light"] .tsb-cookie-banner__link {
    color: var(--tsb-primary-blue);
}

/* ===========================================
   Responsive
   =========================================== */
@media (max-width: 480px) {
    .tsb-cookie-banner {
        bottom: 0;
        right: 0;
        left: 0;
    }

    .tsb-cookie-banner__box {
        width: 100%;
        max-width: 100%;
        max-height: 85vh;
        padding: 24px 20px;
        overflow-y: auto;
    }

    .tsb-cookie-banner__title {
        font-size: 18px;
    }

    .tsb-cookie-banner__text {
        font-size: 12px;
        text-align: left;
    }

    .tsb-cookie-banner__categories {
        flex-direction: column;
        gap: 12px;
    }

    .tsb-cookie-banner__buttons {
        flex-direction: column;
    }

    .tsb-cookie-banner__footer {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .tsb-cookie-banner__links {
        width: 100%;
        justify-content: flex-start;
    }
}

/* ===========================================
   Accessibility
   =========================================== */
@media (prefers-reduced-motion: reduce) {
    .tsb-cookie-banner,
    .tsb-cookie-banner__btn,
    .tsb-cookie-banner__toggle,
    .tsb-cookie-banner__toggle-icon,
    .tsb-cookie-category__checkmark,
    .tsb-cookie-category__checkmark svg {
        transition: none;
    }
}

/* ===========================================
   Print
   =========================================== */
@media print {
    .tsb-cookie-banner {
        display: none !important;
    }
}
