/* cookie-consent.css - Modern, High-End Glassmorphic Cookie Consent Banner & Modal */
:root {
    --cc-brand-primary: #0077c5;
    --cc-brand-secondary: #2ca01c;
    --cc-bg-card: rgba(15, 23, 42, 0.94);
    --cc-bg-input: rgba(30, 41, 59, 0.7);
    --cc-border: rgba(255, 255, 255, 0.12);
    --cc-border-highlight: rgba(56, 189, 248, 0.35);
    --cc-text-primary: #f8fafc;
    --cc-text-muted: #94a3b8;
    --cc-font: 'Geist', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* =========================================
   FLOATING COOKIE BANNER
   ========================================= */
.cookie-banner-wrapper {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10050;
    max-width: 440px;
    width: calc(100% - 48px);
    opacity: 0;
    transform: translateY(40px) scale(0.96);
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: var(--cc-font);
}

.cookie-banner-wrapper.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.cookie-banner-card {
    background: var(--cc-bg-card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--cc-border);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.55), 0 0 35px rgba(0, 119, 197, 0.18);
    position: relative;
    overflow: hidden;
}

.cookie-banner-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--cc-brand-primary), var(--cc-brand-secondary));
}

.cookie-banner-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 0.85rem;
}

.cookie-icon-wrapper {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(0, 119, 197, 0.25), rgba(44, 160, 28, 0.25));
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #38bdf8;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 119, 197, 0.25);
}

.cookie-icon-wrapper svg {
    width: 22px;
    height: 22px;
}

.cookie-banner-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--cc-text-primary);
    margin: 0;
    line-height: 1.25;
}

.cookie-banner-text {
    color: var(--cc-text-muted);
    font-size: 0.875rem;
    line-height: 1.55;
    margin: 0 0 1.25rem 0;
}

.cookie-banner-text a {
    color: #38bdf8;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}

.cookie-banner-text a:hover {
    color: #7dd3fc;
}

.cookie-banner-actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.cookie-btn-group-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.cookie-btn {
    padding: 0.65rem 1rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: all 0.25s ease;
    text-decoration: none;
    font-family: inherit;
    line-height: 1.3;
}

.cookie-btn-primary {
    background: linear-gradient(135deg, var(--cc-brand-primary), var(--cc-brand-secondary));
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 119, 197, 0.35);
}

.cookie-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(44, 160, 28, 0.45);
    color: #ffffff;
}

.cookie-btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--cc-text-primary);
    border: 1px solid var(--cc-border);
}

.cookie-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    transform: translateY(-1px);
}

.cookie-btn-link {
    background: transparent;
    color: var(--cc-text-muted);
    padding: 0.4rem 0.5rem;
    font-size: 0.825rem;
    border: none;
    border-radius: 8px;
    transition: color 0.2s ease;
}

.cookie-btn-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.04);
}

/* =========================================
   PREFERENCES MODAL
   ========================================= */
.cookie-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(2, 6, 23, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10060;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    font-family: var(--cc-font);
}

.cookie-modal-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

.cookie-modal-dialog {
    background: var(--cc-bg-card);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--cc-border);
    border-radius: 24px;
    max-width: 620px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6), 0 0 40px rgba(0, 119, 197, 0.2);
    transform: scale(0.95) translateY(15px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.cookie-modal-backdrop.show .cookie-modal-dialog {
    transform: scale(1) translateY(0);
}

.cookie-modal-header {
    padding: 1.5rem 1.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--cc-border);
}

.cookie-modal-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--cc-text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.cookie-modal-close {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--cc-border);
    border-radius: 10px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cc-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.cookie-modal-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    transform: scale(1.05);
}

.cookie-modal-body {
    padding: 1.5rem 1.75rem;
    overflow-y: auto;
    max-height: calc(90vh - 170px);
}

.cookie-modal-body::-webkit-scrollbar {
    width: 6px;
}
.cookie-modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
}

.cookie-intro-text {
    color: var(--cc-text-muted);
    font-size: 0.9rem;
    line-height: 1.55;
    margin-bottom: 1.5rem;
}

.cookie-category-item {
    background: var(--cc-bg-input);
    border: 1px solid var(--cc-border);
    border-radius: 16px;
    padding: 1.25rem 1.4rem;
    margin-bottom: 1rem;
    transition: border-color 0.25s ease;
}

.cookie-category-item:hover {
    border-color: var(--cc-border-highlight);
}

.cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.cookie-category-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--cc-text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cookie-badge-necessary {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.25rem 0.65rem;
    border-radius: 50px;
    background: rgba(44, 160, 28, 0.15);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.3);
    text-transform: uppercase;
}

.cookie-category-desc {
    color: var(--cc-text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0;
}

/* Custom Toggle Switch */
.cookie-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.cookie-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 34px;
    transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cookie-slider::before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    border-radius: 50%;
    transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.cookie-switch input:checked + .cookie-slider {
    background: linear-gradient(135deg, var(--cc-brand-primary), var(--cc-brand-secondary));
    border-color: rgba(44, 160, 28, 0.5);
}

.cookie-switch input:checked + .cookie-slider::before {
    transform: translateX(20px);
}

.cookie-switch input:focus + .cookie-slider {
    box-shadow: 0 0 1px var(--cc-brand-primary);
}

.cookie-modal-footer {
    padding: 1.25rem 1.75rem;
    border-top: 1px solid var(--cc-border);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
    background: rgba(15, 23, 42, 0.6);
}

/* Re-open settings footer trigger */
.cookie-reopen-btn {
    cursor: pointer;
    color: var(--cc-text-muted);
    font-size: 0.9rem;
    background: none;
    border: none;
    padding: 0;
    text-decoration: none;
    transition: color 0.2s ease;
}

.cookie-reopen-btn:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* Mobile responsive */
@media (max-width: 576px) {
    .cookie-banner-wrapper {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
    }
    .cookie-banner-card {
        border-radius: 20px 20px 0 0;
        border-bottom: none;
        padding: 1.25rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
    }
    .cookie-btn-group-main {
        grid-template-columns: 1fr;
    }
    .cookie-modal-dialog {
        max-height: 94vh;
        border-radius: 20px;
    }
    .cookie-modal-footer {
        flex-direction: column;
    }
    .cookie-modal-footer .cookie-btn {
        width: 100%;
    }
}
