/**
 * Global Log FAB (Floating Action Button)
 * Full-width pill on mobile, compact pill on desktop
 * Appears on all pages except workout-mode and workout-builder
 */

/* ============================================
   FAB BASE — MOBILE-FIRST FULL-WIDTH PILL
   ============================================ */

.global-log-fab {
    position: fixed;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    right: 16px;
    left: 16px;
    height: 48px;
    border-radius: 8px;
    background: var(--gs-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 15px;
    line-height: 1;
    text-decoration: none;
    border: none;
    padding: 0 16px;
    appearance: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1040;
    transition: transform var(--gs-duration-fast, 150ms) ease,
                box-shadow var(--gs-duration-fast, 150ms) ease;
    -webkit-tap-highlight-color: transparent;
}

/* Label — always visible */
.global-log-fab-label {
    display: inline;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

/* ============================================
   BOTTOM PADDING — PREVENT FAB FROM COVERING CONTENT
   ============================================ */

body.has-global-log-fab .content-wrapper {
    padding-bottom: 88px !important;
}

/* Dim when bottom sheet is open */
.global-log-fab.is-open {
    opacity: 0.7;
}

/* ============================================
   HOVER / ACTIVE STATES
   ============================================ */

.global-log-fab:hover {
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.global-log-fab:active {
    transform: scale(0.95);
}

/* ============================================
   DESKTOP: COMPACT PILL, RIGHT-ALIGNED
   ============================================ */

@media (min-width: 769px) {
    .global-log-fab {
        left: auto;
        right: 24px;
        width: auto;
        bottom: 24px;
    }
}

/* ============================================
   OFFSET WHEN BOTTOM ACTION BAR IS PRESENT
   ============================================ */

body.has-bottom-action-bar .global-log-fab {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}

/* ============================================
   DARK MODE
   ============================================ */

[data-bs-theme="dark"] .global-log-fab {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

[data-bs-theme="dark"] .global-log-fab:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

.global-log-fab:focus-visible {
    outline: 2px solid var(--gs-primary);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .global-log-fab {
        transition: none;
    }
}

/* ============================================
   PRINT: HIDE
   ============================================ */

@media print {
    .global-log-fab {
        display: none;
    }
}
