/*
  NexusConsent neutral theme tokens
  Override any of these in your template to brand the UI with minimal effort.
*/
:root {
    --nxc-surface: #ffffff; /* surfaces (banner/dialog/buttons) */
    --nxc-text: #1f2937; /* neutral-800 */
    --nxc-muted: #6b7280; /* neutral-500 */
    --nxc-border: #e5e7eb; /* neutral-200 */
    --nxc-accent: #3b82f6;
    --nxc-accent-contrast: #ffffff;
    --nxc-overlay: rgba(0, 0, 0, 0.42);
    --nxc-shadow: rgba(0, 0, 0, 0.2);
    --nxc-radius: 8px;
    --nxc-spacing: 16px;
    --nxc-font: 16px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, Ubuntu,
        'Helvetica Neue', Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --nxc-surface: #111827; /* neutral-900 */
        --nxc-text: #f3f4f6; /* neutral-100 */
        --nxc-muted: #9ca3af; /* neutral-400 */
        --nxc-border: #374151; /* neutral-700 */
        --nxc-shadow: rgba(0, 0, 0, 0.5);
    }
}

/* Force theme regardless of device preference */
.nexusconsent-theme-light {
    --nxc-surface: #ffffff;
    --nxc-text: #1f2937;
    --nxc-muted: #6b7280;
    --nxc-border: #e5e7eb;
    --nxc-shadow: rgba(0, 0, 0, 0.2);
}
.nexusconsent-theme-dark {
    --nxc-surface: #111827;
    --nxc-text: #f3f4f6;
    --nxc-muted: #9ca3af;
    --nxc-border: #374151;
    --nxc-shadow: rgba(0, 0, 0, 0.5);
}

.nexusconsent-banner {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 99999;
    display: flex;
    gap: 12px;
    align-items: stretch;
    justify-content: center;
    padding: 24px 16px;
    background: var(--nxc-surface);
    color: var(--nxc-text);
    box-shadow: 0 -4px 20px var(--nxc-shadow);
    font: var(--nxc-font);
    min-height: 80px;
    backdrop-filter: blur(2px);
    border-top: 1px solid var(--nxc-border);
    flex-direction: column;
}

@media (max-width: 767px) {
    .nexusconsent-banner {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 20px;
        padding: 24px 16px;
        min-height: 120px;
    }

    .nexusconsent-actions {
        justify-content: center;
    }
}
.nexusconsent-bottom {
    bottom: 0;
}
.nexusconsent-top {
    top: 0;
}
.nexusconsent-text {
    max-width: 820px;
    margin: 0 auto;
}
.nexusconsent-status {
    font-size: 14px;
    margin-bottom: 8px;
}
.nexusconsent-status-accepted {
    color: var(--nxc-accent);
}
.nexusconsent-status-necessary {
    color: var(--nxc-muted);
}
.nexusconsent-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}
.nexusconsent-attribution {
    margin-top: 12px;
    font-size: 12px;
    color: var(--nxc-muted);
    text-align: center;
}
.nexusconsent-attribution a {
    color: inherit;
    text-decoration: underline;
}
.nexusconsent-panel .nxc-cats {
    margin: 8px auto 0;
    max-width: 820px;
}
.nexusconsent-btn {
    appearance: none;
    cursor: pointer;
    transition: all 0.4s ease;
    border-radius: var(--nxc-radius);
}
.nexusconsent-accept {
    padding: 16px 32px;
    color: var(--nxc-accent-contrast);
    background: var(--nxc-accent);
    border: 2px solid var(--nxc-accent);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 18px;
    box-shadow: 0 4px 12px var(--nxc-shadow);
}
.nexusconsent-accept:hover {
    filter: brightness(0.92);
    box-shadow: 0 4px 8px var(--nxc-shadow);
    transform: translateY(-1px);
}
.nexusconsent-decline {
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 400;
    color: var(--nxc-muted);
    border: 1px solid var(--nxc-border);
    text-transform: uppercase;
    background: transparent;
    transition: all 0.4s ease;
}
.nexusconsent-decline:hover {
    color: var(--nxc-text);
    border-color: var(--nxc-muted);
}
.nexusconsent-revoke {
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 400;
    color: var(--nxc-muted);
    border: 1px solid var(--nxc-border);
    text-transform: uppercase;
    background: transparent;
    transition: all 0.4s ease;
}
.nexusconsent-revoke:hover {
    color: var(--nxc-text);
    border-color: var(--nxc-muted);
}
.nexusconsent-revoke-fab {
    position: fixed;
    z-index: 99999;
    border: 1px solid var(--nxc-border);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    background: var(--nxc-surface);
    color: var(--nxc-text);
    cursor: pointer;
    box-shadow: 0 2px 10px var(--nxc-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
}
.nexusconsent-revoke-fab svg {
    width: 20px;
    height: 20px;
    display: block;
}

.nexusconsent-revoke-fab:hover {
    background: var(--nxc-accent);
    color: var(--nxc-accent-contrast);
    transform: rotate(90deg);
}

/* FAB position helpers */
.nexusconsent-fab-tl {
    top: 12px;
    left: 12px;
    right: auto;
    bottom: auto;
}
.nexusconsent-fab-tr {
    top: 12px;
    right: 12px;
    left: auto;
    bottom: auto;
}
.nexusconsent-fab-bl {
    bottom: 12px;
    left: 12px;
    top: auto;
    right: auto;
}
.nexusconsent-fab-br {
    bottom: 12px;
    right: 12px;
    top: auto;
    left: auto;
}

.nexusconsent-overlay {
    position: fixed;
    inset: 0;
    background: var(--nxc-overlay);
    z-index: 99998;
    pointer-events: auto; /* block clicks */
}
.nexusconsent-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    pointer-events: none; /* don't block interactions outside dialog */
}
.nexusconsent-dialog {
    max-width: 767px;
    margin: 0 16px;
    background: var(--nxc-surface);
    color: var(--nxc-text);
    border-radius: var(--nxc-radius);
    box-shadow: 0 10px 40px var(--nxc-shadow);
    padding: 24px;
    font: var(--nxc-font);
    pointer-events: auto; /* keep dialog interactive */
}
.nexusconsent-dialog .nexusconsent-text {
    margin-bottom: 16px;
}
.nexusconsent-dialog .nexusconsent-actions {
    justify-content: flex-start;
}
.nexusconsent-scroll-lock {
    overflow: hidden !important;
}

