/**
 * Cookie Consent Banner Styles
 * GDPR/CCPA compliant cookie consent banner
 */

/* Banner Container */
.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-bg, #ffffff);
    border-top: 1px solid var(--color-border, #e5e7eb);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.4s ease-in-out;
    font-family: var(--font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
}

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

/* Main content area */
.cc-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.25rem 1.5rem;
}

/* Header */
.cc-banner-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.cc-banner-header svg {
    flex-shrink: 0;
    color: var(--color-primary, #3b82f6);
    margin-top: 2px;
}

.cc-banner-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text, #111827);
    margin: 0;
}

/* Description text */
.cc-banner-text {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--color-text-muted, #6b7280);
    margin: 0 0 1rem 0;
}

.cc-banner-text a {
    color: var(--color-primary, #3b82f6);
    text-decoration: underline;
}

.cc-banner-text a:hover {
    text-decoration: none;
}

/* Buttons container */
.cc-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

/* Button styles */
.cc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
    white-space: nowrap;
}

.cc-btn--primary {
    background: var(--color-primary, #3b82f6);
    color: #ffffff;
}

.cc-btn--primary:hover {
    background: var(--color-primary-dark, #2563eb);
    transform: translateY(-1px);
}

.cc-btn--secondary {
    background: var(--color-bg-alt, #f3f4f6);
    color: var(--color-text, #111827);
    border: 1px solid var(--color-border, #e5e7eb);
}

.cc-btn--secondary:hover {
    background: var(--color-border, #e5e7eb);
}

.cc-btn--link {
    background: transparent;
    color: var(--color-primary, #3b82f6);
    padding: 0.625rem 0.75rem;
}

.cc-btn--link:hover {
    text-decoration: underline;
}

/* Settings Panel */
.cc-settings {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out, padding 0.4s ease-in-out;
    border-top: 0 solid var(--color-border, #e5e7eb);
}

.cc-settings.cc-settings-visible {
    max-height: 500px;
    border-top-width: 1px;
    padding-top: 1rem;
    margin-top: 1rem;
}

.cc-settings-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text, #111827);
    margin: 0 0 1rem 0;
}

/* Category list */
.cc-categories {
    display: grid;
    gap: 0.75rem;
}

.cc-category {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: var(--color-bg-alt, #f9fafb);
    border-radius: 0.5rem;
    border: 1px solid var(--color-border, #e5e7eb);
}

.cc-category-info {
    flex: 1;
    min-width: 0;
}

.cc-category-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.cc-category-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text, #111827);
}

.cc-category-badge {
    font-size: 0.6875rem;
    padding: 0.125rem 0.5rem;
    background: var(--color-primary, #3b82f6);
    color: #ffffff;
    border-radius: 9999px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.025em;
}

.cc-category-desc {
    font-size: 0.8125rem;
    color: var(--color-text-muted, #6b7280);
    line-height: 1.5;
    margin: 0;
}

/* Toggle Switch */
.cc-toggle {
    flex-shrink: 0;
}

.cc-toggle input {
    display: none;
}

.cc-toggle-switch {
    display: block;
    width: 48px;
    height: 26px;
    background: var(--color-text-muted, #9ca3af);
    border-radius: 9999px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s ease;
}

.cc-toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.cc-toggle input:checked + .cc-toggle-switch {
    background: var(--color-success, #22c55e);
}

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

.cc-toggle input:disabled + .cc-toggle-switch {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Settings actions */
.cc-settings-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border, #e5e7eb);
}

/* Toast notification */
.cc-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--color-text, #111827);
    color: #ffffff;
    padding: 0.875rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.cc-toast.cc-toast-visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Body class when banner visible */
body.cc-banner-visible {
    padding-bottom: 0; /* Removed padding as banner is fixed */
}

/* Responsive styles */
@media (max-width: 768px) {
    .cc-banner-content {
        padding: 1rem;
    }

    .cc-banner-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .cc-banner-header svg {
        display: none;
    }

    .cc-banner-text {
        font-size: 0.875rem;
    }

    .cc-banner-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .cc-btn {
        width: 100%;
        text-align: center;
    }

    .cc-btn--link {
        order: 10;
    }

    .cc-category {
        flex-direction: column;
        gap: 0.75rem;
    }

    .cc-toggle {
        align-self: flex-start;
    }

    .cc-settings-actions {
        flex-direction: column;
    }

    .cc-toast {
        left: 1rem;
        right: 1rem;
        transform: translateX(0) translateY(100px);
    }

    .cc-toast.cc-toast-visible {
        transform: translateX(0) translateY(0);
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .cookie-consent-banner {
        --color-bg: #1f2937;
        --color-bg-alt: #374151;
        --color-text: #f9fafb;
        --color-text-muted: #9ca3af;
        --color-border: #4b5563;
    }
}

/* Explicit dark mode class */
[data-theme="dark"] .cookie-consent-banner,
.dark .cookie-consent-banner {
    --color-bg: #1f2937;
    --color-bg-alt: #374151;
    --color-text: #f9fafb;
    --color-text-muted: #9ca3af;
    --color-border: #4b5563;
}
