/**
 * TrustCookie CSS – Pro Edition
 * C21 Systems / Fit4 Group
 * Version: 2.5.2 (Build 2026-01-10) - C21 Custom Edition
 * Changelog v2.5.1 (Build 2026-01-11): Admin UI Tabs (Mehrsprachigkeit)
 * Changelog v2.5.2 (Build 2026-01-11): Admin UI Accordion (<details>) pro Sprache im Tab „Sprache & Texte“
 * Changelog v2.5.0 (Build 2026-01-10): DB-Farben erzwingen (Banner + Manage-Button), Primary-Farben für Banner-Buttons, Banner-Logo-Rendering, Enqueue-Härtung
 * Changelog v2.4.7: UI-Rebuild nach Screenshot (Banner+Modal), Mobile Fullscreen, Multilingual Textpacks
 * Changelog v2.4.4: Kompaktes Banner-Layout (Logo+Text nebeneinander, Buttons darunter), !important entfernt für Brand-CSS-Kompatibilität
 */

/* ========================================
   CSS Custom Properties (CSS Variablen)
   Können von der Site überschrieben werden
   ======================================== */
:root {
    /* Banner-Farben */
    --trustcookie-primary-color: #00a884;
    --trustcookie-primary-hover: #00d9a7;
    --trustcookie-bg-color: #111111;
    --trustcookie-text-color: #ffffff;

    /* Modal-Farben (separat konfigurierbar) */
    --trustcookie-modal-bg-color: #ffffff;
    --trustcookie-modal-text-color: #333333;
    --trustcookie-modal-heading-color: #111111;
    --trustcookie-modal-description-color: #666666;

    /* Allgemein */
    --trustcookie-border-radius: 6px;
    --trustcookie-font-family: inherit;
    --trustcookie-font-size-base: 1rem;
    --trustcookie-spacing: 20px;
}

/* ========================================
   Banner (Screenshot-Layout)
   ======================================== */
.trustcookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--trustcookie-bg-color);
    color: var(--trustcookie-text-color);
    z-index: 999999;
    box-shadow: 0 -4px 22px rgba(0, 0, 0, 0.35);
    font-family: var(--trustcookie-font-family);
}

.trustcookie-banner--compact {
    padding: 10px 14px;
}

.trustcookie-banner__inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.trustcookie-banner__left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.trustcookie-badge {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: var(--trustcookie-primary-color);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.trustcookie-badge__svg {
    display: block;
}

/* Optional banner logo (admin-configured). If present, badge is replaced by logo. */
.trustcookie-banner__logo {
    display: block;
    height: 36px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    flex: 0 0 auto;
}

.trustcookie-banner__message {
    font-size: 14px;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.88);
    max-width: 860px;
}

.trustcookie-banner__actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex: 0 0 auto;
}

/* ========================================
   Buttons (Equal Choice Design)
   v2.5.0: Höhere Spezifität + gezielte !important
   ======================================== */
/* ========================================
   Buttons
   ======================================== */
.trustcookie-btn {
    flex: 0 0 auto;
    padding: 10px 18px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
    font-family: inherit;
    text-align: center;
    white-space: nowrap;
    line-height: 1;
}

/* Banner pills (respect DB colors via CSS vars) */
#trustcookie-banner.trustcookie-banner {
    background: var(--trustcookie-bg-color) !important;
    color: var(--trustcookie-text-color) !important;
}

#trustcookie-banner .trustcookie-banner__message {
    color: var(--trustcookie-text-color) !important;
    opacity: 0.88;
}

#trustcookie-banner .trustcookie-manage-btn,
#trustcookie-banner .trustcookie-reject-btn {
    background: transparent;
    border: 1px solid var(--trustcookie-primary-color);
    color: var(--trustcookie-primary-color);
    -webkit-text-fill-color: var(--trustcookie-primary-color);
}

#trustcookie-banner .trustcookie-accept-btn {
    background: var(--trustcookie-primary-color);
    border: 1px solid var(--trustcookie-primary-color);
    color: var(--trustcookie-text-color);
    -webkit-text-fill-color: var(--trustcookie-text-color);
}


#trustcookie-banner .trustcookie-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
}

#trustcookie-banner .trustcookie-manage-btn:hover,
#trustcookie-banner .trustcookie-reject-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

#trustcookie-banner .trustcookie-btn:focus {
    outline: 2px solid var(--trustcookie-primary-color);
    outline-offset: 2px;
}


/* ========================================
   Banner button sizing (Thrive/Theme overrides)
   Ensures labels never collapse/truncate
   ======================================== */
