/* ═══════════════════════════════════════════════════
   COOKIE CONSENT — GDPR Compliant Banner & Settings
   Matches Sync2Sys V2 dark theme
   ═══════════════════════════════════════════════════ */

/* ─── Banner Overlay ─── */
.cc-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    padding: 1.5rem;
    background: rgba(10, 10, 10, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

.cc-banner__text {
    flex: 1 1 400px;
    min-width: 280px;
}

.cc-banner__title {
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 0.375rem;
}

.cc-banner__desc {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
}

.cc-banner__desc a {
    color: #22c55e;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cc-banner__desc a:hover {
    color: #4ade80;
}

.cc-banner__actions {
    display: flex;
    gap: 0.625rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* ─── Buttons ─── */
.cc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    line-height: 1.4;
}

.cc-btn:focus-visible {
    outline: 2px solid #22c55e;
    outline-offset: 2px;
}

.cc-btn--accept {
    background: #22c55e;
    color: #0a0a0a;
}

.cc-btn--accept:hover {
    background: #16a34a;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.25);
    transform: translateY(-1px);
}

.cc-btn--reject {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.cc-btn--reject:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
}

.cc-btn--settings {
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.cc-btn--settings:hover {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.04);
}

/* ─── Settings Panel Overlay ─── */
.cc-overlay {
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

/* ─── Settings Panel ─── */
.cc-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 10002;
    width: 100%;
    max-width: 520px;
    background: #111111;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: -16px 0 48px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.cc-panel.is-visible {
    transform: translateX(0);
}

.cc-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.cc-panel__title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #ffffff;
}

.cc-panel__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.25rem;
    transition: all 0.2s ease;
    font-family: inherit;
}

.cc-panel__close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.cc-panel__close:focus-visible {
    outline: 2px solid #22c55e;
    outline-offset: 2px;
}

.cc-panel__body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.cc-panel__body::-webkit-scrollbar {
    width: 6px;
}

.cc-panel__body::-webkit-scrollbar-track {
    background: transparent;
}

.cc-panel__body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.cc-panel__intro {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* ─── Category Cards ─── */
.cc-category {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

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

.cc-category__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    cursor: pointer;
    gap: 1rem;
    user-select: none;
}

.cc-category__info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.cc-category__chevron {
    width: 18px;
    height: 18px;
    color: rgba(255, 255, 255, 0.3);
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

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

.cc-category__name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #ffffff;
}

.cc-category__badge {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    flex-shrink: 0;
}

.cc-category__badge--required {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

/* ─── Toggle Switch ─── */
.cc-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

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

.cc-toggle__slider {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.25s ease;
}

.cc-toggle__slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    transition: transform 0.25s ease, background 0.25s ease;
}

.cc-toggle input:checked+.cc-toggle__slider {
    background: #22c55e;
}

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

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

.cc-toggle input:focus-visible+.cc-toggle__slider {
    box-shadow: 0 0 0 2px #111111, 0 0 0 4px #22c55e;
}

/* ─── Category Details ─── */
.cc-category__details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}

.cc-category.is-expanded .cc-category__details {
    max-height: 400px;
}

.cc-category__desc {
    padding: 0 1.25rem 1rem;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.45);
    line-height: 1.6;
}

/* ─── Cookie Table ─── */
.cc-table {
    width: 100%;
    margin: 0.5rem 0 0.75rem;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.cc-table th {
    text-align: left;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.6875rem;
}

.cc-table td {
    padding: 0.5rem 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: top;
}

.cc-table tr:last-child td {
    border-bottom: none;
}

/* ─── Panel Footer ─── */
.cc-panel__footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    gap: 0.625rem;
    flex-shrink: 0;
}

.cc-panel__footer .cc-btn {
    flex: 1;
}

/* ─── Footer Link ─── */
.cc-footer-link {
    cursor: pointer;
    transition: color 0.2s ease;
}

.cc-footer-link:hover {
    color: #ffffff !important;
}

/* ─── Responsive ─── */
@media (max-width: 640px) {
    .cc-banner {
        padding: 1.25rem 1rem;
    }

    .cc-banner__inner {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

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

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

    .cc-panel {
        max-width: 100%;
    }

    .cc-panel__body {
        padding: 1rem;
    }

    .cc-category__header {
        padding: 0.875rem 1rem;
    }

    .cc-category__desc {
        padding: 0 1rem 0.875rem;
    }

    .cc-panel__footer {
        flex-direction: column;
    }
}

/* ─── Reduced Motion ─── */
@media (prefers-reduced-motion: reduce) {

    .cc-banner,
    .cc-panel,
    .cc-overlay,
    .cc-toggle__slider,
    .cc-toggle__slider::after,
    .cc-category__details,
    .cc-category__chevron {
        transition-duration: 0.01ms !important;
    }
}

/* ─── Print ─── */
@media print {

    .cc-banner,
    .cc-panel,
    .cc-overlay {
        display: none !important;
    }
}