/* Category toggles */
.nxc-cats {
    margin: 8px 0 16px;
    border-radius: var(--nxc-radius);
    padding: 8px 12px;
}
.nxc-cats legend {
    font-weight: 600;
    font-size: 14px;
    color: var(--nxc-muted);
}
.nxc-cat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 6px 12px 6px 0;
}

/* Category wrapper with service list */
.nxc-cat-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--nxc-border);
}
.nxc-cat-wrapper:last-child {
    border-bottom: none;
    margin-bottom: 0;
}
.nxc-cat-wrapper .nxc-cat {
    margin: 0;
}

/* Essential-only note when no optional categories are configured */
.nxc-essential-only {
    font-size: 13px;
    color: var(--nxc-muted);
    margin: 8px 0 0;
    padding: 0;
}

/* Service names list under each category */
.nxc-services {
    display: block;
    font-size: 12px;
    color: var(--nxc-muted);
    padding-left: 24px;
    line-height: 1.4;
}

/* Optional categories expandable section */
.nxc-optional {
    margin-top: 8px;
}
.nxc-optional summary {
    cursor: pointer;
    font-weight: 500;
    color: var(--nxc-text);
    padding: 6px 0;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
}
.nxc-optional summary::-webkit-details-marker {
    display: none;
}
.nxc-optional summary::before {
    content: '▶';
    font-size: 10px;
    transition: transform 0.2s ease;
}
.nxc-optional[open] summary::before {
    transform: rotate(90deg);
}
.nxc-optional-body {
    padding: 8px 0 0 8px;
}
.nxc-save {
    border: 1px solid var(--nxc-border);
    padding: 10px 16px;
    background: transparent;
    color: var(--nxc-text);
}

/* Cookie manager */
.nxc-cookies {
    margin-top: 12px;
}
.nxc-cookie-tools {
    display: flex;
    gap: 8px;
    margin: 8px 0;
}
.nxc-cookie-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.nxc-cookie-table th,
.nxc-cookie-table td {
    border: 1px solid var(--nxc-border);
    padding: 6px 8px;
    text-align: left;
}
.nxc-cookie-table thead {
    background: rgba(0, 0, 0, 0.03);
}
