/**
 * Bottom Action Bar Component
 * Mobile-first navigation bar with Material Design 3 specifications
 * Uses 4-button + right FAB layout for all pages
 * Based on approved designs from bottom-nav-demo-alt.html
 */

/* ============================================
   FLOATING FAB DESIGN TOKENS - MOBILE FIRST
   Standardized sizing for consistent FAB buttons
   ============================================ */

:root {
    --floating-fab-height: 44px;
    --floating-fab-min-width: 44px;
    --floating-fab-padding-x: 12px;
    --floating-fab-spacing-right: 16px;
    --floating-fab-spacing-bottom: 12px;
    --floating-fab-border-radius: 12px;
    --floating-fab-gap: 8px;
    --floating-fab-font-size: 14px;
    --floating-fab-icon-size: 18px;
    --floating-timer-width: 100px; /* Fixed width for timer to prevent reshaping */
    --floating-timer-paused-width: 140px; /* Wider width for paused state with controls */

    /* Content padding to clear bottom bar + floating FABs */
    --bottom-bar-content-padding: calc(56px + 56px + env(safe-area-inset-bottom, 0px) + 16px);
}

/* ============================================
   BOTTOM ACTION BAR - CONTAINER
   ============================================ */

.bottom-action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bs-body-bg);
    border-top: 1px solid var(--bs-border-color);
    padding: 4px 12px;
    padding-bottom: calc(4px + env(safe-area-inset-bottom));
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.06);
    z-index: 1000;
    height: 56px;
    height: calc(56px + env(safe-area-inset-bottom));
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Gradient fade at top of nav bar (alternative layout) */
.bottom-action-bar::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1));
    pointer-events: none;
    z-index: -1;
}

[data-bs-theme="dark"] .bottom-action-bar::before {
    background: linear-gradient(to bottom, transparent, var(--bs-body-bg));
}

/* Dark mode adjustments */
[data-bs-theme="dark"] .bottom-action-bar {
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.3);
}

/* ============================================
   ACTION BAR CONTAINER
   ============================================ */

.action-bar-container {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    height: 48px;
    padding: 0 4px;
}

/* ============================================
   ACTION BUTTONS ROW (ALTERNATIVE LAYOUT)
   4 buttons evenly distributed
   ============================================ */

.action-buttons-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 4px;
    z-index: 1;
    padding: 0 4px 0 8px;
    margin-right: 0;
}

/* ============================================
   ACTION BUTTONS
   ============================================ */

.action-btn {
    flex: 1 1 0;
    max-width: none;
    height: 44px;
    min-width: 48px;
    border-radius: 12px;
    background: transparent;
    border: none;
    color: var(--bs-body-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: background-color 0.15s cubic-bezier(0.4, 0, 0.2, 1), color 0.15s cubic-bezier(0.4, 0, 0.2, 1), transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    padding: 0;
    gap: 2px;
}

/* Ensure buttons in action-buttons-row fill available space */
.action-buttons-row .action-btn {
    flex: 1 1 0;
    max-width: none;
    height: 44px;
    min-width: 48px;
    border-radius: 12px;
    padding: 0;
}

.action-btn:hover {
    background: rgba(var(--bs-primary-rgb), 0.08);
    color: var(--bs-primary);
}

.action-btn:active {
    transform: scale(0.92);
    background: rgba(var(--bs-primary-rgb), 0.12);
}

.action-btn:focus {
    outline: none;
}

/* Active state for toggle buttons (e.g., favorites filter) */
.action-btn.active {
    color: var(--bs-danger);
    background: rgba(var(--bs-danger-rgb), 0.08);
}

.action-btn.active:hover {
    background: rgba(var(--bs-danger-rgb), 0.12);
    color: var(--bs-danger);
}

.action-btn.active:active {
    background: rgba(var(--bs-danger-rgb), 0.16);
}

/* Pulse animation for button feedback */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
    100% {
        transform: scale(1);
    }
}

.action-btn.pulse-animation {
    animation: pulse 0.3s ease-in-out;
}

.action-btn.pulse-animation i {
    animation: pulse 0.3s ease-in-out;
}

