/* ABOUTME: Styles for the GDPR/CCPA consent banner component */
/* ABOUTME: Uses Material Design tokens for consistent styling with the rest of Omumu */

/* Banner container - fixed at bottom of viewport */
.consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000000;
    background: var(--md-sys-color-surface, #fffbfe);
    border-top: 1px solid var(--md-sys-color-outline-variant, #cac4d0);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
}

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

.consent-banner-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Banner title */
.consent-banner-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--md-sys-color-on-surface, #1c1b1f);
    margin: 0;
}

/* Banner message text */
.consent-banner-message {
    font-size: 1rem;
    line-height: 1.5;
    color: var(--md-sys-color-on-surface-variant, #49454f);
    margin: 0;
}

.consent-banner-message a {
    color: var(--md-sys-color-primary, #6750a4);
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

/* Button container */
.consent-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

/* Consent categories section */
.consent-categories {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1rem 0;
    padding: 1rem;
    background: var(--md-sys-color-surface-variant, #e7e0ec);
    border-radius: 12px;
}

.consent-category {
    padding: 0.75rem;
    background: var(--md-sys-color-surface, #fffbfe);
    border-radius: 8px;
}

.consent-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.consent-category-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: 500;
}

.consent-category-name {
    color: var(--md-sys-color-on-surface, #1c1b1f);
}

.consent-category-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: var(--md-sys-color-secondary-container, #e8def8);
    color: var(--md-sys-color-on-secondary-container, #1d192b);
    border-radius: 100px;
}

.consent-category-desc {
    margin: 0.5rem 0 0 2rem;
    font-size: 0.875rem;
    color: var(--md-sys-color-on-surface-variant, #49454f);
    line-height: 1.4;
}

/* Custom checkbox styling */
.consent-checkbox {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.5rem;
    accent-color: var(--md-sys-color-primary, #6750a4);
    cursor: pointer;
    flex-shrink: 0;
}

.consent-checkbox:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Primary button (Accept All) */
.consent-btn-accept {
    background: var(--md-sys-color-primary, #6750a4);
    color: var(--md-sys-color-on-primary, #ffffff);
    border: none;
    border-radius: 100px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.consent-btn-accept:hover {
    background: var(--md-sys-color-primary-container, #eaddff);
    color: var(--md-sys-color-on-primary-container, #21005d);
}

.consent-btn-accept:focus-visible {
    outline: 2px solid var(--md-sys-color-primary, #6750a4);
    outline-offset: 2px;
}

/* Save Preferences button */
.consent-btn-save {
    background: var(--md-sys-color-secondary-container, #e8def8);
    color: var(--md-sys-color-on-secondary-container, #1d192b);
    border: none;
    border-radius: 100px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.consent-btn-save:hover {
    background: var(--md-sys-color-secondary, #625b71);
    color: var(--md-sys-color-on-secondary, #ffffff);
}

.consent-btn-save:focus-visible {
    outline: 2px solid var(--md-sys-color-primary, #6750a4);
    outline-offset: 2px;
}

/* Secondary button (Essential Only) */
.consent-btn-decline {
    background: transparent;
    color: var(--md-sys-color-primary, #6750a4);
    border: 1px solid var(--md-sys-color-outline, #79747e);
    border-radius: 100px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.consent-btn-decline:hover {
    background: var(--md-sys-color-surface-variant, #e7e0ec);
}

.consent-btn-decline:focus-visible {
    outline: 2px solid var(--md-sys-color-primary, #6750a4);
    outline-offset: 2px;
}

/* Tertiary text button (Cookie Settings link) */
.consent-btn-settings {
    background: none;
    border: none;
    color: var(--md-sys-color-primary, #6750a4);
    text-decoration: underline;
    text-underline-offset: 0.2em;
    padding: 0.75rem 0;
    font-size: 1rem;
    cursor: pointer;
}

.consent-btn-settings:hover {
    text-decoration-thickness: 2px;
}

/* Notice-only banner (simpler style for non-GDPR regions) */
.consent-banner.notice-only {
    padding: 1rem 1.5rem;
}

.consent-banner.notice-only .consent-banner-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.consent-banner.notice-only .consent-banner-message {
    flex: 1;
    margin-right: 1rem;
}

.consent-banner.notice-only .consent-banner-actions {
    margin-top: 0;
}

/* Dismiss button (X) for notice banner */
.consent-btn-dismiss {
    background: none;
    border: none;
    color: var(--md-sys-color-on-surface-variant, #49454f);
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.consent-btn-dismiss:hover {
    background: var(--md-sys-color-surface-variant, #e7e0ec);
}

.consent-btn-dismiss svg {
    width: 24px;
    height: 24px;
}

/* CCPA "Do Not Sell" link in footer */
.ccpa-do-not-sell-link {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 0.2em;
    cursor: pointer;
}

.ccpa-do-not-sell-link:hover {
    text-decoration-thickness: 2px;
}

/* Cookie Settings link in footer */
.cookie-settings-link {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 0.2em;
    cursor: pointer;
    background: none;
    border: none;
    font: inherit;
    padding: 0;
}

.cookie-settings-link:hover {
    text-decoration-thickness: 2px;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .consent-banner {
        padding: 1rem;
        max-height: 90vh;
        overflow-y: auto;
    }

    .consent-banner-inner {
        gap: 0.75rem;
    }

    .consent-banner-actions {
        flex-direction: column;
    }

    .consent-btn-accept,
    .consent-btn-save,
    .consent-btn-decline {
        width: 100%;
        text-align: center;
    }

    .consent-categories {
        padding: 0.75rem;
    }

    .consent-category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .consent-category-desc {
        margin-left: 0;
    }

    .consent-banner.notice-only .consent-banner-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .consent-banner.notice-only .consent-banner-message {
        margin-right: 0;
        margin-bottom: 0.75rem;
    }
}
