/**************************************************************
  1) RESET – KUN INDE I COOKIE-MODULERNE
**************************************************************/
#wpbccp-banner,
#wpbccp-banner * ,
#wpbccp-preferences,
#wpbccp-preferences * ,
#wpbccp-manage,
#wpbccp-manage * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font: inherit;         /* arver font-family fra sitet */
    color: inherit;
}

/**************************************************************
  2) SETTINGS – DESIGN TOKENS / DEFAULT PALETTE
**************************************************************/
#wpbccp-banner,
#wpbccp-preferences,
#wpbccp-manage {
    /* Farver */
    --wpbccp-color-bg-banner: #111111;
    --wpbccp-color-bg-surface: #ffffff;
    --wpbccp-color-text-main: #ffffff;
    --wpbccp-color-text-dark: #111111;
    --wpbccp-color-text-muted: #555555;
    --wpbccp-color-border: #eeeeee;
    --wpbccp-color-border-soft: #f0f0f0;
    --wpbccp-color-border-medium: #dddddd;
    --wpbccp-color-accent: #78ABCE;
    --wpbccp-color-link: #ffffff;
    --wpbccp-color-link-hover: #dddddd;
    --wpbccp-color-btn-bg: #ffffff;
    --wpbccp-color-btn-text: #111111;
    --wpbccp-color-btn-border: #666666;
    --wpbccp-color-backdrop: rgba(0, 0, 0, 0.6);

    /* Typografi */
    --wpbccp-font-size-xs: 11px;
    --wpbccp-font-size-sm: 12px;
    --wpbccp-font-size-md: 13px;
    --wpbccp-font-size-lg: 16px;
    --wpbccp-font-size-xl: 18px;

    --wpbccp-line-height-tight: 1.0;
    --wpbccp-line-height-normal: 1.4;
    --wpbccp-line-height-relaxed: 1.6;

    --wpbccp-font-weight-regular: 400;
    --wpbccp-font-weight-medium: 500;
    --wpbccp-font-weight-bold: 600;

    /* Radius & skygge */
    --wpbccp-radius-sm: 4px;
    --wpbccp-radius-md: 6px;
    --wpbccp-radius-lg: 8px;
    --wpbccp-shadow-banner: 0 -4px 12px rgba(0, 0, 0, 0.3);
    --wpbccp-shadow-modal: 0 12px 30px rgba(0, 0, 0, 0.35);

    /* Manage-button */
    --wpbccp-manage-bg: #11111100;
    --wpbccp-manage-text-color: #ffffff;
}

/* Link-styles i modulerne */
#wpbccp-banner a,
#wpbccp-preferences a {
    color: var(--wpbccp-color-link);
    text-decoration: underline;
}

#wpbccp-banner a:hover,
#wpbccp-preferences a:hover {
    color: var(--wpbccp-color-link-hover);
}

/**************************************************************
  3) BANNER (#wpbccp-banner)
**************************************************************/
#wpbccp-banner {
    position: fixed;
    z-index: 99999;
    left: 0;
    right: 0;
    bottom: 0;
    transform: translateY(100%);
    transition: transform 0.25s ease-in-out;
    background: var(--wpbccp-color-bg-banner);
    color: var(--wpbccp-color-text-main);
    font-size: var(--wpbccp-font-size-sm);
    font-weight: var(--wpbccp-font-weight-medium);
    line-height: var(--wpbccp-line-height-normal);
    padding: 16px;
    box-shadow: var(--wpbccp-shadow-banner);
}

#wpbccp-banner.wpbccp-visible {
    transform: translateY(0);
}

#wpbccp-banner .wpbccp-banner-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}

#wpbccp-banner .wpbccp-banner-text {
    flex: 1 1 20px;
}

#wpbccp-banner .wpbccp-banner-text a {
    font-size: var(--wpbccp-font-size-sm);
    font-weight: var(--wpbccp-font-weight-medium);
    line-height: var(--wpbccp-line-height-tight);
}

#wpbccp-banner .wpbccp-banner-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

/* Knap-varianter i banneret */
#wpbccp-banner .wpbccp-btn-accept-all,
#wpbccp-banner .wpbccp-btn-accept-necessary,
#wpbccp-banner .wpbccp-btn-customize {
    background: var(--wpbccp-color-btn-bg);
    color: var(--wpbccp-color-btn-text);
}

#wpbccp-banner .wpbccp-btn-accept-all:hover,
#wpbccp-banner .wpbccp-btn-accept-necessary:hover,
#wpbccp-banner .wpbccp-btn-customize:hover {
    filter: brightness(0.9);
}

/**************************************************************
  4) MODAL (#wpbccp-preferences)
**************************************************************/