/* Button states for save feedback - Darker, Subtle Colors */
.action-btn.saving {
    pointer-events: none;
    opacity: 0.8;
    color: rgba(255, 255, 255, 0.7);
}

.action-btn.saving i {
    animation: spin 1s linear infinite;
}

.action-btn.saved {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.15);
}

.action-btn.error {
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.1);
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Button icon */
.action-btn i {
    display: block;
    line-height: 1;
}

/* ============================================
   ACTION BUTTON LABELS
   ============================================ */

.action-btn-label {
    font-size: 10px;
    font-weight: 600;
    margin-top: 2px;
    color: inherit;
    line-height: 1;
    letter-spacing: 0.02em;
    display: block;
}

/* ============================================
   FAB (FLOATING ACTION BUTTON)
   Material Design 3 Specifications
   ============================================ */

.action-fab {
    position: absolute;
    right: 4px;
    bottom: 100%;
    transform: translateY(-18px);
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 8px; /* Less rounded for more square appearance */
    background: var(--bs-primary);
    color: white;
    border: none;
    box-shadow:
        0 3px 5px -1px rgba(0, 0, 0, 0.2),
        0 6px 10px 0 rgba(0, 0, 0, 0.14),
        0 1px 18px 0 rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1), filter 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
    pointer-events: auto;
}

.action-fab:hover {
    background: var(--bs-primary);
    filter: brightness(0.95);
    transform: translateY(-20px);
    box-shadow:
        0 5px 5px -3px rgba(0, 0, 0, 0.2),
        0 8px 10px 1px rgba(0, 0, 0, 0.14),
        0 3px 14px 2px rgba(0, 0, 0, 0.12);
}

.action-fab:active {
    transform: translateY(-16px) scale(0.95);
}

.action-fab:focus {
    outline: none;
}

/* FAB variants */
.action-fab.success {
    background: var(--bs-success);
}

.action-fab.success:hover {
    background: var(--bs-success);
    filter: brightness(0.95);
}

.action-fab.danger {
    background: var(--bs-danger);
}

.action-fab.danger:hover {
    background: var(--bs-danger);
    filter: brightness(0.95);
}

/* ============================================
   FLOATING ACTION FAB (WORKOUT MODE, ETC.)
   Regular floating FAB with optional label
   ============================================ */

.floating-action-fab {
    position: absolute;
    right: var(--floating-fab-spacing-right);
    bottom: calc(100% + var(--floating-fab-spacing-bottom));
    height: var(--floating-fab-height);
    width: var(--floating-fab-min-width);
    min-width: var(--floating-fab-min-width);
    padding: 0;
    border-radius: var(--floating-fab-border-radius);
    background: var(--bs-success);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--floating-fab-gap);
    cursor: pointer;
    z-index: 1002;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-weight: 600;
    font-size: var(--floating-fab-icon-size);
    white-space: nowrap;
    pointer-events: auto;
    /* Override action-fab defaults when both classes are used */
    transform: none;
}

/* When action-fab is combined with floating-action-fab, use floating-action-fab standards */
.action-fab.floating-action-fab {
    right: var(--floating-fab-spacing-right);
    bottom: calc(100% + var(--floating-fab-spacing-bottom));
    height: var(--floating-fab-height);
    width: var(--floating-fab-min-width);
    min-width: var(--floating-fab-min-width);
    border-radius: var(--floating-fab-border-radius);
    font-size: var(--floating-fab-icon-size);
    transform: none;
}

.action-fab.floating-action-fab:hover {
    transform: translateY(-2px);
}

.action-fab.floating-action-fab:active {
    transform: translateY(0);
}

/* When floating-action-fab is ALSO a start/end button, use button dimensions */
.floating-action-fab.floating-start-button,
.floating-action-fab.floating-end-button {
    height: var(--floating-fab-height);
    width: auto;
    min-width: var(--floating-fab-min-width);
    padding: 0 var(--floating-fab-padding-x);
    border-radius: var(--floating-fab-border-radius);
    gap: var(--floating-fab-gap);
    font-size: var(--floating-fab-font-size);
    font-weight: 600;
    line-height: 1.5;
}

/* No need to move FAB up since search is now at top */

/* ============================================
   FLOATING TIMER + END BUTTON COMBO (WORKOUT MODE ACTIVE)
   Timer display and End button side-by-side
   ============================================ */

