/**
 * Elefen Cookie Consent — Banner & Modal Styles
 * Vanilla CSS, no dependencies.
 */

/* ── Reset & Variables ─────────────────────────────────── */

.elefen-cc-banner *,
.elefen-cc-modal-overlay *,
.elefen-cc-review-btn * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --ecc-bg: #ffffff;
    --ecc-text: #1a1a1a;
    --ecc-text-secondary: #6b7280;
    --ecc-border: #e5e7eb;
    --ecc-btn-primary-bg: #2563eb;
    --ecc-btn-primary-text: #ffffff;
    --ecc-btn-secondary-bg: #e5e7eb;
    --ecc-btn-secondary-text: #374151;
    --ecc-radius: 8px;
    --ecc-shadow: 0 -2px 16px rgba(0, 0, 0, 0.1);
    --ecc-z: 999999;
}

/* ── Banner (Bottom Bar) ───────────────────────────────── */

.elefen-cc-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: var(--ecc-z);
    background: var(--ecc-bg);
    color: var(--ecc-text);
    box-shadow: var(--ecc-shadow);
    padding: 20px 24px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.elefen-cc-banner.is-visible {
    transform: translateY(0);
}

.elefen-cc-banner--bar-bottom {
    /* Default — already positioned */
}

.elefen-cc-banner--bar-top {
    bottom: auto;
    top: 0;
    transform: translateY(-100%);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.1);
}

.elefen-cc-banner--bar-top.is-visible {
    transform: translateY(0);
}

.elefen-cc-banner--box-bottom-left,
.elefen-cc-banner--box-bottom-right {
    bottom: 20px;
    left: auto;
    right: auto;
    max-width: 420px;
    border-radius: var(--ecc-radius);
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.elefen-cc-banner--box-bottom-left {
    left: 20px;
    right: auto;
}

.elefen-cc-banner--box-bottom-right {
    right: 20px;
    left: auto;
}

.elefen-cc-banner--box-bottom-left.is-visible,
.elefen-cc-banner--box-bottom-right.is-visible {
    transform: translateY(0);
    opacity: 1;
}

.elefen-cc-banner--modal {
    bottom: auto;
    top: 50%;
    left: 50%;
    right: auto;
    transform: translate(-50%, -50%) scale(0.95);
    opacity: 0;
    max-width: 520px;
    width: calc(100% - 40px);
    border-radius: var(--ecc-radius);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.elefen-cc-banner--modal.is-visible {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

/* ── Banner Inner Layout ───────────────────────────────── */

.elefen-cc-banner__inner {
    display: flex;
    align-items: center;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.elefen-cc-banner--box-bottom-left .elefen-cc-banner__inner,
.elefen-cc-banner--box-bottom-right .elefen-cc-banner__inner,
.elefen-cc-banner--modal .elefen-cc-banner__inner {
    flex-direction: column;
    align-items: stretch;
}

.elefen-cc-banner__content {
    flex: 1;
}

.elefen-cc-banner__title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--ecc-text);
}

.elefen-cc-banner__description {
    font-size: 14px;
    color: var(--ecc-text-secondary);
    line-height: 1.5;
}

.elefen-cc-banner__actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.elefen-cc-banner--box-bottom-left .elefen-cc-banner__actions,
.elefen-cc-banner--box-bottom-right .elefen-cc-banner__actions,
.elefen-cc-banner--modal .elefen-cc-banner__actions {
    flex-direction: column;
}

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

.elefen-cc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: calc(var(--ecc-radius) - 2px);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.15s ease, transform 0.1s ease;
    font-family: inherit;
    line-height: 1.2;
}

.elefen-cc-btn:hover {
    opacity: 0.9;
}

.elefen-cc-btn:active {
    transform: scale(0.98);
}

.elefen-cc-btn--primary {
    background: var(--ecc-btn-primary-bg);
    color: var(--ecc-btn-primary-text);
}

.elefen-cc-btn--secondary {
    background: var(--ecc-btn-secondary-bg);
    color: var(--ecc-btn-secondary-text);
}

.elefen-cc-btn--link {
    background: none;
    color: var(--ecc-btn-primary-bg);
    padding: 10px 12px;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ── Modal Overlay ─────────────────────────────────────── */

.elefen-cc-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: calc(var(--ecc-z) + 1);
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

.elefen-cc-modal-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.elefen-cc-modal {
    background: var(--ecc-bg);
    color: var(--ecc-text);
    border-radius: var(--ecc-radius);
    max-width: 560px;
    width: calc(100% - 40px);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 28px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.elefen-cc-modal-overlay.is-visible .elefen-cc-modal {
    transform: scale(1);
}

.elefen-cc-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.elefen-cc-modal__title {
    font-size: 18px;
    font-weight: 600;
    color: var(--ecc-text);
}

.elefen-cc-modal__close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--ecc-text-secondary);
    padding: 4px;
    line-height: 1;
}

.elefen-cc-modal__close:hover {
    color: var(--ecc-text);
}

/* ── Category Toggles ──────────────────────────────────── */

.elefen-cc-category {
    border: 1px solid var(--ecc-border);
    border-radius: calc(var(--ecc-radius) - 2px);
    margin-bottom: 12px;
    overflow: hidden;
}

.elefen-cc-category__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    cursor: pointer;
    user-select: none;
}