/* Wrapper / overlay */
#wpbccp-preferences.wpbccp-modal {
    position: fixed;
    inset: 0;
    z-index: 99998;
    display: none; /* styres af JS via .wpbccp-open */
}

#wpbccp-preferences.wpbccp-modal.wpbccp-open {
    display: block;
}

/* Backdrop */
#wpbccp-preferences .wpbccp-modal-backdrop {
    position: fixed;
    inset: 0;
    background: var(--wpbccp-color-backdrop);
}

/* Dialog – card m. scrollende body */
#wpbccp-preferences .wpbccp-modal-dialog {
    position: relative;
    max-width: 640px;
    width: 90%;
    margin: 40px auto;
    max-height: calc(100vh - 140px);
    padding: 15px 15px;
    display: flex;
    flex-direction: column;
    overflow: hidden;

    background: var(--wpbccp-color-bg-surface);
    color: var(--wpbccp-color-text-dark);
    border-radius: var(--wpbccp-radius-lg);
    box-shadow: var(--wpbccp-shadow-modal);
}

/* Header */
#wpbccp-preferences .wpbccp-modal-header {
    position: relative;
    display: block;
    padding: 14px 16px;
    padding-right: 40px; /* plads til luk-knap */
    border-bottom: 1px solid var(--wpbccp-color-border);
}

#wpbccp-preferences .wpbccp-modal-logo {
    margin-bottom: 0;
}

#wpbccp-preferences .wpbccp-modal-logo img {
    display: block;
    width: 200px;
    max-width: 100%;
    height: auto;
    margin-bottom: 10px;
}

#wpbccp-preferences .wpbccp-modal-title {
    font-size: var(--wpbccp-font-size-lg);
    font-weight: var(--wpbccp-font-weight-regular);
    margin: 0;
    line-height: var(--wpbccp-line-height-normal);
    text-transform: none;
}

/* Luk-knap */
#wpbccp-preferences .wpbccp-modal-close {
    position: absolute;
    right: 10px;
    top: 5px;
    background: transparent;
    border: none;
    color: #000;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

/* Body med scroll */
#wpbccp-preferences .wpbccp-modal-body {
    padding: 12px 16px 4px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

#wpbccp-preferences p.wpbccp-modal-intro,
#wpbccp-preferences p.wpbccp-modal-intro a {
    font-size: var(--wpbccp-font-size-md);
    font-weight: var(--wpbccp-font-weight-regular);
    line-height: var(--wpbccp-line-height-normal);
    text-transform: none;
    color: inherit;
}

/* Kategori-blokke */
#wpbccp-preferences .wpbccp-category {
    padding: 10px 0;
    border-bottom: 1px solid var(--wpbccp-color-border-soft);
}

#wpbccp-preferences .wpbccp-category:last-child {
    border-bottom: none;
}

#wpbccp-preferences .wpbccp-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: -5px;
}

#wpbccp-preferences .wpbccp-category-title {
    font-weight: var(--wpbccp-font-weight-bold);
    font-size: var(--wpbccp-font-size-lg);
}

#wpbccp-preferences .wpbccp-category-desc {
    font-size: var(--wpbccp-font-size-md);
    line-height: var(--wpbccp-line-height-normal);
    margin: 0;
    color: var(--wpbccp-color-text-muted);
}

#wpbccp-preferences .wpbccp-category-pill {
    font-size: var(--wpbccp-font-size-xs);
    line-height: 14px;
    padding: 2px 8px;
    border-radius: 999px;
}

#wpbccp-preferences .wpbccp-category-pill-required {
    background: #eeeeee;
    color: #333333;
}

/* Lidt ekstra padding til descriptions ift. switch */
#wpbccp-preferences .wpbccp-category p {
    padding-right: 80px;
}

/* Toggle switch */
#wpbccp-preferences .wpbccp-switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 20px;
}

#wpbccp-preferences .wpbccp-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

#wpbccp-preferences .wpbccp-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #cccccc;
    border-radius: 20px;
    transition: 0.3s;
}

#wpbccp-preferences .wpbccp-slider::before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    top: 3px;
    background-color: #ffffff;
    border-radius: 50%;
    transition: 0.3s;
}

#wpbccp-preferences .wpbccp-switch input:checked + .wpbccp-slider {
    background-color: var(--wpbccp-color-accent);
}

#wpbccp-preferences .wpbccp-switch input:checked + .wpbccp-slider::before {
    transform: translateX(18px);
}

/* Modal footer */
#wpbccp-preferences .wpbccp-modal-footer {
    padding: 20px 16px 5px;
    border-top: 1px solid var(--wpbccp-color-border);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

/* Footer-knapper */
#wpbccp-preferences .wpbccp-footer-buttons {
    display: flex;
    gap: 10px;
}