.floating-timer-end-combo {
    position: absolute;
    right: var(--floating-fab-spacing-right);
    bottom: calc(100% + var(--floating-fab-spacing-bottom));
    display: flex;
    gap: var(--floating-fab-gap);
    align-items: center;
    z-index: 1002;
    pointer-events: auto;
    /* ✅ PHASE 8 FIX: No background/border on container - let buttons style themselves */
    background: transparent;
    border: none;
    padding: 0;
}

/* Timer Display */
.floating-timer-display {
    height: var(--floating-fab-height);
    width: 120px; /* ✅ PHASE 8 FIX: Fixed width for 0:00:00 format */
    min-width: 120px;
    max-width: 120px;
    padding: 0 var(--floating-fab-padding-x);
    background: var(--bs-body-bg); /* ✅ PHASE 8 FIX: Match button styling */
    border: 2px solid var(--bs-primary); /* ✅ PHASE 8 FIX: Match button styling */
    border-radius: var(--floating-fab-border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--floating-fab-gap);
    font-size: var(--floating-fab-font-size);
    font-weight: 600;
    color: var(--bs-body-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); /* ✅ PHASE 8 FIX: Match button shadow */
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    align-self: center;
}

.floating-timer-display i {
    font-size: var(--floating-fab-icon-size);
    color: var(--bs-primary);
    flex-shrink: 0;
}

.floating-timer-display span {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-variant-numeric: tabular-nums; /* Fixed-width numbers */
}

/* Start/End Button (changes based on session state) */
.floating-end-button,
.floating-start-button {
    height: var(--floating-fab-height);
    min-width: var(--floating-fab-min-width);
    padding: 0 var(--floating-fab-padding-x);
    border: none;
    border-radius: var(--floating-fab-border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--floating-fab-gap);
    font-size: var(--floating-fab-font-size);
    font-weight: 600;
    line-height: 1.5;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
    align-self: center;
    color: white;
}

/* End Button (red, for active session) */
.floating-end-button {
    background: var(--bs-danger);
    box-shadow: 0 2px 8px rgba(var(--bs-danger-rgb), 0.3);
}

.floating-end-button:hover {
    background: var(--gs-action-danger-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--bs-danger-rgb), 0.4);
}

.floating-end-button:active {
    transform: translateY(0);
}

/* Start Button (Forest Green, for inactive session) */
.floating-start-button {
    background: var(--gs-action-start);
    box-shadow: 0 2px 8px rgba(var(--gs-action-start-rgb), 0.3);
}

.floating-start-button:hover {
    background: var(--gs-action-start-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--gs-action-start-rgb), 0.4);
}

.floating-start-button:active {
    transform: translateY(0);
}

.floating-end-button i,
.floating-start-button i {
    font-size: var(--floating-fab-icon-size);
}

