/* ============================================================
   Nixxor Cookie Consent v2 — Frontend CSS
   ============================================================ */

/* Custom properties — overridden via JS from admin settings */
:root {
    --ncc-accent:      #1a6eb5;
    --ncc-radius:      12px;

    /* Dark theme (default) */
    --ncc-bg:          #1a1f2e;
    --ncc-surface:     #242938;
    --ncc-border:      rgba(255,255,255,.1);
    --ncc-text:        #e8eaf0;
    --ncc-muted:       rgba(232,234,240,.55);
    --ncc-btn-ghost-text: rgba(232,234,240,.75);
    --ncc-overlay:     rgba(0,0,0,.6);
    --ncc-shadow:      0 8px 32px rgba(0,0,0,.45);
    --ncc-toggle-off:  rgba(255,255,255,.18);
}

html.ncc-theme-light {
    --ncc-bg:          #ffffff;
    --ncc-surface:     #f5f6fa;
    --ncc-border:      rgba(0,0,0,.1);
    --ncc-text:        #1a1f2e;
    --ncc-muted:       rgba(26,31,46,.5);
    --ncc-btn-ghost-text: rgba(26,31,46,.65);
    --ncc-overlay:     rgba(0,0,0,.4);
    --ncc-shadow:      0 8px 32px rgba(0,0,0,.15);
    --ncc-toggle-off:  rgba(0,0,0,.18);
}

/* body block */
body.ncc-blocked { overflow: hidden; }

/* ── visibility states ─────────────────────────────────── */
.ncc-hidden  { display: none !important; }
.ncc-visible { display: block; }

/* ── Banner ─────────────────────────────────────────────── */
#ncc-banner {
    position: fixed;
    z-index: 999990;
    left: 0; right: 0;
    background: var(--ncc-bg);
    color: var(--ncc-text);
    box-shadow: var(--ncc-shadow);
    border-top: 1px solid var(--ncc-border);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    animation: nccSlideIn .28s cubic-bezier(.22,1,.36,1) both;
}

/* positions */
#ncc-banner { bottom: 0; }
html[data-ncc-pos="top"] #ncc-banner { top: 0; bottom: auto; border-top: none; border-bottom: 1px solid var(--ncc-border); }
html[data-ncc-pos="bottom-left"]  #ncc-banner { bottom:16px; left:16px; right:auto; max-width:400px; border-radius:var(--ncc-radius); border:1px solid var(--ncc-border); }
html[data-ncc-pos="bottom-right"] #ncc-banner { bottom:16px; right:16px; left:auto; max-width:400px; border-radius:var(--ncc-radius); border:1px solid var(--ncc-border); }

@keyframes nccSlideIn {
    from { opacity:0; transform:translateY(100%); }
    to   { opacity:1; transform:translateY(0); }
}
html[data-ncc-pos="top"] #ncc-banner { animation-name: nccSlideDown; }
@keyframes nccSlideDown {
    from { opacity:0; transform:translateY(-100%); }
    to   { opacity:1; transform:translateY(0); }
}

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

/* lang switcher lives top-right of banner */
.ncc-lang-switcher {
    margin-left: auto;
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    order: -1;
    width: 100%;
    justify-content: flex-end;
}
.ncc-lang-btn {
    background: none;
    border: 1px solid var(--ncc-border);
    color: var(--ncc-muted);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: .05em;
    transition: background .15s, color .15s;
}
.ncc-lang-btn:hover,
.ncc-lang-btn.active { background: var(--ncc-accent); border-color: var(--ncc-accent); color: #fff; }

.ncc-banner-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    flex: 0 0 100%;
}
.ncc-banner-text {
    margin: 0;
    flex: 1 1 300px;
    color: var(--ncc-muted);
    font-size: 13px;
}
.ncc-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex-shrink: 0;
}
.ncc-banner-footer {
    flex: 0 0 100%;
    font-size: 11px;
    color: var(--ncc-muted);
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 4px;
}
.ncc-banner-footer a { color: var(--ncc-muted); text-decoration: underline; }
.ncc-banner-footer a:hover { color: var(--ncc-text); }
.ncc-powered { margin-left: auto; }
.ncc-powered-link { color: var(--ncc-muted); text-decoration: none; transition: color .15s; }
.ncc-powered-link:hover { color: var(--ncc-accent); }

/* ── Buttons ────────────────────────────────────────────── */
.ncc-btn {
    border: none;
    border-radius: calc(var(--ncc-radius) * .5);
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .15s, transform .1s;
    white-space: nowrap;
    font-family: inherit;
}
.ncc-btn:hover  { opacity: .88; }
.ncc-btn:active { transform: scale(.97); }

