/* ============================================
   BOTTOM BAR v9.2 — Horizontal Expand Tabs
   
   WHAT CHANGED vs v8.4:
   - Layout: horizontal (icon + text side by side)
   - Inactive tabs: icon only (text hidden)
   - Active tab: pill expands, text appears beside icon
   - Animation: max-width + opacity (GPU-friendly)
   - Press: scale(0.93) with bounce-back
   - NO backdrop-filter (60 FPS guaranteed)
   
   COLORS: DATOUR dark neutral + subtle violet pill
   ============================================ */

.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    
    width: auto;
    
    /* Solid dark — NO backdrop-filter */
    background: rgba(22, 22, 30, 0.95);
    
    /* Capsule shape */
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 100px;
    
    /* Static shadow — not animated */
    box-shadow: 
        0 4px 24px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    
    padding: 6px 8px;
    margin-bottom: max(16px, env(safe-area-inset-bottom));
    
    /* Only for hide/show transitions */
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.bottom-bar-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

/* ============================================
   TAB ITEM — Horizontal: icon left, text right
   ============================================ */

.bottom-bar-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0;
    
    height: 40px;
    padding: 0 12px;
    
    background: transparent;
    border: none;
    border-radius: 100px;
    
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    
    position: relative;
    outline: none;
    
    /* Smooth expand + bounce-back on press release */
    transition: 
        transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
        background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        gap 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   ICON
   ============================================ */

.bottom-bar-icon {
    width: 22px;
    height: 22px;
    min-width: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.38);
    transition: color 0.25s ease;
    font-size: 0;
}

.bottom-bar-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

/* ============================================
   LABEL — Hidden by default, expands on active
   ============================================ */

.bottom-bar-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.88);
    
    /* COLLAPSED by default */
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    
    /* Smooth expand */
    transition:
        max-width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   ACTIVE STATE — Violet pill, icon + text
   ============================================ */

.bottom-bar-item.active {
    background: rgba(255, 255, 255, 0.10);
    gap: 6px;
    padding: 0 16px;
}

.bottom-bar-item.active .bottom-bar-icon {
    color: rgba(255, 255, 255, 0.92);
}

.bottom-bar-item.active .bottom-bar-label {
    max-width: 80px;
    opacity: 1;
}

/* ============================================
   PRESS FEEDBACK — GPU only
   ============================================ */

.bottom-bar-item:not(.disabled):active {
    transform: scale(0.93);
}

/* ============================================
   DISABLED
   ============================================ */

.bottom-bar-item.disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* ============================================
   BADGE
   ============================================ */

.bottom-bar-badge {
    position: absolute;
    top: 2px;
    right: 8px;
    
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    
    background: #EF4444;
    border: 1.5px solid rgba(22, 22, 30, 0.95);
    border-radius: 100px;
    
    font-size: 9px;
    font-weight: 700;
    color: white;
    
    display: flex;
    align-items: center;
    justify-content: center;
    
    animation: badgePop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bottom-bar-badge.hidden {
    display: none;
}

@keyframes badgePop {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

/* ============================================
   KEYBOARD OPEN — slides down
   ============================================ */

body.keyboard-open .bottom-bar,
body.keyboard-visible .bottom-bar {
    transform: translateX(-50%) translateY(calc(100% + 20px));
    opacity: 0;
    pointer-events: none;
}

.bottom-bar.keyboard-open {
    transform: translateX(-50%) translateY(calc(100% + 20px));
    opacity: 0;
    pointer-events: none;
}

/* ============================================
   HIDDEN STATE — for modals & overlays
   ============================================ */

.bottom-bar.hidden {
    transform: translateX(-50%) translateY(200%);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

/* ============================================
   RESPONSIVE — Small screens
   ============================================ */

@media (max-width: 360px) {
    .bottom-bar {
        padding: 5px 6px;
    }
    
    .bottom-bar-item {
        height: 36px;
        padding: 0 10px;
    }
    
    .bottom-bar-item.active {
        padding: 0 14px;
    }
    
    .bottom-bar-icon svg {
        width: 18px;
        height: 18px;
    }
    
    .bottom-bar-label {
        font-size: 11px;
    }
}

/* Issue 1 fix: hide the global bottom-bar on the booking screen.
 * The booking form's last field (remarks) sits under the fixed bottom-bar
 * (position:fixed, z-index:1000), so tap-to-focus lands on the bar instead of
 * the textarea — programmatic .focus() works only because it scrolls the field
 * into view. Hiding the bar here also matches checkout-flow UX: users should
 * complete the booking, not navigate away mid-form. */
#bookingScreen.active ~ .bottom-bar,
body:has(#bookingScreen.active) .bottom-bar {
    display: none;
}
