/* ================= TOAST NOTIFICATION ================= */
.toast-notification {
    position: fixed;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999999;
    background: #0f172a;
    color: #fff;
    padding: 14px 28px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 0.92rem;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    transition: bottom 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

.toast-notification.toast-visible {
    bottom: 40px;
}

.toast-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #22c55e;
    color: #fff;
}

/* ================= MOBILE TOUCH TARGET ENFORCEMENT ================= */
@media (pointer: coarse) {
    button, [role="button"], a.btn, .btn,
    .select-trigger, .tab-btn, .shortcut-btn,
    .bookmark-trigger, .pagination-btn,
    .action-btn, .close-btn, .back-btn {
        min-width: 44px;
        min-height: 44px;
    }

    /* Ensure adequate spacing between tappable items */
    .tabs-container .tab-btn {
        margin: 2px;
    }
}

/* ================= MOBILE BOTTOM SHEET DRAWER ================= */
.mobile-sheet-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 100060;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-sheet-backdrop.active {
    display: block;
    opacity: 1;
}

.mobile-bottom-sheet {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: 20px 20px 0 0;
    z-index: 100070;
    max-height: 90vh;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.mobile-bottom-sheet.active {
    display: block;
    transform: translateY(0);
}

.mobile-bottom-sheet.half-expanded {
    max-height: 50vh;
}

.sheet-drag-handle {
    width: 40px;
    height: 5px;
    background: #cbd5e1;
    border-radius: 3px;
    margin: 10px auto 6px;
    cursor: grab;
}

.sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 20px 12px;
    border-bottom: 1px solid #e2e8f0;
}

.sheet-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
}

.sheet-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sheet-body {
    padding: 16px 20px;
    overflow-y: auto;
    max-height: calc(90vh - 80px);
    -webkit-overflow-scrolling: touch;
}

/* ================= MOBILE FILTER DRAWER ================= */
.mobile-filter-sheet .sheet-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mobile-filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mobile-filter-group label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mobile-filter-group select {
    width: 100%;
    height: 48px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 0 16px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    color: #0f172a;
    background: #fff;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.mobile-filter-apply-btn {
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #0076ff, #004571);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    margin-top: 8px;
    transition: opacity 0.2s ease;
}

.mobile-filter-apply-btn:active {
    opacity: 0.85;
}

/* ================= MOBILE BOTTOM NAVIGATION BAR ================= */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--mobile-nav-height);
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100040;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.mobile-bottom-nav .nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 12px;
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    border: none;
    background: none;
    transition: color 0.2s ease;
    min-width: 56px;
    min-height: 44px;
}

.mobile-bottom-nav .nav-item.active,
.mobile-bottom-nav .nav-item:active {
    color: #0ea5e9;
}

.mobile-bottom-nav .nav-item svg {
    width: 22px;
    height: 22px;
    stroke-width: 2;
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: block;
    }

    /* Add padding at bottom of page content to prevent bottom nav overlap */
    body {
        padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px));
    }

    /* Raise toasts above bottom nav */
    .toast-notification.toast-visible {
        bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px) + 12px);
    }
}

/* ================= MOBILE FILTER TOGGLE BUTTON ================= */
.mobile-filter-btn {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #f1f5f9;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    min-height: 44px;
}

.mobile-filter-btn svg {
    width: 16px;
    height: 16px;
}

.mobile-filter-btn .filter-count {
    background: #0ea5e9;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 8px;
    min-width: 18px;
    text-align: center;
}

@media (max-width: 640px) {
    .mobile-filter-btn {
        display: flex;
    }
}