/* Dark mode adjustments */
[data-bs-theme="dark"] .floating-timer-display {
    background: var(--bs-body-bg);
    border-color: var(--bs-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

[data-bs-theme="dark"] .floating-end-button,
[data-bs-theme="dark"] .floating-start-button {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

[data-bs-theme="dark"] .floating-end-button:hover,
[data-bs-theme="dark"] .floating-start-button:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

/* Mobile responsive - REMOVED sizing overrides for mobile-first consistency */
/* All floating FABs now use consistent 44px height across all breakpoints */

/* ============================================
   DUAL FLOATING BUTTONS (QUICK LOG + TIMED)
   Pre-session state with two button options
   ============================================ */

.floating-dual-buttons {
    position: absolute;
    right: var(--floating-fab-spacing-right);
    bottom: calc(100% + var(--floating-fab-spacing-bottom));
    display: flex;
    gap: var(--floating-fab-gap);
    z-index: 1002;
    pointer-events: auto;
}

/* Quick Log Button (secondary/gray) */
.floating-quicklog-button {
    height: var(--floating-fab-height);
    min-width: var(--floating-fab-min-width);
    padding: 0 var(--floating-fab-padding-x);
    border: none;
    border-radius: var(--floating-fab-border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--floating-fab-gap);
    font-size: var(--floating-fab-font-size);
    font-weight: 600;
    line-height: 1.5;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
    color: white;
    background: var(--gs-action-quicklog);
    box-shadow: 0 2px 8px rgba(var(--gs-action-quicklog-rgb), 0.3);
}

.floating-quicklog-button:hover {
    background: var(--gs-action-quicklog-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--gs-action-quicklog-rgb), 0.4);
}

.floating-quicklog-button:active {
    transform: translateY(0);
}

.floating-quicklog-button i {
    font-size: var(--floating-fab-icon-size);
}

/* ============================================
   QUICK LOG COMBO (BADGE + SAVE BUTTON)
   Active Quick Log state
   ============================================ */

.floating-quicklog-combo {
    position: absolute;
    right: var(--floating-fab-spacing-right);
    bottom: calc(100% + var(--floating-fab-spacing-bottom));
    display: flex;
    align-items: center;
    gap: var(--floating-fab-gap);
    z-index: 1002;
    pointer-events: auto;
}

/* Quick Log Badge (static indicator) */
.floating-quicklog-badge {
    height: var(--floating-fab-height);
    padding: 0 var(--floating-fab-padding-x);
    border-radius: var(--floating-fab-border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--floating-fab-gap);
    font-size: var(--floating-fab-font-size);
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
    color: white;
    background: var(--gs-action-quicklog);
    box-shadow: 0 2px 8px rgba(var(--gs-action-quicklog-rgb), 0.3);
}

.floating-quicklog-badge i {
    font-size: var(--floating-fab-icon-size);
}

/* Save Button (green, for Quick Log completion) */
.floating-save-button {
    height: var(--floating-fab-height);
    min-width: var(--floating-fab-min-width);
    padding: 0 var(--floating-fab-padding-x);
    border: none;
    border-radius: var(--floating-fab-border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--floating-fab-gap);
    font-size: var(--floating-fab-font-size);
    font-weight: 600;
    line-height: 1.5;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
    color: white;
    background: var(--gs-action-start);
    box-shadow: 0 2px 8px rgba(var(--gs-action-start-rgb), 0.3);
}

.floating-save-button:hover {
    background: var(--gs-action-start-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--gs-action-start-rgb), 0.4);
}

.floating-save-button:active {
    transform: translateY(0);
}

.floating-save-button i {
    font-size: var(--floating-fab-icon-size);
}

/* ============================================
   QUICK LOG MODE BANNER
   Shows at top of page during Quick Log mode
   ============================================ */

.quick-log-mode-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--gs-action-quicklog) 0%, var(--gs-action-quicklog-dark) 100%);
    color: white;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 1050;
}

.quick-log-mode-banner i {
    font-size: 18px;
}

.quick-log-mode-banner span {
    font-weight: 700;
}

.quick-log-mode-banner small {
    font-weight: 400;
    opacity: 0.85;
    margin-left: 4px;
}

