/* ================================================
   TrustSpace Cookie Consent – Apple-Glass Design
   ================================================ */

/* ------ Shared variables ------ */
:root {
    --cc-primary: #D4A853;
    --cc-primary-hover: #0044cc;
    --cc-glass-bg: rgba(255, 255, 255, 0.85);
    --cc-glass-border: rgba(255, 255, 255, 0.45);
    --cc-glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    --cc-backdrop: blur(20px);
    --cc-radius: 16px;
    --cc-radius-sm: 10px;
    --cc-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --cc-transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --cc-overlay: rgba(0, 0, 0, 0.35);
}

/* ------ Banner ------ */
.cc-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    font-family: var(--cc-font);
    background: var(--cc-glass-bg);
    -webkit-backdrop-filter: var(--cc-backdrop);
    backdrop-filter: var(--cc-backdrop);
    border-top: 1px solid var(--cc-glass-border);
    box-shadow: 0 -4px 30px rgba(0, 85, 255, 0.06), var(--cc-glass-shadow);
    padding: 24px 28px;
    transform: translateY(100%);
    opacity: 0;
    transition: transform var(--cc-transition), opacity var(--cc-transition);
    will-change: transform, opacity;
}

.cc-banner[data-visible="true"] {
    transform: translateY(0);
    opacity: 1;
}

.cc-banner-inner {
    max-width: 1120px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.cc-banner-text {
    flex: 1 1 400px;
    min-width: 0;
}

.cc-banner-title {
    font-size: 16px;
    font-weight: 700;
    color: #1d1d1f;
    margin: 0 0 6px;
    line-height: 1.3;
}

.cc-banner-desc {
    font-size: 14px;
    color: #6e6e73;
    margin: 0;
    line-height: 1.55;
}

.cc-banner-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    flex-shrink: 0;
}

/* ------ Buttons ------ */
.cc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--cc-font);
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 980px; /* Apple pill shape */
    cursor: pointer;
    padding: 11px 22px;
    transition: background var(--cc-transition), transform 0.15s ease, box-shadow var(--cc-transition);
    white-space: nowrap;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
}

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

.cc-btn-primary {
    background: var(--cc-primary);
    color: #fff;
    box-shadow: 0 2px 12px rgba(0, 85, 255, 0.25);
}

.cc-btn-primary:hover {
    background: var(--cc-primary-hover);
    box-shadow: 0 4px 18px rgba(0, 85, 255, 0.35);
}

.cc-btn-secondary {
    background: rgba(0, 0, 0, 0.06);
    color: #1d1d1f;
}

.cc-btn-secondary:hover {
    background: rgba(0, 0, 0, 0.1);
}

.cc-btn-link {
    background: none;
    color: var(--cc-primary);
    padding: 11px 12px;
    font-weight: 500;
    text-decoration: none;
}

.cc-btn-link:hover {
    text-decoration: underline;
}

/* ------ Settings Overlay ------ */
.cc-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: var(--cc-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--cc-transition), visibility var(--cc-transition);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    padding: 20px;
}

.cc-overlay[data-visible="true"] {
    opacity: 1;
    visibility: visible;
}

.cc-settings {
    font-family: var(--cc-font);
    background: var(--cc-glass-bg);
    -webkit-backdrop-filter: var(--cc-backdrop);
    backdrop-filter: var(--cc-backdrop);
    border: 1px solid var(--cc-glass-border);
    border-radius: var(--cc-radius);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    transform: translateY(40px) scale(0.96);
    opacity: 0;
    transition: transform var(--cc-transition), opacity var(--cc-transition);
    will-change: transform, opacity;
}

.cc-overlay[data-visible="true"] .cc-settings {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Settings scrollbar */
.cc-settings::-webkit-scrollbar {
    width: 6px;
}
.cc-settings::-webkit-scrollbar-track {
    background: transparent;
}
.cc-settings::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 3px;
}

.cc-settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 24px 0;
}

.cc-settings-title {
    font-size: 18px;
    font-weight: 700;
    color: #1d1d1f;
    margin: 0;
}

