﻿/**
 * Card FAB (Floating Action Button) Component Styles
 * A single rounded-square trigger that morphs into a taller panel, revealing
 * action buttons above the ⋮ icon, then contracts back on a second click.
 * JS: assets/js/components/card-fab.js
 * Version: 4.0.0
 */

/* ============================================================
   GLOBAL OVERRIDES — stop base touch-target min-size rules
   from blowing out component dimensions
   ============================================================ */

.card-fab__action,
.card-fab__toggle {
    min-width: 0 !important;
    min-height: 0 !important;
}

/* ============================================================
   WRAPPER — the morphing container (rounded square ↔ tall panel)
   ============================================================ */

.card-fab__wrapper {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 56px;
    overflow: hidden;
    background: rgba(248, 250, 255, 0.92);
    border: 1px solid rgba(15, 34, 58, 0.12);
    border-radius: var(--bs-card-border-radius, 0.375rem);
    box-shadow: 0 8px 20px rgba(15, 34, 58, 0.12);
    backdrop-filter: blur(10px);
    pointer-events: none;
    transition: border-radius 0.25s ease, box-shadow 0.25s ease;
}

.card-fab__wrapper.is-open {
    border-radius: 0.75rem;
    box-shadow: 0 12px 28px rgba(15, 34, 58, 0.18);
}

/* ============================================================
   ACTIONS — hidden section that expands inside the wrapper
   ============================================================ */

.card-fab__actions {
    max-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    transition: max-height 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                padding   0.25s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
}

.card-fab__wrapper.is-open .card-fab__actions {
    max-height: 120px; /* ~2 actions — increase for more */
    padding: 0.4rem 0 0;
    pointer-events: auto;
}

/* ============================================================
   ACTION BUTTONS — 42 × 42 rounded-square icons
   (matches event-card__fab-action sizing)
   ============================================================ */

.card-fab__action {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid rgba(15, 34, 58, 0.12);
    background: transparent;
    color: #1f2a37;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 0.85rem;
    cursor: pointer;
    pointer-events: auto;
    text-decoration: none;
    flex-shrink: 0;
    transition: background 0.15s ease, color 0.15s ease;
}

.card-fab__action + .card-fab__action {
    margin-top: 0.35rem;
}

.card-fab__action:hover {
    background: rgba(42, 123, 228, 0.1);
    color: #1f2a37;
}

.card-fab__action.text-danger {
    border-color: rgba(220, 38, 38, 0.2);
    color: #b91c1c;
}

.card-fab__action.text-danger:hover {
    background: rgba(220, 38, 38, 0.12);
    color: #991b1b;
}

/* ============================================================
   TOGGLE — the ⋮ trigger (always visible at the bottom)
   ============================================================ */

.card-fab__toggle {
    width: 100%;
    height: 38px;
    border: none;
    background: transparent;
    color: #1f2a37;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 0.85rem;
    cursor: pointer;
    pointer-events: auto;
    flex-shrink: 0;
    transition: color 0.15s ease;
}

.card-fab__wrapper.is-open .card-fab__toggle {
    border-top: 1px solid rgba(15, 34, 58, 0.06);
    color: #6b7280;
}

.card-fab__toggle:hover {
    color: #2a7be4;
}
