/* --- Cookie Consent Banner & Modal --- */
.cookie-banner {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(150%);
    width: calc(100% - 4rem);
    max-width: 800px;
    background: rgba(17, 24, 39, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem 2rem;
    z-index: 9999;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
}

.cookie-banner.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.cookie-banner-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cookie-banner-text {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.cookie-banner-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
}

.cookie-btn-manage {
    background: transparent;
    color: var(--text-color);
    border: none;
    cursor: pointer;
    text-decoration: underline;
    font-size: 0.9rem;
    margin-right: auto;
}

.cookie-btn {
    padding: 0.6rem 1.2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.cookie-btn-reject {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    border-color: rgba(255, 255, 255, 0.2);
}

.cookie-btn-reject:hover {
    background: rgba(255, 255, 255, 0.15);
}

.cookie-btn-accept {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.cookie-btn-accept:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
}

/* Modal Overlay */
.cookie-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.cookie-modal-overlay.show {
    opacity: 1;
    pointer-events: all;
}

.cookie-modal {
    background: rgba(17, 24, 39, 0.95);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.cookie-modal-overlay.show .cookie-modal {
    transform: scale(1);
}

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

.cookie-modal-title {
    font-size: 1.5rem;
    color: var(--text-color);
}

.cookie-modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.cookie-modal-close:hover {
    color: var(--text-color);
}

.cookie-modal-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.cookie-category {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

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

.cookie-category-title {
    color: var(--text-color);
    font-weight: 600;
}

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

/* Toggle Switch */
.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.cookie-toggle 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.2);
    transition: .4s;
    border-radius: 24px;
}

.cookie-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .cookie-slider {
    background-color: var(--primary-color);
}

input:disabled + .cookie-slider {
    cursor: not-allowed;
    background-color: var(--primary-color);
    opacity: 0.5;
}

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

.cookie-modal-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

@media (max-width: 768px) {
    .cookie-banner {
        width: 100%;
        bottom: 0;
        border-radius: 1rem 1rem 0 0;
        padding: 1rem;
    }
    .cookie-banner-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .cookie-btn-manage {
        margin-right: 0;
        margin-bottom: 0.5rem;
        text-align: center;
    }
}
