/* ===========================================================
   Cookie Consent Banner & Preferences Modal
   Modern enterprise-grade design matching Code Xenix palette
   =========================================================== */

/* ----------------------------------------------------------
   Cookie Banner
   ---------------------------------------------------------- */
.cc-banner {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    width: 420px;
    max-width: calc(100vw - 48px);
    background: rgba(13, 17, 20, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(148, 207, 20, 0.12);
    border-radius: 20px;
    padding: 1.75rem;
    box-shadow:
        0 20px 60px rgba(var(--shadow-color-rgb), 0.5),
        0 0 40px rgba(148, 207, 20, 0.03);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    pointer-events: none;
    font-family: 'Montserrat', sans-serif;
}

.cc-banner.cc-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.cc-banner.cc-hide {
    opacity: 0;
    transform: translateY(30px);
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

/* Shield Icon */
.cc-banner__icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(148, 207, 20, 0.1);
    border: 1px solid rgba(148, 207, 20, 0.2);
    border-radius: 12px;
    margin-bottom: 1rem;
    color: var(--brand-primary);
    font-size: 1.25rem;
}

/* Heading */
.cc-banner__title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.6rem;
    line-height: 1.3;
}

/* Description */
.cc-banner__desc {
    font-size: 0.875rem;
    color: var(--text-faded);
    line-height: 1.65;
    margin: 0 0 1.25rem;
}

.cc-banner__desc a {
    color: var(--brand-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s;
}

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

/* Button Row */
.cc-banner__actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

/* Primary Button - Accept All */
.cc-btn--primary {
    width: 100%;
    padding: 0.7rem 1.25rem;
    background: linear-gradient(135deg, var(--brand-primary), #7ab512);
    color: var(--bg-body);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
    letter-spacing: 0.01em;
}

.cc-btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(148, 207, 20, 0.3);
}

.cc-btn--primary:active {
    transform: translateY(0);
}

/* Secondary Button - Reject */
.cc-btn--secondary {
    width: 100%;
    padding: 0.7rem 1.25rem;
    background: transparent;
    color: var(--text-faded);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid rgba(139, 148, 158, 0.25);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}

.cc-btn--secondary:hover {
    border-color: rgba(148, 207, 20, 0.4);
    color: var(--text-secondary);
    background: rgba(148, 207, 20, 0.05);
    transform: translateY(-1px);
}

/* Third Button - Preferences */
.cc-btn--tertiary {
    width: 100%;
    padding: 0.65rem 1.25rem;
    background: transparent;
    color: var(--brand-primary);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cc-btn--tertiary:hover {
    color: #b8e64e;
    background: rgba(148, 207, 20, 0.05);
}

/* ----------------------------------------------------------
   Cookie Preferences Modal
   ---------------------------------------------------------- */
.cc-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.cc-modal {
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 48px);
    background: rgba(22, 27, 34, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(148, 207, 20, 0.12);
    border-radius: 20px;
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.6),
        0 0 60px rgba(148, 207, 20, 0.03);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform 0.3s ease;
    font-family: 'Montserrat', sans-serif;
}

.cc-modal-overlay.cc-open .cc-modal {
    transform: scale(1);
}

/* Modal Header */
.cc-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.75rem 1rem;
    border-bottom: 1px solid rgba(148, 207, 20, 0.08);
}

.cc-modal__header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cc-modal__icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(148, 207, 20, 0.1);
    border: 1px solid rgba(148, 207, 20, 0.2);
    border-radius: 10px;
    color: var(--brand-primary);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.cc-modal__title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.cc-modal__close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(139, 148, 158, 0.08);
    border: 1px solid rgba(139, 148, 158, 0.12);
    border-radius: 10px;
    color: var(--text-faded);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.cc-modal__close:hover {
    background: rgba(255, 107, 107, 0.1);
    border-color: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
}

/* Modal Body */
.cc-modal__body {
    padding: 1.25rem 1.75rem;
    overflow-y: auto;
    flex: 1;
}

.cc-modal__desc {
    font-size: 0.875rem;
    color: var(--text-faded);
    line-height: 1.6;
    margin: 0 0 1.25rem;
}

