/**
 * Overwatch Compliance — Cookie Consent Banner & Preferences Panel
 *
 * Self-contained dark theme. Designed for Revolution PTS palette
 * but adapts to any dark site via CSS custom properties.
 */

:root {
    --owc-bg: #0C1620;
    --owc-bg-light: #162231;
    --owc-text: #D8CDB8;
    --owc-text-muted: #9a9080;
    --owc-accent: #E84C30;
    --owc-accent-hover: #d43d22;
    --owc-border: rgba(216, 205, 184, 0.15);
    --owc-radius: 8px;
    --owc-font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ── Banner ─────────────────────────────────────── */

.owc-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: var(--owc-bg);
    border-top: 1px solid var(--owc-border);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4);
    font-family: var(--owc-font);
}

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

.owc-banner__text {
    flex: 1;
    min-width: 280px;
}

.owc-banner__text p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--owc-text);
}

.owc-banner__link {
    color: var(--owc-accent);
    text-decoration: underline;
    margin-left: 4px;
}

.owc-banner__link:hover {
    color: var(--owc-accent-hover);
}

.owc-banner__actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* ── Buttons ────────────────────────────────────── */

.owc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: var(--owc-radius);
    font-family: var(--owc-font);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.2s;
    white-space: nowrap;
}

.owc-btn--accept {
    background: var(--owc-accent);
    color: #fff;
}

.owc-btn--accept:hover {
    background: var(--owc-accent-hover);
}

.owc-btn--reject {
    background: transparent;
    color: var(--owc-text-muted);
    border: 1px solid var(--owc-border);
}

.owc-btn--reject:hover {
    background: var(--owc-bg-light);
    color: var(--owc-text);
}

.owc-btn--manage {
    background: var(--owc-bg-light);
    color: var(--owc-text);
    border: 1px solid var(--owc-border);
}

.owc-btn--manage:hover {
    border-color: var(--owc-text-muted);
}

.owc-btn--save {
    background: var(--owc-accent);
    color: #fff;
}

.owc-btn--save:hover {
    background: var(--owc-accent-hover);
}

/* ── Preferences Panel ──────────────────────────── */

.owc-prefs {
    position: fixed;
    inset: 0;
    z-index: 100000;
    font-family: var(--owc-font);
}

.owc-prefs__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.owc-prefs__panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 560px;
    max-height: 80vh;
    background: var(--owc-bg);
    border: 1px solid var(--owc-border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

.owc-prefs__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--owc-border);
}

.owc-prefs__header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--owc-text);
}

.owc-prefs__close {
    background: none;
    border: none;
    color: var(--owc-text-muted);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.owc-prefs__close:hover {
    color: var(--owc-text);
}

.owc-prefs__body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

/* ── Category Row ───────────────────────────────── */

.owc-category {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--owc-border);
}

.owc-category:last-child {
    border-bottom: none;
}

.owc-category__info {
    flex: 1;
}

.owc-category__label {
    font-size: 15px;
    font-weight: 600;
    color: var(--owc-text);
    margin-bottom: 4px;
}

.owc-category__desc {
    font-size: 13px;
    color: var(--owc-text-muted);
    line-height: 1.4;
    margin: 0;
}

.owc-category__badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--owc-text-muted);
    margin-left: 8px;
}

/* ── Toggle Switch ──────────────────────────────── */

.owc-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    margin-top: 2px;
}

.owc-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.owc-toggle__slider {
    position: absolute;
    inset: 0;
    background: var(--owc-bg-light);
    border: 1px solid var(--owc-border);
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.owc-toggle__slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: var(--owc-text-muted);
    border-radius: 50%;
    transition: transform 0.2s, background-color 0.2s;
}

.owc-toggle input:checked + .owc-toggle__slider {
    background: var(--owc-accent);
    border-color: var(--owc-accent);
}

.owc-toggle input:checked + .owc-toggle__slider::after {
    transform: translateX(20px);
    background: #fff;
}

.owc-toggle input:disabled + .owc-toggle__slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Prefs Footer ───────────────────────────────── */

.owc-prefs__footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 16px 24px;
    border-top: 1px solid var(--owc-border);
    flex-wrap: wrap;
}

/* ── Mobile ─────────────────────────────────────── */

@media (max-width: 600px) {
    .owc-banner__inner {
        flex-direction: column;
        align-items: stretch;
        padding: 16px;
        gap: 16px;
    }

    .owc-banner__actions {
        flex-direction: column;
    }

    .owc-btn {
        width: 100%;
    }

    .owc-prefs__panel {
        width: 95%;
        max-height: 90vh;
    }

    .owc-prefs__footer {
        flex-direction: column;
    }
}
