/**
 * Højvig Cookie Consent - Banner styles
 *
 * Designet arver fra temaets globale farver via WordPress' CSS-variabler
 * (--wp--preset--color--*). Hvis temaet ikke definerer dem, bruges
 * fornuftige fallback-værdier. Du kan også overskrive --hcc-* direkte
 * i dit tema for at finjustere.
 */
:root {
    /* Primær / brand-farve - bruges til knap, kant, fokus, links */
    --hcc-primary: var(--wp--preset--color--primary,
                    var(--wp--preset--color--vivid-cyan-blue,
                     var(--theme-primary,
                      var(--color-primary, #2c3e50))));

    /* Tekst på primær baggrund (typisk hvid) */
    --hcc-primary-contrast: var(--wp--preset--color--base,
                             var(--wp--preset--color--white,
                              var(--theme-on-primary, #ffffff)));

    /* Generel baggrund (banner, modal) */
    --hcc-bg: var(--wp--preset--color--base,
               var(--wp--preset--color--background,
                var(--theme-background, #ffffff)));

    /* Primær tekstfarve */
    --hcc-text: var(--wp--preset--color--contrast,
                 var(--wp--preset--color--foreground,
                  var(--theme-foreground, #1a1a1a)));

    /* Dæmpet tekst (beskrivelser, "altid aktiv" osv.) */
    --hcc-muted: var(--wp--preset--color--contrast-2,
                  var(--wp--preset--color--neutral, #555555));

    /* Sekundær baggrund (sekundær knap, tabel-header) */
    --hcc-surface: var(--wp--preset--color--base-2,
                    var(--wp--preset--color--tertiary,
                     var(--theme-surface, #ecf0f1)));

    /* Kantfarver */
    --hcc-border: var(--wp--preset--color--contrast-3,
                   var(--theme-border, #e1e1e1));

    /* Form / radius */
    --hcc-radius: var(--wp--custom--border--radius,
                   var(--theme-radius, 8px));
}

/* ---------- Banner ---------- */
#hcc-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--hcc-bg);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 999998;
    border-top: 3px solid var(--hcc-primary);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    color: var(--hcc-text);
    animation: hcc-slide-up 0.3s ease-out;
}

@keyframes hcc-slide-up {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

.hcc-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.hcc-banner-content { flex: 1 1 320px; min-width: 280px; }
.hcc-banner-content h2 { margin: 0 0 6px; font-size: 16px; font-weight: 600; color: var(--hcc-text); }
.hcc-banner-content p { margin: 0; color: var(--hcc-text); }

.hcc-policy-link { color: var(--hcc-primary); text-decoration: underline; }
.hcc-policy-link:hover { opacity: 0.8; }

.hcc-banner-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ---------- Knapper ---------- */
.hcc-btn {
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: var(--hcc-radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    line-height: 1.2;
    transition: opacity 0.15s, background 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.hcc-btn:hover    { opacity: 0.88; }
.hcc-btn:focus    { outline: 2px solid var(--hcc-primary); outline-offset: 2px; }

.hcc-btn-primary    { background: var(--hcc-primary); color: var(--hcc-primary-contrast); }
.hcc-btn-secondary  { background: var(--hcc-surface); color: var(--hcc-text); }
.hcc-btn-ghost      { background: transparent; color: var(--hcc-muted); border-color: var(--hcc-border); }
.hcc-btn-ghost:hover { background: var(--hcc-surface); opacity: 1; }

/* ---------- Modal (indstillinger) ---------- */
#hcc-settings {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    animation: hcc-fade-in 0.2s ease-out;
}

@keyframes hcc-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.hcc-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.hcc-modal-inner {
    position: relative;
    background: var(--hcc-bg);
    border-radius: calc(var(--hcc-radius) * 1.5);
    padding: 32px;
    max-width: 600px;
    width: 92%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    color: var(--hcc-text);
}

.hcc-modal-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--hcc-muted);
    width: 36px;
    height: 36px;
    line-height: 1;
    padding: 0;
}
.hcc-modal-close:hover { color: var(--hcc-text); }
.hcc-modal-inner h2 { margin: 0 0 8px; color: var(--hcc-text); }
.hcc-modal-inner > p { margin: 0 0 16px; color: var(--hcc-muted); }

/* ---------- Kategorier ---------- */
.hcc-category {
    border-top: 1px solid var(--hcc-border);
    padding: 14px 0;
}
.hcc-category-header {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}
.hcc-category-header input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--hcc-primary);
}
.hcc-category-header strong { font-size: 15px; color: var(--hcc-text); }
.hcc-category p {
    margin: 6px 0 0 28px;
    color: var(--hcc-muted);
    font-size: 13px;
}

.hcc-always-on {
    margin-left: auto;
    font-size: 12px;
    color: var(--hcc-muted);
    font-style: italic;
}

.hcc-modal-buttons {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--hcc-border);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* ---------- Cookie-erklæring (shortcode) ---------- */
.hcc-declaration h2 { margin-top: 0; color: var(--hcc-text); }
.hcc-declaration h3 { margin-top: 1.5em; color: var(--hcc-text); }
.hcc-cookie-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0 1.5em;
    font-size: 14px;
    color: var(--hcc-text);
}
.hcc-cookie-table th,
.hcc-cookie-table td {
    padding: 10px 12px;
    border: 1px solid var(--hcc-border);
    text-align: left;
    vertical-align: top;
}
.hcc-cookie-table th { background: var(--hcc-surface); font-weight: 600; }
.hcc-cookie-table code {
    background: var(--hcc-surface);
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 13px;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    .hcc-banner-inner { padding: 16px; }
    .hcc-banner-buttons { width: 100%; }
    .hcc-btn { flex: 1 1 auto; min-width: 90px; }
    .hcc-modal-inner { padding: 24px 20px; }
    .hcc-modal-buttons .hcc-btn { flex: 1 1 100%; }
}