/* Gem / Annuller – variant */
#wpbccp-preferences .wpbccp-btn-save-preferences,
#wpbccp-preferences .wpbccp-btn-cancel-preferences {
    background: var(--wpbccp-color-btn-bg);
    color: var(--wpbccp-color-btn-text);
    border: 1px solid var(--wpbccp-color-btn-border);
}

#wpbccp-preferences .wpbccp-btn-save-preferences:hover,
#wpbccp-preferences .wpbccp-btn-cancel-preferences:hover {
    filter: brightness(0.9);
}

/* "Leveret af" */
#wpbccp-preferences .wpbccp-powered-by,
#wpbccp-preferences .wpbccp-powered-by a {
    font-size: var(--wpbccp-font-size-xs);
    font-weight: var(--wpbccp-font-weight-bold);
    opacity: 0.7;
    text-align: right;
    margin-left: auto;
    color: #333333;
}

#wpbccp-preferences .wpbccp-powered-by a {
    text-decoration: none;
    font-weight: var(--wpbccp-font-weight-medium);
    color: #000000;
}

#wpbccp-preferences .wpbccp-powered-by a:hover {
    text-decoration: underline;
    color: #333333;
}

/**************************************************************
  5) BUTTONS – FÆLLES KNAP-STYLES + FOKUS
**************************************************************/

/* Basis-knapper (banner + modal) */
#wpbccp-banner .wpbccp-btn,
#wpbccp-preferences .wpbccp-btn {
    display: inline-block;
    padding: 8px 14px;
    border-radius: var(--wpbccp-radius-sm);
    font-size: var(--wpbccp-font-size-sm);
    font-weight: var(--wpbccp-font-weight-medium);
    line-height: var(--wpbccp-line-height-tight);
    border: 1px solid var(--wpbccp-color-border-medium);
    background: var(--wpbccp-color-btn-bg);
    color: var(--wpbccp-color-btn-text);
    cursor: pointer;
}

/* Manage button – struktur + basis */
#wpbccp-manage.wpbccp-manage-button {
    position: fixed;
    bottom: 15px;
    z-index: 99999;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px;
    border-radius: var(--wpbccp-radius-md);
    background: var(--wpbccp-manage-bg);
    color: var(--wpbccp-manage-text-color);
    font-size: var(--wpbccp-font-size-sm);
    border: none;
    cursor: pointer;
    opacity: 0.8;
    transition: background 0.3s ease, opacity 0.3s ease;
}

/* Placeringer */
#wpbccp-manage.wpbccp-manage-left {
    left: 14px;
    right: auto;
}

#wpbccp-manage.wpbccp-manage-right {
    right: 14px;
    left: auto;
}

/* Ikon */
#wpbccp-manage .wpbccp-manage-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    background: url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyBpZD0iTGF5ZXJfMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCA3NC4wOCA3NC4xNSI+CiAgPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDMwLjAuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDIuMS4xIEJ1aWxkIDEyMykgIC0tPgogIDxkZWZzPgogICAgPHN0eWxlPgogICAgICAuc3QwIHsKICAgICAgICBmaWxsOiAjODViZTRmOwogICAgICB9CgogICAgICAuc3QxIHsKICAgICAgICBmaWxsOiAjNzhhYmNlOwogICAgICB9CiAgICA8L3N0eWxlPgogIDwvZGVmcz4KICA8ZyBpZD0iTGF5ZXJfMS0yIj4KICAgIDxwb2x5Z29uIGNsYXNzPSJzdDAiIHBvaW50cz0iNjcuNzYgMCAyOC42MSA0My4wNiAxNy4yNCAzNC40NSAxMC45MiAzNC40NSAyOC42MSA2My4xNiA3NC4wOCAwIDY3Ljc2IDAiLz4KICAgIDxwYXRoIGNsYXNzPSJzdDEiIGQ9Ik02Mi43MSw2My4xNmMwLC43LS41NiwxLjI2LTEuMjYsMS4yNkgxMC45MmMtLjcsMC0xLjI2LS41Ni0xLjI2LTEuMjZWMTIuNjNjMC0uNy41Ni0xLjI2LDEuMjYtMS4yNmgzNC41NWw2Ljg5LTcuNThINC42Yy0xLjQsMC0yLjUzLDEuMTMtMi41MywyLjUzdjYzLjE2YzAsMS40LDEuMTMsMi41MywyLjUzLDIuNTNoNjMuMTZjMS40LDAsMi41My0xLjEzLDIuNTMtMi41M1YyMC40bC03LjU4LDEwLjUzdjMyLjI0aDBaIi8+CiAgPC9nPgo8L3N2Zz4=") no-repeat center center / contain;
    flex-shrink: 0;
}

