/* ==========================================================================
   CookieBanner/index.css
   Style for the UneeVo-inspired smart floating consent widget
   ========================================================================== */

/* State completely hidden if already answered and closed */
.cm-cookie-widget {
    position: fixed;
    bottom: 0px;
    left: 84px;
    /* Placed right of the 36px scroll-to-top button (24px + 36px + 24px gap) */
    /* Flush against bottom left for tab effect */
    z-index: 9999;
    font-family: var(--font-body, "Space Grotesk", sans-serif);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    /* Align contents to left */
    pointer-events: none;
    /* Let clicks pass through widget container */
}

/* --------------------------------------------------------------------------
   STATE 1: Minimized Pill ("Manage consent" tab)
   -------------------------------------------------------------------------- */
.cm-cookie-pill {
    pointer-events: auto;
    background: color-mix(in srgb, var(--color-surface, #0d0d0d) 80%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--color-border, #222222);
    border-bottom: none;
    /* Blend into bottom edge */
    padding: 10px 24px;
    border-radius: 12px 12px 0 0;
    /* Only round top corners */
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.1), 0 0 15px var(--color-primary-glow, rgba(0, 255, 157, 0.3));
    /* Soft shadow projecting upwards with a subtle theme-hinted glow */
    color: #ffffff !important;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.95;
    transform: translateY(75%);
}

.cm-cookie-pill:hover {
    padding-bottom: 12px;
    background: color-mix(in srgb, var(--color-surface, #0d0d0d) 95%, transparent);
    box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.2), 0 0 18px rgba(0, 255, 157, 0.7);
    /* Glow intensifies on hover */
    opacity: 1;
    /* Full opacity on hover */
    transform: translateY(0);
    /* Fully reveal on hover */
}

.cm-cookie-widget--expanded .cm-cookie-pill {
    opacity: 0;
    transform: translateY(100%);
    /* Slide down completely */
    pointer-events: none;
    position: absolute;
}

/* --------------------------------------------------------------------------
   STATE 2: Expanded Card
   -------------------------------------------------------------------------- */
.cm-cookie-card {
    pointer-events: auto;
    /* Force high opacity background with slight blur for modern transparency */
    background-color: color-mix(in srgb, var(--color-surface) 90%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--color-border, #222222);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    width: 480px;
    max-width: calc(100vw - 100px);
    padding: 24px;
    opacity: 0;
    transform: translateY(40px) scale(0.9);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: absolute;
    bottom: 24px;
    left: 0;
    pointer-events: none;
    z-index: 10;
}

/* Ensure it overrides transparent theme backgrounds */
.cm-style-bubble .cm-cookie-card,
.cm-style-mac .cm-cookie-card,
.cm-style-neon .cm-cookie-card,
.cm-style-cyber .cm-cookie-card {
    background-color: color-mix(in srgb, var(--color-surface) 85%, transparent) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
}

.cm-cookie-widget--expanded .cm-cookie-card {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.cm-cookie-card__header {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-bottom: 16px;
}

.cm-cookie-card__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text, #ffffff);
    margin: 0;
    text-transform: none !important;
}

.cm-cookie-card__close {
    position: absolute;
    right: -8px;
    top: -8px;
    background: transparent;
    border: none;
    color: var(--color-text, #111111);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    line-height: 1;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.cm-cookie-card__close:hover {
    opacity: 1;
}

.cm-cookie-card__body {
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--color-text-dim, #9494a3);
    margin-bottom: 24px;
}

.cm-cookie-card__body p {
    margin: 0;
}

/* --------------------------------------------------------------------------
   Buttons Row (Accept, Deny, Preferences)
   -------------------------------------------------------------------------- */
.cm-cookie-card__actions {
    display: flex;
    gap: 12px;
}

.cm-cookie-btn {
    flex: 1;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    text-align: center;
}

.cm-cookie-btn--primary {
    background: var(--color-primary, #00ff9d);
    color: var(--color-legend-active, #040405);
    border: 1px solid var(--color-primary, #00ff9d);
}

.cm-cookie-btn--primary:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
}

.cm-cookie-btn--ghost {
    background: transparent;
    color: #ffffff !important;
    border: 1px solid var(--color-border, #222222);
}

.cm-cookie-btn--ghost:hover {
    background: rgba(128, 128, 128, 0.05);
}

@media (max-width: 600px) {
    .cm-cookie-widget {
        bottom: 16px;
        right: 16px;
        left: 16px;
        /* Expand full width on mobile */
        align-items: flex-start;
        /* center block */
    }

    .cm-cookie-card {
        max-width: none;
        width: 100%;
    }

    .cm-cookie-card__actions {
        flex-direction: column;
    }
}

/* --------------------------------------------------------------------------
   Background Dimming Overlay — Focus user on consent decision
   -------------------------------------------------------------------------- */
.cm-cookie-widget::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    z-index: -1;
}

.cm-cookie-widget--expanded::before {
    background: rgba(0, 0, 0, 0.1);
}

/* Privacy Center Styles */

/**
 * PrivacyCenter Styles
 */
.cm-privacy-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: 'Space Grotesk', sans-serif;
}

.cm-privacy-modal__backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
}

.cm-privacy-modal__container {
    position: relative;
    width: 100%;
    max-width: 540px;
    background: color-mix(in srgb, var(--color-surface, #0f0f12) 65%, transparent) !important;
    backdrop-filter: blur(25px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(25px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.1);
    overflow: hidden;
    animation: cm-privacy-slide-up 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cm-privacy-slide-up {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cm-privacy-modal--closing .cm-privacy-modal__container {
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease;
}

.cm-privacy-modal__header {
    padding: 30px;
    border-bottom: 1px solid #1f1f25;
}

.cm-privacy-modal__header h2 {
    margin: 0;
    font-family: var(--font-primary, 'Space Grotesk', sans-serif);
    font-size: 1.25rem;
    letter-spacing: 0.1em;
    color: var(--color-primary, #00ff9d);
}

.cm-privacy-modal__header p {
    margin: 8px 0 0;
    color: var(--color-text-dim, #9494a3);
    font-size: 0.9rem;
}

.cm-privacy-modal__content {
    padding: 20px 30px;
    max-height: 60vh;
    overflow-y: auto;
}

.cm-preference-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    border-bottom: 1px solid #16161a;
}

.cm-preference-item:last-child {
    border-bottom: none;
}

.cm-preference-info {
    flex: 1;
    padding-right: 20px;
}

.cm-preference-info h3 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-text, #fff);
    letter-spacing: 0.05em;
}

.cm-preference-info p {
    margin: 5px 0 0;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--color-text-dim, #71717e);
}

/* Custom Toggle Switch */
.cm-toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
    background: var(--color-surface, #1f1f25);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.cm-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cm-toggle__handle {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: var(--color-text-dim, #4a4a5a);
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cm-toggle input:checked+.cm-toggle__handle {
    transform: translateX(24px);
    background: var(--color-primary, #00ff9d);
    box-shadow: 0 0 10px var(--color-primary-glow, rgba(0, 255, 157, 0.4));
}

.cm-toggle:has(input:checked) {
    background: var(--color-primary-glow, rgba(0, 255, 157, 0.15));
}

.cm-toggle--locked {
    background: var(--color-surface-lighter, rgba(0, 255, 157, 0.05));
    cursor: not-allowed;
}

.cm-toggle--locked .cm-toggle__handle {
    transform: translateX(24px);
    background: var(--color-surface, #3a3a4a);
}

.cm-privacy-section--data {
    background: var(--color-surface, rgba(255, 255, 255, 0.03));
    border: 1px solid var(--color-border, rgba(0, 255, 157, 0.1));
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.cm-privacy-data-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.cm-privacy-data-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cm-privacy-data-label {
    font-size: 0.7rem;
    color: var(--color-text-dim, #71717e);
    letter-spacing: 0.1em;
    font-weight: 700;
}

.cm-privacy-data-value {
    font-size: 1.25rem;
    color: var(--color-primary, #00ff9d);
    font-family: var(--font-heading, 'Orbitron', sans-serif);
    font-weight: 800;
    text-shadow: 0 0 10px var(--color-primary-glow, rgba(0, 255, 157, 0.2));
}

.cm-btn-mini--danger {
    background: rgba(255, 75, 75, 0.1);
    color: #ff4b4b;
    border: 1px solid rgba(255, 75, 75, 0.2);
    font-family: var(--font-family);
    font-size: 10px;
    letter-spacing: 1px;
    padding: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
}

.cm-btn-mini--danger:hover {
    background: rgba(255, 75, 75, 0.2);
    border-color: #ff4b4b;
}

.cm-privacy-modal__nav {
    display: flex;
    background: #0a0a0c;
    border-bottom: 1px solid #1f1f25;
}

.cm-privacy-nav-item {
    flex: 1;
    padding: 16px;
    background: none;
    border: none;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    color: #71717e;
    cursor: pointer;
    letter-spacing: 0.05em;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.cm-privacy-nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.02);
}

.cm-privacy-nav-item--active {
    color: var(--color-primary, #00ff9d);
    background: var(--color-primary-glow, rgba(0, 255, 157, 0.03));
    border-bottom-color: var(--color-primary, #00ff9d);
}

.cm-privacy-tab {
    display: none;
}

.cm-privacy-tab--active {
    display: block;
}

.cm-terms-scroll {
    color: var(--color-text-dim, #9494a3);
    line-height: 1.6;
}

.cm-terms-scroll h3 {
    color: var(--color-text, #fff);
    font-size: 0.95rem;
    margin: 24px 0 12px;
    font-family: var(--font-heading, 'Orbitron', sans-serif);
    letter-spacing: 0.05em;
}

.cm-terms-scroll p {
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.cm-privacy-modal__footer {
    padding: 20px 30px;
    background: #0a0a0c;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    border-top: 1px solid #1f1f25;
}

.cm-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    letter-spacing: 0.05em;
}

.cm-btn--primary {
    background: var(--color-primary, #00ff9d);
    color: var(--color-legend-active, #040405);
}

.cm-btn--primary:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--color-primary-glow, rgba(0, 255, 157, 0.3));
}

.cm-btn--secondary {
    background: var(--color-surface-lighter, #1f1f25);
    color: var(--color-text, #fff);
    border: 1px solid var(--color-border, #2a2a32);
}

.cm-btn--secondary:hover {
    background: var(--color-surface, #2a2a32);
    color: var(--color-primary, #00ff9d);
}

/* ==========================================================================
   LIGHT THEME OVERRIDES (Generic — triggered by .cm-theme-light class)
   ========================================================================== */
.cm-theme-light .cm-cookie-pill {
    color: var(--color-text) !important;
    background: color-mix(in srgb, var(--color-surface) 80%, transparent) !important;
}

.cm-theme-light .cm-cookie-card {
    background-color: color-mix(in srgb, var(--color-surface) 90%, transparent) !important;
}

.cm-theme-light .cm-cookie-card__title {
    color: var(--color-text) !important;
}

.cm-theme-light .cm-cookie-card__body {
    color: var(--color-text-dim) !important;
}

.cm-theme-light .cm-cookie-btn--ghost {
    color: var(--color-text) !important;
    border-color: var(--color-border) !important;
}

/* Privacy Modal */
.cm-theme-light .cm-privacy-modal__container {
    background: color-mix(in srgb, var(--color-surface) 95%, transparent) !important;
}

.cm-theme-light .cm-privacy-modal__header {
    border-bottom-color: var(--color-border) !important;
}

.cm-theme-light .cm-privacy-modal__header h2 {
    color: var(--color-primary) !important;
}

.cm-theme-light .cm-privacy-modal__header p {
    color: var(--color-text-dim) !important;
}

.cm-theme-light .cm-preference-item {
    border-bottom-color: var(--color-border) !important;
}

.cm-theme-light .cm-preference-info h3 {
    color: var(--color-text) !important;
}

.cm-theme-light .cm-preference-info p {
    color: var(--color-text-dim) !important;
}

.cm-theme-light .cm-privacy-section--links a {
    color: var(--color-primary) !important;
}

.cm-theme-light .cm-toggle {
    background: rgba(0, 0, 0, 0.1) !important;
}

.cm-theme-light .cm-toggle__handle {
    background: rgba(0, 0, 0, 0.4) !important;
}

.cm-theme-light .cm-privacy-modal__footer {
    background: color-mix(in srgb, var(--color-surface) 95%, transparent) !important;
    border-top-color: var(--color-border) !important;
}

.cm-theme-light .cm-btn--secondary {
    background: rgba(0, 0, 0, 0.05) !important;
    color: var(--color-text) !important;
    border-color: var(--color-border) !important;
}

.cm-theme-light .cm-btn--secondary:hover {
    background: rgba(0, 0, 0, 0.1) !important;
}

/* --------------------------------------------------------------------------
   Mobile Notification Banner
   -------------------------------------------------------------------------- */
.cm-mobile-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9998;
    padding: 0 12px;
    animation: cm-mobile-slide-down 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cm-mobile-banner__inner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(13, 13, 13, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 255, 157, 0.15);
    border-top: none;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.cm-mobile-banner__icon {
    font-size: 18px;
    flex-shrink: 0;
}

.cm-mobile-banner__text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
    flex: 1;
}

.cm-mobile-banner__text strong {
    color: var(--color-primary, #00ff9d);
}

.cm-mobile-banner__close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    flex-shrink: 0;
}

.cm-mobile-banner--hiding {
    animation: cm-mobile-slide-up 0.3s ease forwards;
}

@keyframes cm-mobile-slide-down {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes cm-mobile-slide-up {
    from {
        transform: translateY(0);
        opacity: 1;
    }

    to {
        transform: translateY(-100%);
        opacity: 0;
    }
}