.ncc-btn-primary   { background: var(--ncc-accent); color: #fff; }
.ncc-btn-secondary { background: var(--ncc-surface); color: var(--ncc-text); border: 1px solid var(--ncc-border); }
.ncc-btn-ghost     { background: transparent; color: var(--ncc-btn-ghost-text); text-decoration: underline; padding: 9px 8px; }

/* ── Modal ──────────────────────────────────────────────── */
#ncc-modal {
    position: fixed;
    inset: 0;
    z-index: 999995;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
}
#ncc-modal.ncc-visible { display: flex; }

.ncc-modal-overlay {
    position: absolute;
    inset: 0;
    background: var(--ncc-overlay);
    backdrop-filter: blur(3px);
}

.ncc-modal-box {
    position: relative;
    background: var(--ncc-bg);
    color: var(--ncc-text);
    border-radius: var(--ncc-radius);
    box-shadow: var(--ncc-shadow);
    width: min(540px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding: 28px 28px 20px;
    animation: nccFadeUp .25s ease both;
    border: 1px solid var(--ncc-border);
}

@keyframes nccFadeUp {
    from { opacity:0; transform:translateY(20px) scale(.97); }
    to   { opacity:1; transform:translateY(0) scale(1); }
}

.ncc-modal-close {
    position: absolute;
    top: 14px; right: 16px;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--ncc-muted);
    line-height: 1;
    padding: 4px 6px;
    transition: color .15s;
}
.ncc-modal-close:hover { color: var(--ncc-text); }

.ncc-modal-title {
    margin: 0 0 20px;
    font-size: 17px;
    font-weight: 700;
}

/* ── Category rows ──────────────────────────────────────── */
.ncc-categories { display: flex; flex-direction: column; gap: 0; }

.ncc-cat-row {
    padding: 14px 0;
    border-bottom: 1px solid var(--ncc-border);
}
.ncc-cat-row:last-child { border-bottom: none; }

.ncc-cat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.ncc-cat-label {
    font-weight: 600;
    font-size: 13px;
}
.ncc-cat-desc {
    margin: 6px 0 0;
    color: var(--ncc-muted);
    font-size: 12px;
    line-height: 1.5;
}

.ncc-always-on {
    font-size: 11px;
    color: var(--ncc-accent);
    font-weight: 600;
    white-space: nowrap;
}

/* ── Toggle switch ──────────────────────────────────────── */
.ncc-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    cursor: pointer;
}
.ncc-toggle input {
    opacity: 0;
    width: 0; height: 0;
    position: absolute;
}
.ncc-toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--ncc-toggle-off);
    border-radius: 12px;
    transition: background .2s;
}
.ncc-toggle-slider::before {
    content: '';
    position: absolute;
    left: 3px; top: 3px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: transform .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.ncc-toggle input:checked + .ncc-toggle-slider { background: var(--ncc-accent); }
.ncc-toggle input:checked + .ncc-toggle-slider::before { transform: translateX(20px); }
.ncc-toggle input:focus-visible + .ncc-toggle-slider { outline: 2px solid var(--ncc-accent); outline-offset: 2px; }

/* ── Modal actions / footer ─────────────────────────────── */
.ncc-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--ncc-border);
}
.ncc-modal-footer {
    margin-top: 12px;
    font-size: 11px;
    color: var(--ncc-muted);
    display: flex;
    gap: 6px;
    align-items: center;
}
.ncc-modal-footer a { color: var(--ncc-muted); text-decoration: underline; }
.ncc-modal-footer a:hover { color: var(--ncc-text); }

/* ── Reopen floating button ─────────────────────────────── */
#ncc-reopen {
    position: fixed;
    bottom: 16px;
    left: 16px;
    z-index: 999989;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--ncc-bg);
    color: var(--ncc-text);
    border: 1px solid var(--ncc-border);
    box-shadow: var(--ncc-shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s, box-shadow .2s;
}
#ncc-reopen.ncc-visible { display: flex; }
#ncc-reopen:hover { transform: scale(1.1); box-shadow: 0 6px 20px rgba(0,0,0,.35); }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 600px) {
    .ncc-banner-inner { padding: 14px 16px; gap: 10px 12px; }
    .ncc-banner-actions { width: 100%; }
    .ncc-btn { flex: 1 1 auto; text-align: center; }
    .ncc-modal-box { padding: 20px 16px 16px; }
    .ncc-modal-actions { flex-direction: column; }
    .ncc-modal-actions .ncc-btn { width: 100%; text-align: center; }
}

/* ── Reduced motion ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    #ncc-banner, .ncc-modal-box { animation: none; }
    .ncc-toggle-slider, .ncc-toggle-slider::before { transition: none; }
}