/* Tekst */
#wpbccp-manage .wpbccp-manage-text {
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    transition: all 0.4s ease-in-out;
    margin-left: 3px;
}

/* Når scrolled – skjul tekst */
#wpbccp-manage.wpbccp-manage-button.scrolled .wpbccp-manage-text {
    max-width: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
}

/* Hvis ingen tekst fra admin */
#wpbccp-manage.wpbccp-manage-button.no-text .wpbccp-manage-text {
    display: none !important;
}

/* Hover */
#wpbccp-manage.wpbccp-manage-button:hover {
    opacity: 1;
}

/* Fokus-reset (for at fjerne blå kant fra tema/browser) */
#wpbccp-banner button,
#wpbccp-banner .wpbccp-btn,
#wpbccp-preferences button,
#wpbccp-preferences .wpbccp-btn,
#wpbccp-manage.wpbccp-manage-button {
    outline: none !important;
    box-shadow: none !important;
}

/* Egen, diskret fokus-stil for keyboard-brugere */
#wpbccp-banner .wpbccp-btn:focus-visible,
#wpbccp-preferences .wpbccp-btn:focus-visible,
#wpbccp-manage.wpbccp-manage-button:focus-visible {
    outline: 2px solid var(--wpbccp-color-accent);
    outline-offset: 2px;
    box-shadow: none !important;
}

/**************************************************************
  6) MISC – COOKIE DECLARATION PAGE
**************************************************************/
.wpbccp-cookie-declaration {
    max-width: 100%;
    margin: 2rem auto;
    font-size: 15px;
    line-height: 1.6;
}

.wpbccp-cookie-declaration-header h2 {
    margin-bottom: 0.5rem;
}

.wpbccp-cookie-declaration-intro {
    margin-bottom: 1.5rem;
}

.wpbccp-cookie-declaration-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e5e5;
}

.wpbccp-cookie-declaration-section h3 {
    margin-bottom: 0.5rem;
}

.wpbccp-cookie-declaration-text table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
}

.wpbccp-cookie-declaration-text table th,
.wpbccp-cookie-declaration-text table td {
    border: 1px solid #ddd;
    padding: 6px 8px;
    text-align: left;
}

.wpbccp-cookie-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0 24px;
    font-size: 14px;
}

.wpbccp-cookie-table th,
.wpbccp-cookie-table td {
    border: 1px solid #ddd;
    padding: 8px 10px;
}

.wpbccp-cookie-table th {
    background: #f5f5f5;
    font-weight: 600;
    text-align: left;
}

.wpbccp-cookie-table tr:nth-child(even) {
    background: #fafafa;
}

/* WPBCCP Cookie Overview – frontend table */
.wpbccp-cookie-overview {
    margin: 2em 0;
    overflow-x: auto;
}

.wpbccp-cookie-overview table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    line-height: 1.4;
}

.wpbccp-cookie-overview thead th {
    background: #f6f7f7;
    color: #1d2327;
    font-weight: 600;
    text-align: left;
    padding: 12px 14px;
    border-bottom: 2px solid #ccd0d4;
}

.wpbccp-cookie-overview tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: top;
}

.wpbccp-cookie-overview tbody tr:nth-child(even) {
    background: #fafafa;
}

.wpbccp-cookie-overview tbody tr:hover {
    background: #f1f1f1;
}

.wpbccp-cookie-overview code {
    background: #eef0f1;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 13px;
    white-space: nowrap;
}

.wpbccp-cookie-overview td[colspan] {
    text-align: center;
    font-style: italic;
    color: #666;
}

/* Optional: category color hints */
.wpbccp-cookie-overview .category-necessary { color: #2271b1; }
.wpbccp-cookie-overview .category-functional { color: #1e8cbe; }
.wpbccp-cookie-overview .category-statistics { color: #00a32a; }
.wpbccp-cookie-overview .category-marketing { color: #b32d2e; }


/**************************************************************
  7) RESPONSIVE – MOBIL-JUSTERINGER
**************************************************************/
@media (max-width: 600px) {
    #wpbccp-banner .wpbccp-banner-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    #wpbccp-banner .wpbccp-banner-buttons {
        width: 100%;
        justify-content: flex-start;
    }

    #wpbccp-preferences .wpbccp-modal-dialog {
        width: 95%;
        margin: 30px auto;
        max-height: calc(100vh - 180px);
        border-radius: var(--wpbccp-radius-md);
    }

    #wpbccp-manage.wpbccp-manage-right {
        right: 8px;
    }

    #wpbccp-manage.wpbccp-manage-left {
        left: 8px;
    }

    #wpbccp-manage.wpbccp-manage-button {
        z-index: 99998;
    }
}
