/*
 * Cookie Consent Plugin — Frontend Styles
 * Neuno Oy custom theme: Pill buttons, extra-slow slide-up banner, fading centered modal, rounded switches.
 */
.cc-root {
    --cc-bg: #ffffff;
    --cc-text: #000000;
    --cc-accent: #c22400;
    --cc-border: rgba(0, 0, 0, 0.1);
    color: var(--cc-text);
    line-height: 1.5;
}

/* Background dimmer overlay */
.cc-root:not([hidden])::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2147482999;
    pointer-events: auto;
    animation: cc-fade-in 0.6s ease forwards;
}

/* Force hidden elements */
.cc-root[hidden], .cc-banner[hidden], .cc-modal[hidden], .cc-modal-backdrop[hidden] {
    display: none !important;
}

/* ─── Banner (Extra Slow slide up from bottom) ────────────────────────── */
.cc-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2147483000;
    background: var(--cc-bg);
    border-top: 1px solid var(--cc-border);
    padding: 1.5rem 2.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    max-width: 100%;
    margin: 0 auto;
    animation: cc-slide-up-banner 1.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.cc-banner-body {
    flex: 1;
    min-width: 0;
}

.cc-banner-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    color: var(--cc-text);
}

.cc-banner-text {
    font-size: 0.9rem;
    margin: 0;
    color: #333333;
    line-height: 1.45;
    max-width: 850px;
}

.cc-banner-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

/* ─── Default Pill Buttons ────────────────────────────────────────────── */
.cc-btn {
    padding: 0.6rem 1.4rem;
    border-radius: 999px;
    border: none;
    background: transparent;
    color: var(--cc-text);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    line-height: 1.2;
    transition: background 0.15s ease, filter 0.15s ease;
    text-decoration: none;
}

/* Customize text link / Outline buttons on main banner */
.cc-btn--outline, .cc-btn--text {
    background: transparent;
    border: none;
    color: #c22400;
    text-decoration: underline;
    text-underline-offset: 3px;
    padding: 0.6rem 0.8rem;
    border-radius: 0px;
}

.cc-btn--outline:hover, .cc-btn--text:hover {
    color: #a01d01;
}

/* Primary and Danger action buttons (Solid Red, Pill-shaped) */
.cc-btn--primary, .cc-btn--danger {
    background: #c22400;
    color: #ffffff;
    border: none;
    border-radius: 999px;
}

.cc-btn--primary:hover, .cc-btn--danger:hover {
    background: #a01d01;
}

/* ─── Modal Customization Window (Pure Fade-In) ───────────────────────── */
.cc-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2147483100;
    animation: cc-fade-in 0.4s ease forwards;
}

.cc-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2147483101;
    background: var(--cc-bg);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
    width: min(560px, calc(100vw - 2rem));
    max-height: min(85vh, 700px);
    display: flex;
    flex-direction: column;
    border-radius: 0px;
    animation: cc-fade-in 0.5s ease-out forwards;
}

.cc-modal-head {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--cc-border);
}

.cc-modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: var(--cc-text);
}

.cc-modal-close {
    background: transparent;
    border: none;
    color: #666;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.2rem;
}

.cc-modal-body {
    padding: 1.25rem 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.cc-modal-actions {
    padding: 1rem 1.5rem;
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    align-items: center;
    border-top: 1px solid var(--cc-border);
    background: rgba(0, 0, 0, 0.01);
}

/* Give buttons inside modal actions solid pill shapes by default */
.cc-modal-actions .cc-btn {
    background: #c22400 !important;
    color: #ffffff !important;
    border-radius: 999px !important;
    border: none !important;
    text-decoration: none !important;
    padding: 0.6rem 1.4rem !important;
}

.cc-modal-actions .cc-btn:hover {
    background: #a01d01 !important;
}

/* Target ONLY the final "Save preferences" button inside the modal to be a text link */
.cc-modal-actions .cc-btn:last-child {
    order: -1;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    color: #c22400 !important;
    text-decoration: underline !important;
    text-underline-offset: 3px !important;
    padding: 0.5rem 0.75rem !important;
}

.cc-modal-actions .cc-btn:last-child:hover {
    color: #a01d01 !important;
    background: transparent !important;
}

/* ─── Rounded Toggle Switch ────────────────────────────────────────────── */
.cc-switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
    cursor: pointer;
}

.cc-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cc-switch-slider {
    position: absolute;
    inset: 0;
    background: #ccc;
    border-radius: 999px;
    transition: background 0.2s ease;
}

.cc-switch-slider::before {
    content: '';
    position: absolute;
    left: 3px;
    top: 3px;
    width: 18px;
    height: 18px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease;
}

.cc-switch input:checked + .cc-switch-slider {
    background: #c22400;
}

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

/* ─── Motion Animations ───────────────────────────────────────────────── */
@keyframes cc-slide-up-banner {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes cc-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cc-banner, .cc-modal, .cc-modal-backdrop {
        animation: none;
    }
}

/* ─── Mobile Responsiveness (Stacked Buttons) ─────────────────────────── */
@media (max-width: 768px) {
    .cc-banner {
        flex-direction: column;
        align-items: stretch;
        padding: 1.25rem 1.5rem;
        gap: 1.25rem;
    }

    .cc-banner-actions {
        flex-direction: column;
        width: 100%;
        align-items: stretch;
        gap: 0.75rem;
    }

    .cc-banner-actions .cc-btn {
        width: 100%;
        text-align: center;
    }

    .cc-modal-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .cc-modal-actions .cc-btn {
        width: 100%;
        text-align: center;
    }
}