/* ========================================
   Cookie Consent Banner
   ======================================== */

.cookie-consent-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cookie-consent-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--color-slate-900, #0f172a);
    border-top: 1px solid var(--color-white-5, rgba(255, 255, 255, 0.05));
    padding: 1.5rem;
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
}

.cookie-consent-banner.active {
    transform: translateY(0);
}

.cookie-consent-container {
    max-width: 1200px;
    margin: 0 auto;
}

.cookie-consent-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 768px) {
    .cookie-consent-content {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.cookie-consent-text {
    flex: 1;
}

.cookie-consent-title {
    font-size: 1rem;
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cookie-consent-title svg {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--color-emerald, #1fa84f);
}

.cookie-consent-description {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--color-slate-400, #94a3b8);
}

.cookie-consent-description a {
    color: var(--color-emerald, #1fa84f);
    text-decoration: none;
    font-weight: 500;
}

.cookie-consent-description a:hover {
    text-decoration: underline;
}

.cookie-consent-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 280px;
}

@media (min-width: 640px) {
    .cookie-consent-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

.cookie-consent-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    white-space: nowrap;
    text-align: center;
}

.cookie-consent-btn:focus {
    outline: 2px solid var(--color-emerald, #1fa84f);
    outline-offset: 2px;
}

.cookie-consent-btn-accept {
    background-color: var(--color-emerald, #1fa84f);
    color: #0f172a;
}

.cookie-consent-btn-accept:hover {
    background-color: var(--color-emerald-light, #22c55e);
}

.cookie-consent-btn-customize {
    background-color: transparent;
    color: #f8fafc;
    border: 1px solid var(--color-white-10, rgba(255, 255, 255, 0.1));
}

.cookie-consent-btn-customize:hover {
    background-color: var(--color-white-5, rgba(255, 255, 255, 0.05));
    border-color: var(--color-white-10, rgba(255, 255, 255, 0.1));
}

.cookie-consent-btn-decline {
    background-color: transparent;
    color: var(--color-slate-400, #94a3b8);
    border: 1px solid transparent;
}

.cookie-consent-btn-decline:hover {
    color: #f8fafc;
    background-color: var(--color-white-5, rgba(255, 255, 255, 0.05));
}

/* Cookie Preferences Modal */
.cookie-preferences-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 1rem;
}

.cookie-preferences-modal.active {
    opacity: 1;
    visibility: visible;
}

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

.cookie-preferences-content {
    position: relative;
    background-color: var(--color-slate-900, #0f172a);
    border: 1px solid var(--color-white-5, rgba(255, 255, 255, 0.05));
    border-radius: 1rem;
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

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

.cookie-preferences-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #f8fafc;
}

.cookie-preferences-close {
    background: none;
    border: none;
    color: var(--color-slate-400, #94a3b8);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.cookie-preferences-close:hover {
    background-color: var(--color-white-5, rgba(255, 255, 255, 0.05));
    color: #f8fafc;
}

.cookie-preferences-close svg {
    width: 1.5rem;
    height: 1.5rem;
}

.cookie-category {
    padding: 1rem 0;
    border-bottom: 1px solid var(--color-white-5, rgba(255, 255, 255, 0.05));
}

.cookie-category:last-of-type {
    border-bottom: none;
}

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

.cookie-category-name {
    font-size: 1rem;
    font-weight: 600;
    color: #f8fafc;
}

.cookie-category-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    background-color: rgba(31, 168, 79, 0.1);
    color: var(--color-emerald, #1fa84f);
    border: 1px solid rgba(31, 168, 79, 0.2);
}

.cookie-category-description {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--color-slate-400, #94a3b8);
}

/* Toggle Switch */
.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

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

.cookie-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--color-white-10, rgba(255, 255, 255, 0.1));
    transition: 0.3s;
    border-radius: 26px;
}

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

.cookie-toggle input:checked + .cookie-toggle-slider {
    background-color: var(--color-emerald, #1fa84f);
}

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

.cookie-toggle input:disabled + .cookie-toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.cookie-preferences-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-white-5, rgba(255, 255, 255, 0.05));
}

.cookie-preferences-actions .cookie-consent-btn {
    flex: 1;
}

/* Footer Cookie Settings Link */
.cookie-settings-link {
    background: none;
    border: none;
    color: var(--color-slate-400, #94a3b8);
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    font-family: inherit;
}

.cookie-settings-link:hover {
    color: var(--color-emerald, #1fa84f);
}

/* Light theme support */
[data-theme="light"] .cookie-consent-banner,
[data-theme="light"] .cookie-preferences-content {
    background-color: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .cookie-consent-title,
[data-theme="light"] .cookie-preferences-title,
[data-theme="light"] .cookie-category-name {
    color: #0f172a;
}

[data-theme="light"] .cookie-consent-description,
[data-theme="light"] .cookie-category-description {
    color: #475569;
}

[data-theme="light"] .cookie-consent-btn-customize {
    color: #0f172a;
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .cookie-consent-btn-customize:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .cookie-consent-btn-decline:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .cookie-category,
[data-theme="light"] .cookie-preferences-actions {
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .cookie-toggle-slider {
    background-color: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .cookie-preferences-close:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Animations */
@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.cookie-consent-banner.animate-in {
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
