/* CSS Variables are dynamically generated via PHP based on admin settings */
/* See cqure-cookie-consent.php -> add_custom_styles() method */

/* Overlay */
.cqure-cc-overlay {
    position: fixed;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    visibility: hidden;
    opacity: 0;
    z-index: 99998;
    background: rgba(0, 0, 0, .5);
    inset: 0;
    backdrop-filter: saturate(80%) blur(1px);
}

/* Hide when [hidden] attribute present */
[hidden].cqure-cc-overlay {
    display: none !important;
}

/* Show overlay when body has .cqure-cc-open */
body.cqure-cc-open .cqure-cc-overlay:not([hidden]) {
    visibility: visible;
    opacity: 1;
}

/* Offcanvas panel */
.cqure-cc-offcanvas {
    display: flex;
    position: fixed;
    top: 0;
    right: 0;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    visibility: hidden;
    z-index: 99999;
    width: min(680px, 100%);
    height: 100%;
    box-shadow: -20px 0 40px rgba(0, 0, 0, .25);
    background: var(--cqure-cc-panel-bg);
    color: var(--cqure-cc-panel-text);
    font-family: var(--cqure-cc-font-family);
}

[hidden].cqure-cc-offcanvas {
    display: none !important;
}

/* Show offcanvas when not hidden */
.cqure-cc-offcanvas:not([hidden]) {
    visibility: visible;
}

/* When body has .cqure-cc-open, slide in (Bootstrap 5 style) */
body.cqure-cc-open .cqure-cc-offcanvas:not([hidden]) {
    transform: translateX(0);
}

/* Header */
.cqure-cc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--cqure-cc-separator);
    padding: 16px 20px;
}

.cqure-cc-header h5 {
    margin: 0;
    color: var(--cqure-cc-panel-text);
}

.cqure-cc-close {
    border: 0;
    background: none;
    cursor: pointer;
    line-height: 1;
    color: var(--cqure-cc-panel-text);
    font-size: 28px;
}

/* Tabs */
.cqure-cc-tabs {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--cqure-cc-separator);
    padding: 12px 20px;
    gap: 8px;
}

.cqure-cc-tab {
    border: 0;
    border-bottom: 2px solid transparent;
    background: none;
    cursor: pointer;
    padding: 8px 10px;
    color: var(--cqure-cc-panel-text);
}

.cqure-cc-tab.is-active {
    border-color: var(--cqure-cc-tab-active);
}

/* lime-ish like screenshot */
.cqure-cc-privacy {
    margin-left: auto;
    text-decoration: none;
    color: var(--cqure-cc-link-color);
    font-size: 14px;
}

#cqure-cc-title {
    margin: 0;
    padding-bottom: 0;
    color: var(--cqure-cc-panel-text);
    font-size: 1.75rem;
}

/* Intro Text */
.cqure-cc-intro-text {
    border-bottom: 1px solid var(--cqure-cc-separator);
    background: var(--cqure-cc-intro-bg);
    padding: 16px 20px;
}

.cqure-cc-intro-text p {
    margin: 0;
    line-height: 1.7;
    color: var(--cqure-cc-panel-text);
    font-size: 14px;
}

.cqure-cc-intro-text a {
    transition: all 0.2s ease;
    border-bottom: 1px solid transparent;
    text-decoration: none;
    color: var(--cqure-cc-link-color);
    font-weight: 500;
}

.cqure-cc-intro-text a:hover {
    border-bottom-color: var(--cqure-cc-link-hover);
    color: var(--cqure-cc-link-hover);
}

/* Panels */
.cqure-cc-panels {
    height: 100%;
    padding: 16px 20px;
    overflow: auto;
}

.cqure-cc-panel[hidden] {
    display: none;
}

/* Items */
.cqure-cc-item {
    margin-bottom: 12px;
    border: 1px solid var(--cqure-cc-item-border);
    border-radius: 10px;
    background: var(--cqure-cc-item-bg);
    padding: 12px 14px;
}

.cqure-cc-item.is-locked {
    opacity: .9;
}

.cqure-cc-item.is-empty {
    opacity: .7;
}

.cqure-cc-item.is-empty .cqure-cc-item-head strong {
    opacity: .6;
}

.cqure-cc-description--empty {
    font-style: italic;
    opacity: .7;
}

/* Review notice — shown by JS when service scope has changed since last consent */
.cqure-cc-review-notice {
    margin-bottom: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(0, 115, 170, 0.08);
    border-left: 3px solid #0073aa;
}

.cqure-cc-review-notice p {
    margin: 0;
    font-size: .85em;
    color: var(--cqure-cc-panel-text);
    opacity: .9;
}

