/* Cookie Consent Banner - Professional Floating Card Design */
#cookie-consent-banner {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(150%);
    background: #ffffff;
    /* Much stronger, darker shadow so it floats visibly above white pages */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25), 0 0 15px rgba(0, 0, 0, 0.08);
    z-index: 1050;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Stronger border for better definition */
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 16px;
    width: 90%;
    max-width: 700px;
}

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

.cookie-content {
    padding: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem;
}

.cookie-text {
    flex: 1 1 300px;
    font-size: 0.9rem;
    color: #4a5568;
    margin: 0;
    line-height: 1.5;
}

.cookie-text strong {
    color: #1a202c;
    display: flex;
    align-items: center;
    margin-bottom: 0.35rem;
    font-size: 1.05rem;
    font-weight: 700;
}

.cookie-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    width: 100%;
    justify-content: flex-end;
}

.cookie-actions .btn {
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    transition: all 0.2s;
}

/* Modal Styling Overrides for Grace */
#cookiePreferencesModal .modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

#cookiePreferencesModal .modal-header {
    border-bottom: 1px solid #f0f2f5;
    padding: 1.25rem 1.5rem;
}

#cookiePreferencesModal .modal-title {
    font-weight: 700;
    color: #2d3748;
}

#cookiePreferencesModal .modal-body {
    padding: 1.5rem;
}

/* Explicit text color for the intro text to prevent theme clashes */
.cookie-modal-intro {
    color: #4a5568 !important;
    font-size: 0.95rem;
    line-height: 1.5;
}

.cookie-preference-item {
    padding: 1.25rem 0;
    border-bottom: 1px solid #f0f2f5;
}

.cookie-preference-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

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

.cookie-preference-header h6 {
    margin: 0;
    font-weight: 700;
    color: #2d3748;
    font-size: 1rem;
}

.cookie-preference-description {
    font-size: 0.85rem;
    color: #718096;
    margin: 0;
    line-height: 1.5;
}

#cookiePreferencesModal .modal-footer {
    border-top: 1px solid #f0f2f5;
    padding: 1.25rem 1.5rem;
}

/* Modern Toggle Switch */
.cookie-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    margin: 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: #cbd5e0;
    transition: .3s;
    border-radius: 24px;
}

.cookie-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

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

input:focus + .cookie-slider {
    box-shadow: 0 0 0 3px rgba(236, 129, 75, 0.2);
}

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

input:disabled + .cookie-slider {
    background-color: #edf2f7;
    cursor: not-allowed;
}

input:disabled + .cookie-slider:before {
    background-color: #a0aec0;
    box-shadow: none;
}

@media (max-width: 768px) {
    #cookie-consent-banner {
        bottom: 16px;
        width: 92%; /* slightly less wide so shadow is visible */
    }
    .cookie-content {
        padding: 1.25rem; /* slightly less padding on mobile */
    }
    .cookie-actions {
        flex-direction: row;
        justify-content: space-between;
        gap: 0.5rem;
    }
    /* Make accept button prominent, customize and reject side-by-side */
    .cookie-actions #btn-cookie-accept-all {
        order: 1;
        flex: 1 1 100%; /* full width on top */
    }
    .cookie-actions .btn-outline-secondary {
        order: 2;
        flex: 1 1 48%; /* half width */
    }
    .cookie-actions #btn-cookie-reject-all {
        order: 3;
        flex: 1 1 48%; /* half width */
    }
}