/* Cookie Category Card */
.cc-category {
    background: rgba(13, 17, 20, 0.5);
    border: 1px solid rgba(148, 207, 20, 0.06);
    border-radius: 14px;
    padding: 1.15rem;
    margin-bottom: 0.75rem;
    transition: border-color 0.2s;
}

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

.cc-category:hover {
    border-color: rgba(148, 207, 20, 0.12);
}

.cc-category__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

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

.cc-category__name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 0 0.15rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cc-category__badge {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--brand-primary);
    background: rgba(148, 207, 20, 0.1);
    border: 1px solid rgba(148, 207, 20, 0.15);
    border-radius: 6px;
    padding: 0.15rem 0.45rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.cc-category__desc {
    font-size: 0.8rem;
    color: #6e7681;
    line-height: 1.5;
    margin: 0;
}

/* 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__track {
    position: absolute;
    inset: 0;
    background: rgba(139, 148, 158, 0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.3s;
}

.cc-toggle__track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: var(--text-faded);
    border-radius: 50%;
    transition: transform 0.3s, background 0.3s;
}

.cc-toggle input:checked + .cc-toggle__track {
    background: rgba(148, 207, 20, 0.3);
}

.cc-toggle input:checked + .cc-toggle__track::after {
    transform: translateX(20px);
    background: var(--brand-primary);
}

.cc-toggle input:disabled + .cc-toggle__track {
    background: rgba(148, 207, 20, 0.15);
    cursor: not-allowed;
}

.cc-toggle input:disabled + .cc-toggle__track::after {
    background: var(--brand-primary);
    transform: translateX(20px);
}

/* Modal Footer */
.cc-modal__footer {
    display: flex;
    gap: 0.6rem;
    padding: 1.25rem 1.75rem 1.5rem;
    border-top: 1px solid rgba(148, 207, 20, 0.08);
}

.cc-modal__footer .cc-btn--secondary,
.cc-modal__footer .cc-btn--primary {
    flex: 1;
}

.cc-modal__footer .cc-btn--tertiary {
    width: auto;
    flex-shrink: 0;
}

/* ----------------------------------------------------------
   Responsive - Tablet
   ---------------------------------------------------------- */
@media (max-width: 991px) {
    .cc-banner {
        right: 50%;
        transform: translateX(50%) translateY(30px);
        bottom: 24px;
    }

    .cc-banner.cc-visible {
        transform: translateX(50%) translateY(0);
    }

    .cc-banner.cc-hide {
        transform: translateX(50%) translateY(30px);
    }
}

/* ----------------------------------------------------------
   Responsive - Mobile
   ---------------------------------------------------------- */
@media (max-width: 576px) {
    .cc-banner {
        bottom: 16px;
        right: 16px;
        left: 16px;
        width: auto;
        max-width: none;
        border-radius: 16px;
        padding: 1.25rem;
    }

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

    .cc-banner.cc-hide {
        transform: translateY(30px);
    }

    .cc-banner__title {
        font-size: 1.05rem;
    }

    .cc-modal-overlay {
        padding: 16px;
        align-items: flex-end;
    }

    .cc-modal {
        border-radius: 20px 20px 0 0;
        max-height: 90vh;
    }

    .cc-modal__header {
        padding: 1.25rem 1.25rem 1rem;
    }

    .cc-modal__body {
        padding: 1rem 1.25rem;
    }

    .cc-modal__footer {
        padding: 1rem 1.25rem 1.25rem;
        flex-direction: column;
    }

    .cc-modal__footer .cc-btn--secondary,
    .cc-modal__footer .cc-btn--primary {
        width: 100%;
    }
}

/* ----------------------------------------------------------
   Reduced Motion
   ---------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .cc-banner,
    .cc-banner.cc-visible,
    .cc-banner.cc-hide,
    .cc-modal-overlay,
    .cc-modal,
    .cc-toggle__track,
    .cc-toggle__track::after,
    .cc-btn--primary,
    .cc-btn--secondary,
    .cc-category {
        transition: none !important;
        transform: none !important;
    }
}
