/* ==========================================
   COOKIE CONSENT & PREFERENCES STYLING
   ========================================== */
:root {
    --cookie-bg: rgba(15, 23, 42, 0.95);
    --cookie-border: rgba(56, 189, 248, 0.2);
    --cookie-text: #f8fafc;
    --cookie-text-muted: #94a3b8;
    --cookie-accent: #38bdf8;
    --cookie-accent-hover: #0ea5e9;
    --cookie-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

/* Cookie Banner Container */
.cookie-banner {
    position: fixed;
    bottom: 24px;
    left: 24px;
    right: 24px;
    max-width: 500px;
    background: var(--cookie-bg);
    border: 1px solid var(--cookie-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 4px;
    padding: 24px;
    box-shadow: var(--cookie-shadow);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: slideUpCookie 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .cookie-banner {
        left: auto;
        right: 24px;
    }
}

/* Content block */
.cookie-header {
    display: flex;
    align-items: center;
    gap: 12px;
}
.cookie-header i {
    color: var(--cookie-accent);
    width: 24px;
    height: 24px;
}
.cookie-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--cookie-text);
}
.cookie-text {
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--cookie-text-muted);
    margin: 0;
}
.cookie-text a {
    color: var(--cookie-accent);
    text-decoration: none;
    font-weight: 600;
}
.cookie-text a:hover {
    text-decoration: underline;
}

/* Buttons */
.cookie-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.cookie-btn {
    padding: 10px 18px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
    font-family: inherit;
    flex: 1;
    min-width: 100px;
    text-align: center;
}
.cookie-btn-accept {
    background: linear-gradient(135deg, var(--cookie-accent), #2563eb);
    color: #ffffff;
}
.cookie-btn-accept:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}
.cookie-btn-reject {
    background: rgba(255, 255, 255, 0.05);
    color: var(--cookie-text);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.cookie-btn-reject:hover {
    background: rgba(255, 255, 255, 0.1);
}
.cookie-btn-settings {
    background: transparent;
    color: var(--cookie-text-muted);
    border: 1px solid transparent;
}
.cookie-btn-settings:hover {
    color: var(--cookie-text);
    text-decoration: underline;
}

/* Modal Overlay */
.cookie-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4, 6, 10, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.cookie-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Preferences Modal Card */
.cookie-modal {
    background: var(--cookie-bg);
    border: 1px solid var(--cookie-border);
    max-width: 550px;
    width: 90%;
    border-radius: 4px;
    padding: 32px;
    box-shadow: var(--cookie-shadow);
    display: flex;
    flex-direction: column;
    gap: 24px;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-sizing: border-box;
}
.cookie-modal-overlay.active .cookie-modal {
    transform: scale(1);
}

.cookie-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.cookie-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: var(--cookie-text);
}
.cookie-modal-close {
    background: transparent;
    border: none;
    color: var(--cookie-text-muted);
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}
.cookie-modal-close:hover {
    color: var(--cookie-text);
    background: rgba(255, 255, 255, 0.1);
}

/* Category Switches */
.cookie-options-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 8px;
}
.cookie-option-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 16px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}
.cookie-option-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.cookie-option-title {
    font-weight: 700;
    font-size: 14px;
    color: var(--cookie-text);
}
.cookie-option-desc {
    font-size: 12px;
    line-height: 1.4;
    color: var(--cookie-text-muted);
}

/* Toggle Switch Styling */
.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;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: .3s;
    border-radius: 0;
}
.cookie-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: var(--cookie-text-muted);
    transition: .3s;
    border-radius: 0;
}
.cookie-switch input:checked + .cookie-slider {
    background-color: var(--cookie-accent);
    border-color: var(--cookie-accent);
}
.cookie-switch input:checked + .cookie-slider:before {
    transform: translateX(20px);
    background-color: #0f172a;
}
.cookie-switch input:disabled + .cookie-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

@keyframes slideUpCookie {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
