/* ========================================
   MOBILE NAVIGATION STYLES
   PWA Install + Bottom Nav + Hamburger Menu
   Desert Mountain Healing IOP
   ======================================== */

/* ========================================
   1. PWA INSTALL BANNER
   ======================================== */

#pwa-install-banner {
    position: fixed;
    bottom: -200px;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #D97706 0%, #FBBF24 100%);
    padding: 1rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    transition: bottom 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

#pwa-install-banner.show {
    bottom: 0;
}

.pwa-install-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.pwa-install-icon {
    font-size: 2.5rem;
    animation: bounce 2s infinite;
}

.pwa-install-text {
    flex: 1;
    color: white;
}

.pwa-install-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.pwa-install-subtitle {
    font-size: 0.85rem;
    opacity: 0.9;
}

.pwa-install-btn {
    background: white;
    color: #D97706;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.pwa-install-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.pwa-install-close {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pwa-install-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ========================================
   2. BOTTOM NAVIGATION BAR
   ======================================== */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0.5rem 0 calc(0.5rem + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    border-top: 2px solid #D97706;
    z-index: 1000;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    text-decoration: none;
    color: #6B7280;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 0;
}

.bottom-nav-item i {
    font-size: 1.4rem;
    transition: all 0.3s ease;
}

.bottom-nav-item span {
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.bottom-nav-item:active,
.bottom-nav-item.active {
    color: #D97706;
}

.bottom-nav-item:active i,
.bottom-nav-item.active i {
    transform: scale(1.2);
}

/* Add padding to body when bottom nav is present */
body.has-bottom-nav {
    padding-bottom: 70px;
}

/* ========================================
   3. MOBILE HAMBURGER MENU (SLIDE-OUT)
   ======================================== */

.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    pointer-events: none;
}

.mobile-menu.open {
    pointer-events: auto;
}

.mobile-menu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu.open .mobile-menu-overlay {
    opacity: 1;
}

.mobile-menu-content {
    position: absolute;
    top: 0;
    right: -100%;
    bottom: 0;
    width: 85%;
    max-width: 350px;
    background: linear-gradient(135deg, #FFFBEB 0%, #FED7AA 100%);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
    transition: right 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.mobile-menu.open .mobile-menu-content {
    right: 0;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.25rem;
    background: rgba(255, 255, 255, 0.5);
    border-bottom: 2px solid #D97706;
}

.mobile-menu-logo {
    height: 50px;
    width: auto;
}

.mobile-menu-close {
    background: rgba(217, 119, 6, 0.1);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    color: #D97706;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.mobile-menu-close:active {
    background: rgba(217, 119, 6, 0.2);
    transform: rotate(90deg);
}

.mobile-menu-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 1.25rem;
    background: rgba(255, 255, 255, 0.3);
}

.mobile-menu-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #D97706 0%, #FBBF24 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
}

.mobile-menu-user-info {
    flex: 1;
}

.mobile-menu-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: #92400E;
    margin-bottom: 0.25rem;
}

.mobile-menu-points {
    font-size: 0.9rem;
    color: #D97706;
    font-weight: 600;
}

.mobile-menu-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.mobile-menu-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    text-decoration: none;
    color: #4B5563;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    font-size: 1rem;
}

.mobile-menu-link:active {
    background: rgba(217, 119, 6, 0.1);
    border-left-color: #D97706;
    color: #D97706;
}

.mobile-menu-link i {
    font-size: 1.3rem;
    width: 24px;
    text-align: center;
}

.mobile-menu-divider {
    height: 1px;
    background: rgba(217, 119, 6, 0.2);
    margin: 0.5rem 1.25rem;
}

.mobile-menu-logout {
    color: #EF4444;
}

.mobile-menu-logout:active {
    background: rgba(239, 68, 68, 0.1);
    border-left-color: #EF4444;
}

.mobile-menu-footer {
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.5);
    border-top: 2px solid #D97706;
}

.mobile-menu-crisis {
    font-size: 0.85rem;
    color: #6B7280;
    text-align: center;
}

.mobile-menu-crisis strong {
    display: block;
    color: #EF4444;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.mobile-menu-crisis a {
    color: #EF4444;
    text-decoration: none;
    font-weight: 600;
}

/* Hide staff/provider/admin links by default */
.mobile-menu-staff,
.mobile-menu-provider,
.mobile-menu-admin {
    display: none;
}

/* ========================================
   4. TOAST NOTIFICATIONS
   ======================================== */

.toast-notification {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(16, 185, 129, 0.95);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    font-weight: 600;
    z-index: 10001;
    transition: top 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    max-width: 90%;
    text-align: center;
}

.toast-notification.show {
    top: calc(1rem + env(safe-area-inset-top));
}

/* ========================================
   5. MOBILE-ONLY DISPLAY
   ======================================== */

@media (min-width: 769px) {
    .bottom-nav,
    .mobile-menu,
    #pwa-install-banner {
        display: none !important;
    }
}

/* ========================================
   6. SAFE AREA INSETS (iPhone notch, etc.)
   ======================================== */

@supports (padding: env(safe-area-inset-bottom)) {
    .bottom-nav {
        padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
    }
    
    .mobile-menu-content {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* ========================================
   7. ANIMATIONS
   ======================================== */

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}
