/* Cookie Consent Banner - Revised */
#cookie-banner {
    display: none;
    /* Hidden by default */
    position: fixed;
    bottom: 24px;
    right: 24px;
    left: auto;
    width: auto;
    max-width: 340px;
    z-index: 9999;
    background-color: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    padding: 16px 20px;
    font-family: 'Space Grotesk', sans-serif;
}

#cookie-banner.visible {
    display: block;
    animation: fadeUp 0.4s ease-out forwards;
}

.banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

#cookie-banner p {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
    white-space: nowrap;
}

.cookie-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

#cookie-settings-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: 14px;
    color: #666666;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.2s;
}

#cookie-settings-btn:hover {
    color: #1a1a1a;
}

#accept-cookies {
    background-color: #1a1a1a;
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#accept-cookies:hover {
    background-color: #000000;
}

/* Modal Styles */
#cookie-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: #fff;
    width: 90%;
    max-width: 480px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    font-family: 'Space Grotesk', sans-serif;
    overflow: hidden;
    animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #999;
}

.close-btn:hover {
    color: #1a1a1a;
}

.modal-body {
    padding: 24px;
}

.modal-intro {
    margin-top: 0;
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.6;
    color: #555;
    background: #f8f9fa;
    padding: 12px 16px;
    border-radius: 8px;
}

.preference-item {
    margin-bottom: 20px;
}

.preference-item:last-child {
    margin-bottom: 0;
}

.preference-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.preference-title {
    font-weight: 600;
    font-size: 15px;
    color: #1a1a1a;
}

.preference-desc {
    margin: 0 0 0 52px;
    /* Indent to align with text, bypassing toggle */
    font-size: 13px;
    color: #777;
    line-height: 1.4;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: flex-end;
    background: #fafafa;
}

#save-preferences {
    background-color: #1a1a1a;
    color: #ffffff;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

#save-preferences:hover {
    background-color: #000000;
}

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

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

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

input:checked+.slider {
    background-color: #1a1a1a;
}

input:checked+.slider:before {
    transform: translateX(16px);
}

.slider.disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Animations */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Mobile Tweaks */
@media screen and (max-width: 479px) {
    #cookie-banner {
        width: calc(100% - 32px);
        max-width: none;
        bottom: 16px;
        right: 16px;
        left: 16px;
    }

    .preference-desc {
        margin-left: 0;
        margin-top: 8px;
    }
}