.cqure-cc-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.cqure-cc-item-head strong {
    color: var(--cqure-cc-panel-text);
}

/* Switch with On/Off text */
.cqure-cc-switch {
    display: inline-block;
    position: relative;
    width: 60px;
    height: 28px;
}

.cqure-cc-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cqure-cc-slider {
    display: flex;
    position: absolute;
    align-items: center;
    transition: all .3s ease;
    border-radius: 15px;
    background: var(--cqure-cc-toggle-off);
    cursor: pointer;
    overflow: hidden;
    inset: 0;
}

/* Text labels - displayed behind the circle */
.cqure-cc-slider:before {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    z-index: 1;
    color: var(--cqure-cc-toggle-text);
    font-size: 9px;
    font-weight: 600;
    content: "OFF";
}

/* White circle toggle */
.cqure-cc-slider:after {
    position: absolute;
    top: 3px;
    left: 3px;
    transition: all .3s ease;
    z-index: 2;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .2);
    background: var(--cqure-cc-toggle-circle);
    content: "";
}

/* Checked state - green background */
.cqure-cc-switch input:checked + .cqure-cc-slider {
    background: var(--cqure-cc-toggle-on);
}

/* Checked state - move circle to right */
.cqure-cc-switch input:checked + .cqure-cc-slider:after {
    transform: translateX(32px);
}

/* Checked state - show "ON" text on left */
.cqure-cc-switch input:checked + .cqure-cc-slider:before {
    right: auto;
    left: 8px;
    color: var(--cqure-cc-toggle-circle);
    content: "ON";
}

/* Services */
.cqure-cc-service {
    margin-bottom: 12px;
    border: 1px solid var(--cqure-cc-item-border);
    border-radius: 10px;
    background: var(--cqure-cc-item-bg);
    padding: 12px 14px;
}

.cqure-cc-service-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    gap: 8px;
}

.cqure-cc-service-head strong {
    flex: 1;
    min-width: 0;
    color: var(--cqure-cc-panel-text);
}

.cqure-cc-badge {
    border-radius: 999px;
    background: #eef7dd;
    padding: 0 1rem;
    color: #223;
    font-size: 12px;
}

.cqure-cc-meta {
    line-height: 1.5;
    color: var(--cqure-cc-meta-color);
    font-size: 12px;
    font-weight: normal;
}

.cqure-cc-description {
    padding-bottom: 0;
    color: var(--cqure-cc-description-color);
    font-size: 15px;
}

.cqure-cc-empty {
    color: #777;
}

/* Message Box */
.cqure-cc-message {
    transform: translateY(-100%);
    transition: all 0.3s ease;
    visibility: hidden;
    opacity: 0;
    border-top: 1px solid #eee;
    background: #f8f9fa;
    padding: 12px 20px;
    text-align: center;
}

.cqure-cc-message:not([hidden]) {
    visibility: visible;
}

.cqure-cc-message.is-visible {
    transform: translateY(0);
    opacity: 1;
}

.cqure-cc-message-text {
    color: #333;
    font-size: 14px;
    font-weight: 500;
}

.cqure-cc-message.success {
    border-color: #c3e6cb;
    background: #d4edda;
}

.cqure-cc-message.success .cqure-cc-message-text {
    color: #155724;
}

/* Footer buttons */
.cqure-cc-footer {
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid var(--cqure-cc-separator);
    padding: 12px 20px;
    gap: 8px;
}

.cqure-cc-btn {
    border: 0;
    border-radius: var(--cqure-cc-button-radius);
    cursor: pointer;
    padding: 10px 14px;
}

.cqure-cc-btn-muted {
    background: var(--cqure-cc-button-save-bg);
    color: var(--cqure-cc-button-save-text);
}

.cqure-cc-btn-deny {
    opacity: .9;
    background: var(--cqure-cc-button-deny-bg);
    color: var(--cqure-cc-button-deny-text);
}

.cqure-cc-btn-accept {
    background: var(--cqure-cc-button-accept-bg);
    color: var(--cqure-cc-button-accept-text);
    font-weight: 600;
}

.cqure-cc-btn-customize {
    background: var(--cqure-cc-button-customize-bg);
    color: var(--cqure-cc-button-customize-text);
}

.cqure-cc-btn-essential {
    background: var(--cqure-cc-button-essential-bg);
    color: var(--cqure-cc-button-essential-text);
    font-weight: 600;
}