#trustcookie-banner .trustcookie-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 11px 22px !important;
    min-width: 180px !important;
    min-height: 42px !important;
    font-size: 14px !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;

    /* Force label visibility (Thrive/ThemeBuilder overrides) */
    color: var(--trustcookie-text-color) !important;
    -webkit-text-fill-color: var(--trustcookie-text-color) !important;
    text-indent: 0 !important;
    overflow: visible !important;
    opacity: 1 !important;
    visibility: visible !important;
    text-transform: none !important;
}



@media (max-width: 720px) {
    #trustcookie-banner .trustcookie-banner__inner {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    #trustcookie-banner .trustcookie-banner__actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }
    #trustcookie-banner .trustcookie-btn {
        width: 100% !important;
        min-width: 0 !important;
    }
}

/* ========================================
   Modal (Screenshot-Layout)
   ======================================== */
.trustcookie-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    animation: fadeIn 0.18s ease;
}

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

.trustcookie-modal-content {
    background: var(--trustcookie-modal-bg-color);
    border-radius: 26px;
    max-width: 720px;
    width: min(720px, 92vw);
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px 26px 22px;
    position: relative;
    color: var(--trustcookie-modal-text-color);
    animation: slideUp 0.22s ease;
}

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

.trustcookie-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 36px;
    line-height: 1;
    cursor: pointer;
    color: #111111;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.trustcookie-modal-close:hover {
    color: #000000;
}

/* Typography */
.trustcookie-modal-title {
    margin: 0 0 12px 0;
    font-size: 32px;
    font-weight: 800;
    color: var(--trustcookie-modal-heading-color);
    letter-spacing: -0.02em;
}

.trustcookie-modal-intro {
    margin: 0 0 14px 0;
    font-size: 20px;
    line-height: 1.35;
    color: var(--trustcookie-modal-text-color);
}

.trustcookie-modal-list {
    margin-top: 14px;
}

.trustcookie-item {
    display: flex;
    gap: 16px;
    padding: 16px 0;
}

.trustcookie-item + .trustcookie-item {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.trustcookie-item__toggle {
    position: relative;
    display: inline-flex;
    align-items: flex-start;
    padding-top: 4px;
}

.trustcookie-item__toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.trustcookie-check {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 2px solid #111111;
    box-sizing: border-box;
}

/* checked state */
.trustcookie-item__toggle input:checked + .trustcookie-check {
    background: #111111;
    border-color: #111111;
}

.trustcookie-item__toggle input:checked + .trustcookie-check::after {
    content: "";
    width: 14px;
    height: 8px;
    border-left: 3px solid #ffffff;
    border-bottom: 3px solid #ffffff;
    transform: rotate(-45deg);
    margin-top: -1px;
}

/* disabled (necessary) */
.trustcookie-item--disabled .trustcookie-check {
    background: #f3f3f3;
    border-color: #efefef;
}

.trustcookie-item--disabled .trustcookie-item__toggle input:checked + .trustcookie-check::after {
    border-left-color: #777777;
    border-bottom-color: #777777;
}

.trustcookie-item__body {
    min-width: 0;
}

.trustcookie-item__title {
    font-size: 22px;
    font-weight: 800;
    margin: 0 0 6px 0;
    color: #111111;
}

.trustcookie-item__desc {
    font-size: 18px;
    line-height: 1.45;
    color: #222222;
}

.trustcookie-btn-primary-block {
    width: 100%;
    margin-top: 18px;
    padding: 18px 20px;
    border-radius: 999px;
    background: #1b1b1b;
    color: #ffffff;
    border: 0;
    font-size: 20px;
    font-weight: 700;
}

.trustcookie-btn-primary-block:hover {
    background: #111111;
    transform: translateY(-1px);
}

.trustcookie-cookie-declaration {
    display: block;
    text-align: center;
    margin-top: 16px;
    font-size: 18px;
    font-weight: 600;
    color: #111111;
    text-decoration: underline;
}

.trustcookie-cookie-declaration:hover {
    opacity: 0.85;
}

/* Mobile: full-screen like screenshot */
@media (max-width: 680px) {
    .trustcookie-banner__inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .trustcookie-banner__actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .trustcookie-modal {
        padding: 0;
        background: #ffffff;
    }

    .trustcookie-modal-content {
        width: 100vw;
        height: 100vh;
        max-width: none;
        max-height: none;
        border-radius: 0;
        padding: 26px 20px 18px;
        animation: none;
        box-shadow: none;
    }

    .trustcookie-modal-title {
        font-size: 30px;
    }

    .trustcookie-modal-intro {
        font-size: 20px;
    }
}

.trustcookie-category {
    padding: 15px;
    background: #f5f5f5;
    border-radius: 8px;
    margin-bottom: 15px;
}

.trustcookie-category label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-weight: 500;
}