/* Dark mode adjustments */
[data-bs-theme="dark"] .quick-log-mode-banner {
    background: linear-gradient(135deg, var(--gs-action-quicklog-dark) 0%, var(--gs-gray-700) 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Cancel Button (for Quick Log) */
.floating-cancel-button {
    height: var(--floating-fab-height);
    width: var(--floating-fab-height);  /* Square button */
    min-width: var(--floating-fab-height);
    padding: 0;
    border: none;
    border-radius: var(--floating-fab-border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    color: white;
    background: var(--bs-danger);
    box-shadow: 0 2px 8px rgba(var(--bs-danger-rgb), 0.3);
}

.floating-cancel-button:hover {
    background: var(--gs-action-danger-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--bs-danger-rgb), 0.4);
}

.floating-cancel-button:active {
    transform: translateY(0);
}

.floating-cancel-button i {
    font-size: calc(var(--floating-fab-icon-size) + 2px);
}

/* Dark mode adjustments for Quick Log elements */
[data-bs-theme="dark"] .floating-quicklog-button,
[data-bs-theme="dark"] .floating-quicklog-badge {
    background: var(--gs-action-quicklog-dark);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

[data-bs-theme="dark"] .floating-quicklog-button:hover {
    background: var(--gs-action-quicklog-dark-hover);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

[data-bs-theme="dark"] .floating-save-button {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

[data-bs-theme="dark"] .floating-save-button:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

/* ============================================
   GLOBAL REST TIMER BUTTON (WORKOUT MODE)
   Floating rest timer that morphs between states
   ============================================ */

.global-rest-timer-button {
    /* Position as flex item within the floating combo */
    flex-shrink: 0;
    margin-right: var(--floating-fab-gap);
    z-index: 1002;
    pointer-events: auto;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: var(--floating-timer-width);
    min-width: var(--floating-timer-width);
    max-width: var(--floating-timer-width);
    height: var(--floating-fab-height);
    align-self: center;
}

/* Base timer button styling */
.global-timer-btn {
    width: var(--floating-timer-width);
    height: var(--floating-fab-height);
    min-width: var(--floating-timer-width);
    max-width: var(--floating-timer-width);
    padding: 0 var(--floating-fab-padding-x);
    border-radius: var(--floating-fab-border-radius);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--floating-fab-gap);
    font-size: var(--floating-fab-font-size);
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
}

/* Ready state - green button */
.global-rest-timer-button.ready .global-timer-btn {
    background: var(--bs-success);
    color: white;
}

.global-rest-timer-button.ready .global-timer-btn:hover {
    background: var(--gs-action-success-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--gs-success-rgb), 0.4);
}

/* Counting state - display with pause option */
.global-timer-countdown {
    height: var(--floating-fab-height);
    width: var(--floating-timer-width);
    min-width: var(--floating-timer-width);
    max-width: var(--floating-timer-width);
    padding: 0 var(--floating-fab-padding-x);
    background: var(--bs-body-bg);
    border: 2px solid var(--bs-primary);
    border-radius: var(--floating-fab-border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--floating-fab-gap);
    font-size: var(--floating-fab-font-size);
    font-weight: 600;
    color: var(--bs-body-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.global-timer-time {
    font-size: var(--floating-fab-font-size);
    font-weight: 700;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
}

.global-timer-pause-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0;
    border-radius: 8px;
    border: none;
    background: var(--bs-secondary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease, filter 0.2s ease, transform 0.2s ease;
}

.global-timer-pause-btn:hover {
    background: var(--bs-secondary);
    filter: brightness(0.9);
    transform: scale(1.05);
}

/* Paused state - display with reset/resume controls */
.global-timer-paused {
    height: var(--floating-fab-height);
    width: var(--floating-timer-paused-width);
    min-width: var(--floating-timer-paused-width);
    max-width: var(--floating-timer-paused-width);
    padding: 0 var(--floating-fab-padding-x);
    background: var(--bs-warning);
    border: 2px solid var(--bs-warning);
    border-radius: var(--floating-fab-border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--floating-fab-gap);
    font-size: var(--floating-fab-font-size);
    font-weight: 600;
    color: white;
    box-shadow: 0 2px 8px rgba(var(--bs-warning-rgb), 0.3);
    transition: width 0.2s ease, box-shadow 0.2s ease;
}

.global-timer-paused .global-timer-time {
    color: white;
}

.global-timer-controls {
    display: flex;
    gap: 6px;
}

.global-timer-controls button {
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0;
    border-radius: 6px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 14px;
}

.global-timer-controls button:first-child {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.global-timer-controls button:first-child:hover {
    background: rgba(255, 255, 255, 0.3);
}

.global-timer-controls button:last-child {
    background: rgba(var(--gs-success-rgb), 0.8);
    color: white;
}

.global-timer-controls button:last-child:hover {
    background: rgba(var(--gs-success-rgb), 1);
}

/* Done state - success button */
.global-rest-timer-button.done .global-timer-btn {
    background: var(--bs-success);
    color: white;
    animation: timer-complete-pulse 2s ease-in-out;
}

/* Mobile countdown layout */
.global-timer-countdown-mobile {
    height: var(--floating-fab-height);
    width: var(--floating-timer-width);
    min-width: var(--floating-timer-width);
    max-width: var(--floating-timer-width);
    padding: 0 var(--floating-fab-padding-x);
    background: var(--bs-body-bg);
    border: 2px solid var(--bs-primary);
    border-radius: var(--floating-fab-border-radius);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--floating-fab-gap);
    font-size: var(--floating-fab-font-size);
    font-weight: 600;
    color: var(--bs-body-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Mobile paused layout */
.global-timer-paused-mobile {
    height: var(--floating-fab-height);
    width: var(--floating-timer-paused-width);
    min-width: var(--floating-timer-paused-width);
    max-width: var(--floating-timer-paused-width);
    padding: 0 var(--floating-fab-padding-x);
    background: var(--bs-warning);
    border: 2px solid var(--bs-warning);
    border-radius: var(--floating-fab-border-radius);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--floating-fab-gap);
    font-size: var(--floating-fab-font-size);
    font-weight: 600;
    color: white;
    box-shadow: 0 2px 8px rgba(var(--bs-warning-rgb), 0.3);
    transition: width 0.2s ease, box-shadow 0.2s ease;
}

.global-timer-paused-mobile .global-timer-controls {
    gap: 4px;
}

.global-timer-paused-mobile .global-timer-controls button {
    width: 28px;
    height: 28px;
    min-width: 28px;
    font-size: 12px;
}

/* Pulse animation for timer completion */
@keyframes timer-complete-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(var(--gs-success-rgb), 0.3);
    }
    25% {
        transform: scale(1.05);
        box-shadow: 0 4px 16px rgba(var(--gs-success-rgb), 0.5);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 6px 20px rgba(var(--gs-success-rgb), 0.6);
    }
    75% {
        transform: scale(1.05);
        box-shadow: 0 4px 16px rgba(var(--gs-success-rgb), 0.5);
    }
}

/* Dark mode adjustments */
[data-bs-theme="dark"] .global-timer-countdown,
[data-bs-theme="dark"] .global-timer-countdown-mobile {
    background: var(--bs-body-bg);
    border-color: var(--bs-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

[data-bs-theme="dark"] .global-timer-paused,
[data-bs-theme="dark"] .global-timer-paused-mobile {
    background: var(--bs-warning);
    border-color: var(--bs-warning);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Mobile responsive adjustments - REMOVED for mobile-first consistency */
/* All global timer components now use consistent 44px height via CSS variables */

/* Accessibility */
.global-rest-timer-button:focus-within {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .global-rest-timer-button,
    .global-timer-btn,
    .global-timer-countdown,
    .global-timer-countdown-mobile,
    .global-timer-paused,
    .global-timer-paused-mobile {
        transition: none;
    }
    
    .global-rest-timer-button.done .global-timer-btn {
        animation: none;
    }
}

.floating-action-fab:hover:not(.floating-start-button):not(.floating-end-button) {
    background: var(--gs-action-success-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--gs-success-rgb), 0.4);
}

.floating-action-fab:active:not(.floating-start-button):not(.floating-end-button) {
    /* Remove scale transform to prevent button from moving down */
    transform: none;
    background: var(--gs-action-success-active);
}

.floating-action-fab i:not(.floating-start-button i):not(.floating-end-button i) {
    font-size: var(--floating-fab-icon-size);
    flex-shrink: 0;
}

/* Start/End button icon size override - must appear after .floating-action-fab i */
.floating-action-fab.floating-start-button i,
.floating-action-fab.floating-end-button i {
    font-size: var(--floating-fab-icon-size);
}

.floating-action-fab .fab-label {
    display: none; /* Hide label for square FAB */
}

/* Variant colors */
.floating-action-fab.primary {
    background: var(--bs-primary);
}

.floating-action-fab.success {
    background: var(--bs-success);
}

.floating-action-fab.danger {
    background: var(--bs-danger);
}

/* Dark mode adjustments */
[data-bs-theme="dark"] .floating-action-fab {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

[data-bs-theme="dark"] .floating-action-fab:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* ============================================
   SECONDARY FAB (ALTERNATIVE LAYOUT)
   Optional secondary action button
   ============================================ */

.action-fab-secondary {
    position: absolute;
    right: 56px;
    bottom: 100%;
    transform: translateY(-18px);
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 12px;
    background: var(--bs-secondary);
    color: white;
    border: none;
    box-shadow:
        0 2px 4px -1px rgba(0, 0, 0, 0.2),
        0 4px 6px 0 rgba(0, 0, 0, 0.14),
        0 1px 10px 0 rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1), filter 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
}

.action-fab-secondary:hover {
    background: var(--bs-secondary);
    filter: brightness(0.9);
    transform: translateY(-20px);
    box-shadow:
        0 3px 5px -1px rgba(0, 0, 0, 0.2),
        0 6px 8px 0 rgba(0, 0, 0, 0.14),
        0 1px 12px 0 rgba(0, 0, 0, 0.12);
}

.action-fab-secondary:active {
    transform: translateY(-16px) scale(0.95);
}

.action-fab-secondary:focus {
    outline: none;
}

/* ============================================
   CONTENT PADDING ADJUSTMENT
   Add space for bottom bar on pages
   Only applies when body has .has-bottom-action-bar class
   ============================================ */

body.has-bottom-action-bar .content-wrapper {
    padding-bottom: var(--bottom-bar-content-padding, 128px);
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

/* Tablets and up */
@media (min-width: 768px) {
    .action-bar-container {
        max-width: 700px;
    }
    
    .action-group {
        gap: 16px;
    }
    
    .action-buttons-row {
        gap: 12px;
    }
}

/* Desktop */
@media (min-width: 1200px) {
    .action-bar-container {
        max-width: 800px;
    }
}

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

/* Focus visible for keyboard navigation */
.action-btn:focus-visible,
.action-fab:focus-visible,
.action-fab-secondary:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .bottom-action-bar,
    .action-btn,
    .action-fab,
    .action-fab-secondary {
        transition: none;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .bottom-action-bar {
        display: none;
    }
}

/* ============================================
   SEARCH BACKDROP (VISUAL DIMMING ONLY)
   Click-outside detection is now handled by document-level click handler
   ============================================ */

.search-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent; /* No gray overlay */
    z-index: 1049;
    display: none;
    pointer-events: none; /* ALWAYS none - clicks pass through to document handler */
    opacity: 0;
    transition: opacity 0.2s ease;
}

.search-backdrop.active {
    display: block;
    opacity: 1;
    /* pointer-events stays none - document click handler handles click-outside */
}

/* ============================================
   MORPHING SEARCH FAB - SNEAT STYLE
   ============================================ */

/* Floating Search FAB - positioned above action bar */
/* Note: Using div instead of button to allow nested button (Clear) */
.floating-search-fab {
    position: absolute;
    right: var(--floating-fab-spacing-right);
    bottom: calc(100% + var(--floating-fab-spacing-bottom));
    width: var(--floating-fab-min-width);
    height: var(--floating-fab-height);
    border-radius: var(--floating-fab-border-radius);
    background: var(--bs-primary);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1002;
    transition: width 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease, border-radius 0.25s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.floating-search-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.floating-search-fab:active {
    transform: translateY(0);
}

/* FAB icon (visible when collapsed) */
.search-fab-icon {
    font-size: var(--floating-fab-icon-size);
    color: #fff;
}

/* Search FAB expanded state - Below navbar */
/* Positioned below navbar with smooth scroll behavior */
.search-fab.expanded {
    position: fixed !important;
    width: calc(100% - 32px) !important;
    max-width: 450px !important;
    height: 48px !important;
    left: 50% !important;
    right: auto !important;
    top: 72px !important; /* Below navbar (60px) + spacing (12px) */
    bottom: auto !important;
    transform: translateX(-50%) !important;
    border-radius: 24px !important;
    background: var(--bs-body-bg) !important;
    border: 2px solid var(--bs-primary) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15) !important;
    padding: 0 16px !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    z-index: 1060 !important; /* Higher than action bar (1000) and offcanvas (1045) */
    transition: width 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease, top 0.25s ease !important;
    pointer-events: auto !important;
}

/* Mobile: Position below mobile navbar */
@media (max-width: 991.98px) {
    .search-fab.expanded {
        top: 68px !important; /* Below mobile navbar (56px) + spacing (12px) */
    }
}

/* Ensure all child elements of expanded search can receive clicks */
.search-fab.expanded * {
    pointer-events: auto !important;
}

.search-fab.expanded:hover {
    transform: translateX(-50%) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2) !important;
}

/* Hide FAB icon when expanded */
.search-fab.expanded .search-fab-icon {
    display: none !important;
}

/* Search icon (left side) - visible when expanded */
.search-icon-expanded {
    font-size: 22px;
    color: var(--bs-primary);
    flex-shrink: 0;
    display: none;
}

.search-fab.expanded .search-icon-expanded {
    display: block !important;
}

/* Search input - visible when expanded */
.search-fab-input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: none;
    background: transparent;
    font-size: 15px;
    font-weight: 500;
    color: var(--bs-body-color);
    outline: none;
    padding: 0;
    display: none;
}

.search-fab-input::placeholder {
    color: var(--bs-secondary);
    opacity: 0.7;
    font-weight: 400;
}

.search-fab.expanded .search-fab-input {
    display: block !important;
}

/* Close/Clear button (right side) - Inline within search box */
.search-fab-close {
    position: relative;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 18px;
    background: var(--bs-secondary);
    border: none;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    color: #fff;
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    transition: background-color 0.2s ease, transform 0.2s ease;
    pointer-events: auto;
    margin-left: auto;
}

.search-fab.expanded .search-fab-close {
    display: flex !important;
}

.search-fab-close:hover {
    background: var(--bs-danger);
    transform: scale(1.05);
}

.search-fab-close:active {
    transform: scale(0.95);
}

.search-fab-close i {
    font-size: 18px;
    font-weight: 700;
}

/* When search has text, make clear button more prominent */
.search-fab-close.has-text {
    background: var(--bs-danger);
}

.search-fab-close.has-text:hover {
    background: var(--gs-action-danger-hover);
}

/* Pulse animation for close button when text is present */
@keyframes pulse-close {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
}

.search-fab-close.has-text.pulse {
    animation: pulse-close 0.3s ease-in-out;
}

/* Dark mode adjustments for search FAB */
[data-bs-theme="dark"] .search-fab.morphing,
[data-bs-theme="dark"] .search-fab.expanded {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

[data-bs-theme="dark"] .search-fab-close {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

[data-bs-theme="dark"] .search-fab-close:hover {
    background: var(--bs-danger);
}

[data-bs-theme="dark"] .search-fab-close.has-text {
    background: var(--bs-danger);
}

[data-bs-theme="dark"] .search-fab-close.has-text:hover {
    background: var(--gs-alert-danger-text);
}

/* Accessibility */
.search-fab:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .search-fab,
    .search-fab-icon,
    .search-icon-expanded,
    .search-fab-input,
    .search-fab-close {
        transition: none;
    }
}

/* ============================================
   END DELETE MODE BUTTON (WORKOUT DATABASE)
   Appears next to search FAB when delete mode is active
   ============================================ */

.floating-end-delete-button {
    position: absolute;
    right: var(--floating-fab-spacing-right);
    bottom: calc(100% + var(--floating-fab-spacing-bottom));
    width: var(--floating-fab-min-width);
    height: var(--floating-fab-height);
    min-width: var(--floating-fab-min-width);
    padding: 0;
    background: var(--bs-secondary);
    color: white;
    border: none;
    border-radius: var(--floating-fab-border-radius);
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    gap: var(--floating-fab-gap);
    font-size: var(--floating-fab-font-size);
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: width 0.2s ease, background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    white-space: nowrap;
    z-index: 1002;
    pointer-events: auto;
}

/* Show text label on hover/active for better UX */
.floating-end-delete-button:hover,
.floating-end-delete-button:active {
    width: auto;
    min-width: 80px;
    padding: 0 16px;
}

.floating-end-delete-button span {
    display: none;
}

.floating-end-delete-button:hover span,
.floating-end-delete-button:active span {
    display: inline;
}

.floating-end-delete-button:hover {
    background: var(--bs-secondary);
    filter: brightness(0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.floating-end-delete-button:active {
    transform: translateY(0);
}

.floating-end-delete-button i {
    font-size: var(--floating-fab-icon-size);
}

/* Dark mode adjustments */
[data-bs-theme="dark"] .floating-end-delete-button {
    background: var(--gs-gray-100);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

[data-bs-theme="dark"] .floating-end-delete-button:hover {
    background: var(--gs-gray-200);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* Mobile responsive - REMOVED for mobile-first consistency */
/* All delete buttons now use consistent 44px height via CSS variables */