/* Floating Cookie Icon */
.cqure-cc-float {
    box-sizing: border-box;
    display: flex;
    position: fixed;
    align-items: center;
    justify-content: center;
    transition: all .3s ease;
    z-index: var(--cqure-cc-float-zindex);
    min-width: 24px;
    min-height: 24px;
    border: 2px solid transparent;
    border-radius: var(--cqure-cc-float-border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
    background: var(--cqure-cc-float-bg);
    cursor: pointer;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--cqure-cc-float-text);
    font-family: var(--cqure-cc-font-family);
    gap: 8px;
}

/* Icon containers (emoji span or SVG) */
.cqure-cc-float > span,
.cqure-cc-float > svg {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    line-height: 0;
}

/* SVG icons inside floating button */
.cqure-cc-float svg {
    fill: currentColor;
}

/* Position variants */
.cqure-cc-float--bottom-left {
    bottom: 20px;
    left: 20px;
}

.cqure-cc-float--bottom-right {
    right: 20px;
    bottom: 20px;
}

.cqure-cc-float--top-left {
    top: 20px;
    left: 20px;
}

.cqure-cc-float--top-right {
    top: 20px;
    right: 20px;
}

/* Size variants */
.cqure-cc-float--small {
    width: 45px;
    height: 45px;
    font-size: 18px;
}

.cqure-cc-float--normal {
    width: 60px;
    height: 60px;
    font-size: 24px;
}

.cqure-cc-float--large {
    width: 75px;
    height: 75px;
    font-size: 30px;
}

.cqure-cc-float:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .3);
    background: #7aa622;
    color: #fff;
}

.cqure-cc-float:focus {
    outline: 2px solid #86bc25;
    outline-offset: 2px;
}

/* Text inside floating button */
.cqure-cc-float-text {
    display: inline-flex;
    align-items: center;
    line-height: 1;
    font-size: 12px;
    font-weight: 500;
}

/* Don't show float if offcanvas is open */
body.cqure-cc-open .cqure-cc-float {
    opacity: 0.3;
    pointer-events: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .cqure-cc-float--small {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .cqure-cc-float--normal {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .cqure-cc-float--large {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }

    .cqure-cc-float--bottom-left,
    .cqure-cc-float--top-left {
        left: 15px;
    }

    .cqure-cc-float--bottom-right,
    .cqure-cc-float--top-right {
        right: 15px;
    }

    .cqure-cc-float--bottom-left,
    .cqure-cc-float--bottom-right {
        bottom: 15px;
    }

    .cqure-cc-float--top-left,
    .cqure-cc-float--top-right {
        top: 15px;
    }

    .cqure-cc-offcanvas {
        width: 100%;
    }

    .cqure-cc-float-text {
        display: none; /* Hide text on mobile */
    }
}

/* ========== BOTTOM BANNER (First Visit) ========== */
.cqure-cc-bottom-banner {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    visibility: hidden;
    z-index: 99999;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    background: var(--cqure-cc-panel-bg);
    color: var(--cqure-cc-panel-text);
    font-family: var(--cqure-cc-font-family);
}

[hidden].cqure-cc-bottom-banner {
    display: none !important;
}

/* Show bottom banner when not hidden */
.cqure-cc-bottom-banner:not([hidden]) {
    visibility: visible;
}

/* When body has .cqure-cc-bottom-open, slide up */
body.cqure-cc-bottom-open .cqure-cc-bottom-banner:not([hidden]) {
    transform: translateY(0);
}

.cqure-cc-bottom-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 auto;
    max-width: var(--cqure-cc-bottom-max-width);
    padding: var(--cqure-cc-bottom-padding);
    gap: 24px;
}

.cqure-cc-bottom-text {
    flex: 1;
}

.cqure-cc-bottom-text p {
    margin: 0;
    line-height: 1.6;
    color: var(--cqure-cc-panel-text);
    font-size: 15px;
}

.cqure-cc-bottom-text a {
    transition: all 0.2s ease;
    border-bottom: 1px solid transparent;
    text-decoration: none;
    color: var(--cqure-cc-link-color);
    font-weight: 500;
}

.cqure-cc-bottom-text a:hover {
    border-bottom-color: var(--cqure-cc-link-hover);
    color: var(--cqure-cc-link-hover);
}

.cqure-cc-bottom-actions {
    display: flex;
    flex-shrink: 0;
    gap: 12px;
}

/* Responsive for bottom banner */
@media (max-width: 768px) {
    .cqure-cc-bottom-content {
        flex-direction: column;
        align-items: stretch;
        padding: 16px;
        gap: 16px;
    }

    .cqure-cc-bottom-actions {
        flex-direction: column;
    }

    .cqure-cc-bottom-actions .cqure-cc-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .cqure-cc-bottom-text p {
        font-size: 14px;
    }
}
