/* ========================================
   Cookie Consent Banner & Modal
   ======================================== */

/* Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #1e293b;
    border-top: 1px solid #334155;
    padding: 1rem 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    transform: translateY(100%);
    transition: transform 0.4s ease;
}

.cookie-banner.visible {
    transform: translateY(0);
}

.cookie-banner-text {
    flex: 1;
    min-width: 280px;
}

.cookie-banner-text h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #e5e7eb;
    margin-bottom: 0.25rem;
}

.cookie-banner-text p {
    font-size: 0.8rem;
    color: #94a3b8;
    line-height: 1.5;
    margin: 0;
}

.cookie-banner-text a {
    color: #307FE2;
    text-decoration: none;
    font-size: 0.8rem;
}

.cookie-banner-text a:hover {
    color: #5A9AEE;
}

.cookie-banner-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.cookie-btn {
    padding: 0.55rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.2s, transform 0.1s;
    white-space: nowrap;
}

.cookie-btn:active {
    transform: scale(0.97);
}

.cookie-btn-essential {
    background: #334155;
    color: #e5e7eb;
    border: 1px solid #475569;
}

.cookie-btn-essential:hover {
    background: #475569;
}

.cookie-btn-settings {
    background: #307FE2;
    color: #fff;
}

.cookie-btn-settings:hover {
    background: #2668B8;
}

.cookie-btn-accept-all {
    background: #22c55e;
    color: #fff;
}

.cookie-btn-accept-all:hover {
    background: #16a34a;
}

/* Modal Overlay */
.cookie-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.cookie-modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* Modal */
.cookie-modal {
    background: #fff;
    border-radius: 1rem;
    max-width: 560px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s;
}

.cookie-modal-overlay.visible .cookie-modal {
    transform: scale(1);
}

.cookie-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #f1f5f9;
    border: none;
    border-radius: 0.5rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #64748b;
    font-size: 1.1rem;
    transition: background 0.2s;
}

.cookie-modal-close:hover {
    background: #e2e8f0;
    color: #334155;
}

.cookie-modal h2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 1.5rem;
}

/* Cookie Category Card */
.cookie-category {
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    transition: border-color 0.2s;
}

.cookie-category.active {
    border-color: #307FE2;
    border-width: 2px;
    padding: calc(1rem - 1px) calc(1.25rem - 1px);
}

.cookie-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.cookie-category-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.cookie-category-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    flex: 1;
}

.cookie-category-desc {
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.5;
    margin-top: 0.5rem;
}

/* Toggle Switch */
.cookie-toggle {
    position: relative;
    width: 3rem;
    height: 1.625rem;
    flex-shrink: 0;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.cookie-toggle-slider {
    position: absolute;
    inset: 0;
    background: #cbd5e1;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.3s;
}

.cookie-toggle-slider::before {
    content: '';
    position: absolute;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background: #fff;
    top: 0.1875rem;
    left: 0.1875rem;
    transition: transform 0.3s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.cookie-toggle input:checked + .cookie-toggle-slider {
    background: #307FE2;
}

.cookie-toggle input:checked + .cookie-toggle-slider::before {
    transform: translateX(1.375rem);
}

.cookie-toggle input:disabled + .cookie-toggle-slider {
    cursor: not-allowed;
    background: #307FE2;
    opacity: 0.7;
}

.cookie-toggle input:disabled + .cookie-toggle-slider::before {
    transform: translateX(1.375rem);
}

/* Modal Actions */
.cookie-modal-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cookie-modal-btn {
    padding: 0.65rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.2s, transform 0.1s;
}

.cookie-modal-btn:active {
    transform: scale(0.97);
}

.cookie-modal-btn-save {
    background: #307FE2;
    color: #fff;
}

.cookie-modal-btn-save:hover {
    background: #2668B8;
}

.cookie-modal-btn-accept {
    background: #22c55e;
    color: #fff;
}

.cookie-modal-btn-accept:hover {
    background: #16a34a;
}

/* Scrollbar in modal */
.cookie-modal::-webkit-scrollbar {
    width: 6px;
}

.cookie-modal::-webkit-scrollbar-track {
    background: transparent;
}

.cookie-modal::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

/* Responsive */
@media (max-width: 640px) {
    .cookie-banner {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
    }

    .cookie-banner-actions {
        width: 100%;
        justify-content: center;
    }

    .cookie-btn {
        flex: 1;
        min-width: 0;
    }

    .cookie-modal {
        padding: 1.5rem;
    }

    .cookie-modal h2 {
        font-size: 1.3rem;
    }
}