.elefen-cc-category__header:hover {
    background: rgba(0, 0, 0, 0.02);
}

.elefen-cc-category__info {
    flex: 1;
}

.elefen-cc-category__name {
    font-size: 14px;
    font-weight: 600;
    color: var(--ecc-text);
}

.elefen-cc-category__badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    color: var(--ecc-text-secondary);
    background: var(--ecc-border);
    border-radius: 4px;
    padding: 1px 6px;
    margin-left: 8px;
    vertical-align: middle;
}

.elefen-cc-category__count {
    display: inline-block;
    font-size: 11px;
    color: var(--ecc-text-secondary);
    margin-left: 8px;
    vertical-align: middle;
}

.elefen-cc-category__details {
    display: none;
    padding: 0 16px 14px;
}

.elefen-cc-category.is-expanded .elefen-cc-category__details {
    display: block;
}

.elefen-cc-category__desc {
    font-size: 13px;
    color: var(--ecc-text-secondary);
    line-height: 1.5;
    margin: 0 0 10px;
}

/* ── Services List ─────────────────────────────────────── */

.elefen-cc-services {
    margin-bottom: 10px;
}

.elefen-cc-services__title {
    font-size: 12px;
    font-weight: 600;
    color: var(--ecc-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.elefen-cc-services__list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.elefen-cc-services__item {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 13px;
    padding: 4px 0;
}

.elefen-cc-services__name {
    font-weight: 500;
    color: var(--ecc-text);
    white-space: nowrap;
}

.elefen-cc-services__desc {
    font-size: 12px;
    color: var(--ecc-text-secondary);
}

.elefen-cc-category__chevron {
    font-size: 12px;
    color: var(--ecc-text-secondary);
    transition: transform 0.2s ease;
    margin-left: 12px;
    flex-shrink: 0;
}

.elefen-cc-category.is-expanded .elefen-cc-category__chevron {
    transform: rotate(180deg);
}

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

.elefen-cc-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    margin-left: 12px;
}

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

.elefen-cc-toggle__slider {
    position: absolute;
    inset: 0;
    background: #d1d5db;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.elefen-cc-toggle__slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.elefen-cc-toggle input:checked + .elefen-cc-toggle__slider {
    background: var(--ecc-btn-primary-bg);
}

.elefen-cc-toggle input:checked + .elefen-cc-toggle__slider::after {
    transform: translateX(20px);
}

.elefen-cc-toggle input:disabled + .elefen-cc-toggle__slider {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ── Modal Actions ─────────────────────────────────────── */

.elefen-cc-modal__actions {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.elefen-cc-modal__actions .elefen-cc-btn {
    flex: 1;
    min-width: 120px;
}

/* ── Review Button (floating) ──────────────────────────── */

.elefen-cc-review-btn {
    position: fixed;
    z-index: calc(var(--ecc-z) - 1);
    background: var(--ecc-bg);
    color: var(--ecc-text);
    border: 1px solid var(--ecc-border);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    transition: opacity 0.2s ease, transform 0.2s ease;
    opacity: 0;
    transform: translateY(10px);
}

.elefen-cc-review-btn.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.elefen-cc-review-btn:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.elefen-cc-review-btn--bottom-left {
    bottom: 20px;
    left: 20px;
}

.elefen-cc-review-btn--bottom-right {
    bottom: 20px;
    right: 20px;
}

.elefen-cc-review-btn--top-left {
    top: 20px;
    left: 20px;
}

.elefen-cc-review-btn--top-right {
    top: 20px;
    right: 20px;
}

.elefen-cc-review-btn__icon {
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
    flex-shrink: 0;
}

.elefen-cc-review-btn--icon-only {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.elefen-cc-review-btn--icon-only .elefen-cc-review-btn__icon {
    margin-right: 0;
}

/* ── Dark Mode ─────────────────────────────────────────── */

.elefen-cc-banner--dark,
.elefen-cc-modal-overlay--dark .elefen-cc-modal,
.elefen-cc-review-btn--dark {
    --ecc-bg: #1f2937;
    --ecc-text: #f9fafb;
    --ecc-text-secondary: #9ca3af;
    --ecc-border: #374151;
    --ecc-btn-secondary-bg: #374151;
    --ecc-btn-secondary-text: #d1d5db;
}

/* ── Responsive ────────────────────────────────────────── */

@media (max-width: 768px) {
    .elefen-cc-banner__inner {
        flex-direction: column;
        align-items: stretch;
    }

    .elefen-cc-banner__actions {
        flex-direction: column;
    }

    .elefen-cc-btn {
        width: 100%;
    }

    .elefen-cc-modal {
        width: calc(100% - 20px);
        padding: 20px;
    }

    .elefen-cc-modal__actions {
        flex-direction: column;
    }

    .elefen-cc-modal__actions .elefen-cc-btn {
        min-width: auto;
    }
}