.trustcookie-category input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 3px;
}

.trustcookie-category .description {
    margin: 5px 0 0 0;
    font-size: 13px;
    color: var(--trustcookie-modal-description-color);
    font-weight: normal;
}

.trustcookie-modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 25px;
    flex-wrap: wrap;
}

/* ========================================
   Reopen Button (Fixed)
   ======================================== */
.trustcookie-reopen-fixed {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999998;
}

.trustcookie-reopen-btn {
    background: var(--trustcookie-primary-color);
    color: var(--trustcookie-text-color);
    border: none;
    padding: 12px 16px;
    border-radius: 50px;
    font-size: 1.25em;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 168, 132, 0.3);
    transition: all 0.2s ease;
    line-height: 1;
}

.trustcookie-reopen-btn:hover {
    background: var(--trustcookie-primary-hover);
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 168, 132, 0.4);
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
    .trustcookie-banner {
        padding: 15px;
    }

    .trustcookie-text-wrapper {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 12px;
    }

    .trustcookie-logo-banner {
        max-width: 120px;
    }

    .trustcookie-buttons {
        flex-direction: column;
    }

    .trustcookie-btn {
        width: 100%;
        text-align: center;
    }

    .trustcookie-modal-content {
        padding: 20px;
        max-height: 95vh;
    }

    .trustcookie-modal-buttons {
        flex-direction: column;
    }

    .trustcookie-reopen-fixed {
        bottom: 15px;
        right: 15px;
    }
}

/* ========================================
   Accessibility
   ======================================== */
.trustcookie-btn:focus,
.trustcookie-reopen-btn:focus,
.trustcookie-modal-close:focus {
    outline: 2px solid var(--trustcookie-primary-color);
    outline-offset: 2px;
}

/* ========================================
   Print
   ======================================== */
@media print {
    .trustcookie-banner,
    .trustcookie-modal,
    .trustcookie-reopen-fixed {
        display: none !important;
    }
}

/* ========================================
   Logo Support
   ======================================== */
/*
   Hinweis: Ab v2.4.1 unterstützt das Plugin separate Logos für:
   - Banner (dunkler Hintergrund): trustcookie_logo_banner_url
   - Modal (heller Hintergrund): trustcookie_logo_modal_url

   Dies ermöglicht z.B. ein weißes Logo auf dunklem Banner-Hintergrund
   und ein dunkles Logo auf hellem Modal-Hintergrund.
*/
.trustcookie-logo {
    max-width: 200px;
    max-height: 60px;
    margin-bottom: 15px;
    display: block;
}

.trustcookie-banner .trustcookie-logo-banner {
    margin-bottom: 10px;
}

.trustcookie-modal-header .trustcookie-logo-modal {
    max-width: 150px;
    max-height: 50px;
    margin-bottom: 10px;
}

/* Fallback für alte Logo-Klasse (Kompatibilität) */
.trustcookie-banner .trustcookie-logo:not(.trustcookie-logo-banner) {
    margin-bottom: 10px;
}

.trustcookie-modal-header .trustcookie-logo:not(.trustcookie-logo-modal) {
    max-width: 150px;
    max-height: 50px;
    margin-bottom: 10px;
}

/* ========================================
   Akkordeon-Style für Cookie-Kategorien
   ======================================== */
.trustcookie-category {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    margin-bottom: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.trustcookie-category:hover {
    border-color: rgba(0, 168, 132, 0.3);
}

.trustcookie-category-header {
    padding: 12px 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    transition: background 0.2s ease;
}

.trustcookie-category-header:hover {
    background: rgba(255, 255, 255, 0.08);
}

.trustcookie-category-header.active {
    background: rgba(0, 168, 132, 0.1);
}

.trustcookie-category-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.trustcookie-category-title label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    cursor: pointer;
    flex: 1;
}

.trustcookie-category-checkbox {
    margin: 0 !important;
}

.trustcookie-category-toggle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    transition: transform 0.3s ease;
}

.trustcookie-category-header.active .trustcookie-category-toggle {
    transform: rotate(180deg);
}

.trustcookie-category-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 15px;
}

.trustcookie-category-body.expanded {
    max-height: 200px;
    padding: 10px 15px 15px 15px;
}

.trustcookie-category-body .description {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--trustcookie-modal-description-color);
}

