/* =============================================================================
   Pulse Accessibility Panel
   Floating trigger + slide-up settings panel.
   Uses --pulse-* tokens — auto-adapts to dark mode and contrast modes.
   ============================================================================= */

/* ---------------------------------------------------------------------------
   Floating trigger button (bottom-right)
   --------------------------------------------------------------------------- */
.pulse-a11y-trigger {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 900;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    min-width: 44px;
    min-height: 44px;
    padding: 0 14px;

    background: var(--pulse-surface-card);
    color: var(--pulse-text-primary);
    border: 1px solid var(--pulse-border-default);
    border-radius: 999px;
    box-shadow: var(--pulse-shadow-md);

    font: 600 13px/1 "Inter", "Segoe UI", sans-serif;
    letter-spacing: 0.02em;
    cursor: pointer;

    transition: var(--pulse-transition), transform 0.15s ease, box-shadow 0.15s ease;
}

.pulse-a11y-trigger:hover {
    background: var(--pulse-surface-raised);
    box-shadow: var(--pulse-shadow-lg);
    transform: translateY(-1px);
}

.pulse-a11y-trigger:focus-visible {
    outline: 2px solid var(--pulse-brand-primary);
    outline-offset: 3px;
}

.pulse-a11y-trigger:active {
    transform: translateY(0);
}

/* ---------------------------------------------------------------------------
   Panel container
   --------------------------------------------------------------------------- */
.pulse-a11y-panel {
    position: fixed;
    bottom: 80px;
    right: 24px;
    z-index: 901;

    width: 260px;
    background: var(--pulse-surface-card);
    border: 1px solid var(--pulse-border-default);
    border-radius: 16px;
    box-shadow: var(--pulse-shadow-lg);
    padding: 16px;

    display: flex;
    flex-direction: column;
    gap: 14px;

    /* Slide-up animation */
    animation: pulse-panel-in 0.18s ease;
    transform-origin: bottom right;
}

.pulse-a11y-panel[hidden] {
    display: none;
}

@keyframes pulse-panel-in {
    from { opacity: 0; transform: scale(0.95) translateY(6px); }
    to   { opacity: 1; transform: scale(1)    translateY(0);   }
}

/* Panel header */
.pulse-a11y-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--pulse-border-default);
}

.pulse-a11y-panel-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--pulse-text-muted);
    margin: 0;
}

/* ---------------------------------------------------------------------------
   Section (each control group)
   --------------------------------------------------------------------------- */
.pulse-a11y-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pulse-a11y-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--pulse-text-muted);
}

/* ---------------------------------------------------------------------------
   Button group
   --------------------------------------------------------------------------- */
.pulse-a11y-btn-group {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.pulse-a11y-btn {
    flex: 1;
    min-height: 34px;
    padding: 6px 10px;

    background: var(--pulse-surface-base);
    color: var(--pulse-text-secondary);
    border: 1px solid var(--pulse-border-default);
    border-radius: 8px;

    font: 500 12px/1 "Inter", "Segoe UI", sans-serif;
    cursor: pointer;
    text-align: center;

    transition: var(--pulse-transition), transform 0.1s ease;
}

.pulse-a11y-btn:hover {
    background: var(--pulse-surface-raised);
    color: var(--pulse-text-primary);
    border-color: var(--pulse-border-strong);
}

.pulse-a11y-btn:focus-visible {
    outline: 2px solid var(--pulse-brand-primary);
    outline-offset: 2px;
}

.pulse-a11y-btn:active {
    transform: scale(0.96);
}

/* Active / selected state (driven by aria-pressed="true") */
.pulse-a11y-btn[aria-pressed="true"] {
    background: var(--pulse-brand-primary);
    color: #ffffff;
    border-color: var(--pulse-brand-primary);
    font-weight: 700;
}

/* ---------------------------------------------------------------------------
   Responsive — full width panel anchored to bottom on small screens
   --------------------------------------------------------------------------- */
@media (max-width: 480px) {
    .pulse-a11y-trigger {
        bottom: 16px;
        right: 16px;
    }

    .pulse-a11y-panel {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.18);
    }
}