.cc-settings-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6e6e73;
    transition: background 0.2s ease, color 0.2s ease;
    font-size: 18px;
    line-height: 1;
    padding: 0;
}

.cc-settings-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #1d1d1f;
}

.cc-settings-body {
    padding: 20px 24px 24px;
}

.cc-settings-intro {
    font-size: 14px;
    color: #6e6e73;
    line-height: 1.55;
    margin: 0 0 20px;
}

/* ------ Cookie Category ------ */
.cc-category {
    background: rgba(0, 0, 0, 0.025);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--cc-radius-sm);
    padding: 16px 18px;
    margin-bottom: 12px;
    transition: border-color 0.2s ease;
}

.cc-category:last-child {
    margin-bottom: 0;
}

.cc-category:hover {
    border-color: rgba(0, 0, 0, 0.1);
}

.cc-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.cc-category-info {
    flex: 1;
    min-width: 0;
}

.cc-category-name {
    font-size: 15px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0 0 2px;
}

.cc-category-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: #6e6e73;
    background: rgba(0, 0, 0, 0.06);
    padding: 2px 8px;
    border-radius: 980px;
    margin-left: 8px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.cc-category-desc {
    font-size: 13px;
    color: #86868b;
    margin: 4px 0 0;
    line-height: 1.45;
}

/* ------ Toggle Switch ------ */
.cc-toggle {
    position: relative;
    flex-shrink: 0;
}

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

.cc-toggle-track {
    display: block;
    width: 46px;
    height: 26px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 26px;
    cursor: pointer;
    transition: background var(--cc-transition);
    position: relative;
}

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

.cc-toggle input:checked + .cc-toggle-track {
    background: var(--cc-primary);
}

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

.cc-toggle input:disabled + .cc-toggle-track {
    opacity: 0.5;
    cursor: not-allowed;
}

.cc-toggle input:focus-visible + .cc-toggle-track {
    outline: 2px solid var(--cc-primary);
    outline-offset: 2px;
}

/* ------ Settings Footer ------ */
.cc-settings-footer {
    display: flex;
    gap: 10px;
    padding-top: 18px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    margin-top: 20px;
    flex-wrap: wrap;
}

.cc-settings-footer .cc-btn {
    flex: 1 1 0;
    min-width: 120px;
}

/* ------ Floating Action Button (FAB) ------ */
.cc-fab {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 99998;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--cc-glass-border);
    background: var(--cc-glass-bg);
    -webkit-backdrop-filter: var(--cc-backdrop);
    backdrop-filter: var(--cc-backdrop);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity var(--cc-transition);
    -webkit-tap-highlight-color: transparent;
    padding: 0;
    opacity: 0;
    transform: scale(0.6);
    pointer-events: none;
}

.cc-fab[data-visible="true"] {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.cc-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}

.cc-fab:active {
    transform: scale(0.95);
}

/* ------ Accessibility ------ */
@media (prefers-reduced-motion: reduce) {
    .cc-banner,
    .cc-overlay,
    .cc-settings,
    .cc-fab,
    .cc-toggle-track,
    .cc-toggle-track::after {
        transition-duration: 0.01ms !important;
    }
}

/* ------ Mobile ------ */
@media (max-width: 640px) {
    .cc-banner {
        padding: 18px 16px;
    }

    .cc-banner-inner {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }

    .cc-banner-text {
        flex-basis: auto;
    }

    .cc-banner-actions {
        flex-direction: column;
        gap: 8px;
    }

    .cc-banner-actions .cc-btn {
        width: 100%;
        justify-content: center;
    }

    .cc-settings {
        max-width: 100%;
        max-height: 90vh;
        border-radius: var(--cc-radius) var(--cc-radius) 0 0;
    }

    .cc-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .cc-overlay[data-visible="true"] .cc-settings {
        transform: translateY(0) scale(1);
    }

    .cc-settings-footer {
        flex-direction: column;
    }

    .cc-settings-footer .cc-btn {
        min-width: unset;
    }

    .cc-fab {
        bottom: 14px;
        left: 14px;
        width: 44px;
        height: 44px;
        font-size: 20px;
    }
}