/* Essential category (always enabled) */
.trustcookie-category.essential {
    border-color: rgba(0, 168, 132, 0.3);
}

.trustcookie-category.essential .trustcookie-category-header {
    background: rgba(0, 168, 132, 0.1);
}

.trustcookie-category.essential .trustcookie-category-checkbox {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Akkordeon-Animation */
@keyframes accordionSlideDown {
    from {
        max-height: 0;
        opacity: 0;
    }
    to {
        max-height: 200px;
        opacity: 1;
    }
}

@keyframes accordionSlideUp {
    from {
        max-height: 200px;
        opacity: 1;
    }
    to {
        max-height: 0;
        opacity: 0;
    }
}

/* Mobile Optimierung für Akkordeon */
@media (max-width: 768px) {
    .trustcookie-category-header {
        padding: 10px 12px;
    }

    .trustcookie-category-title label {
        font-size: 14px;
    }

    .trustcookie-category-body .description {
        font-size: 12px;
    }
}

/* ========================================
   CSS-Variablen Anpassung (C21 Edition)
   Version 2.4.3+ - Separate Modal-Farben
   ======================================== */
/*
   Die folgenden CSS-Variablen können in Ihrem Theme oder via Code überschrieben werden:

   Beispiel in functions.php oder Thrive Theme Builder:

   <style>
   :root {
       /* Banner-Farben (dunkler Hintergrund) */
       --trustcookie-primary-color: #ff6b6b;
       --trustcookie-primary-hover: #ff5252;
       --trustcookie-bg-color: #2c3e50;
       --trustcookie-text-color: #ecf0f1;

       /* Modal-Farben (heller Hintergrund) */
       --trustcookie-modal-bg-color: #ffffff;
       --trustcookie-modal-text-color: #333333;
       --trustcookie-modal-heading-color: #111111;
       --trustcookie-modal-description-color: #666666;

       /* Allgemein */
       --trustcookie-border-radius: 12px;
       --trustcookie-font-family: 'Your Font', sans-serif;
       --trustcookie-font-size-base: 1.1rem;
       --trustcookie-spacing: 25px;
   }
   </style>

   Oder via Code Snippets Plugin:

   add_action('wp_head', function() {
       echo '<style>
           :root {
               --trustcookie-primary-color: #your-brand-color;
               --trustcookie-modal-text-color: #000000;
               --trustcookie-font-family: inherit;
           }
       </style>';
   });

   Die Schriftart wird automatisch vom Body-Element geerbt, wenn nicht anders definiert.

   WICHTIG: Ab v2.4.3 sind Banner- und Modal-Farben separat konfigurierbar!
   - Banner hat typischerweise dunklen Hintergrund (#111111) + helle Schrift (#ffffff)
   - Modal hat typischerweise hellen Hintergrund (#ffffff) + dunkle Schrift (#333333)
*/


/* ========================================
   Hover states (color swap using primary)
   ======================================== */
#trustcookie-banner .trustcookie-accept-btn:hover{
    background: transparent !important;
    border-color: var(--trustcookie-primary-color) !important;
    color: var(--trustcookie-primary-color) !important;
    -webkit-text-fill-color: var(--trustcookie-primary-color) !important;
    filter: none !important;
}
#trustcookie-banner .trustcookie-manage-btn:hover,
#trustcookie-banner .trustcookie-reject-btn:hover{
    background: var(--trustcookie-primary-color) !important;
    border-color: var(--trustcookie-primary-color) !important;
    color: var(--trustcookie-text-color) !important;
    -webkit-text-fill-color: var(--trustcookie-text-color) !important;
    filter: none !important;
}


/* ========================================
   Modal header logo + legal links
   ======================================== */
#trustcookie-modal .trustcookie-modal-header{
    display:flex;
    justify-content:center;
    margin-bottom: 10px;
}
#trustcookie-modal .trustcookie-modal-logo{
    max-height: 42px;
    width:auto;
    display:block;
}
#trustcookie-modal .trustcookie-modal-legal-links{
    display:flex;
    flex-wrap:wrap;
    gap: 10px 14px;
    margin-top: 14px;
    justify-content:center;
}
#trustcookie-modal .trustcookie-legal-link{
    font-size: 13px;
    text-decoration: underline;
    opacity: 0.92;
}
#trustcookie-modal .trustcookie-legal-link:hover{
    opacity: 1;
}


/* Enforce visibility against theme/button resets */
#trustcookie-banner .trustcookie-btn{
    opacity: 1 !important;
    visibility: visible !important;
    text-shadow: none !important;
}
