/* Cookie Banner Styles */
.cookie-banner {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    right: 2rem;
    max-width: 650px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    z-index: 9999;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transform: translateY(150%);
    opacity: 0;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s ease;
    color: var(--text-primary);
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

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

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

.cookie-banner-header {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}

.cookie-banner-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: rgba(var(--primary-color-rgb, 59, 130, 246), 0.15);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cookie-banner-icon svg {
    width: 28px;
    height: 28px;
}

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

.cookie-banner-text h2 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.cookie-banner-text p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Settings Container (Animated Height) */
.cookie-settings-container {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cookie-settings-container.expanded {
    grid-template-rows: 1fr;
}

.cookie-categories {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cookie-category {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    transition: background 0.3s ease;
}

.cookie-category:hover {
    background: rgba(0, 0, 0, 0.3);
}

.cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
}

.cookie-category-header h4 {
    font-size: 1rem;
    margin-bottom: 0.35rem;
    font-weight: 500;
}

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

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
    margin-top: 0.25rem;
}

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

.toggle-label {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: .4s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 34px;
}

.toggle-label:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    transition: .4s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-label {
    background-color: var(--primary-color);
}

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

.toggle-switch input:disabled + .toggle-label {
    opacity: 0.4;
    cursor: not-allowed;
}

.toggle-switch input:disabled:checked + .toggle-label {
    background-color: rgba(var(--primary-color-rgb, 59, 130, 246), 0.5);
}

/* Actions */
.cookie-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    padding-top: 0.5rem;
}

.cookie-banner-actions .btn {
    flex: 1 1 auto;
    white-space: normal;
    text-align: center;
    padding: 0.75rem 1.5rem;
    min-height: 48px; /* Ensures text fits and button is tap-friendly */
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.3;
}

/* Ensure secondary buttons don't dominate */
#btnCookieAcceptEssential, #btnCookieSettings {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

#btnCookieAcceptEssential:hover, #btnCookieSettings:hover {
    background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
    .cookie-banner {
        bottom: 1rem;
        left: 1rem;
        right: 1rem;
        padding: 1.5rem;
        border-radius: calc(var(--radius-lg) - 4px);
        max-height: calc(100vh - 2rem);
    }
    
    .cookie-banner-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .cookie-banner-icon {
        width: 40px;
        height: 40px;
    }
    
    .cookie-banner-icon svg {
        width: 24px;
        height: 24px;
    }
    
    .cookie-banner-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .cookie-banner-actions .btn {
        width: 100%;
        flex: none;
    }
}
