/**
 * Own Today - Mobile Navigation Styles
 * Bottom navigation bar and slide-up menu
 */

/* Bottom Navigation Bar */
.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 10px 0;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    border-top: 3px solid var(--org-primary, #667eea);
}

.mobile-nav .nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #999;
    padding: 8px;
    transition: all 0.3s ease;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.mobile-nav .nav-item i {
    font-size: 24px;
    margin-bottom: 4px;
    transition: all 0.3s ease;
}

.mobile-nav .nav-item span {
    font-size: 11px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.mobile-nav .nav-item:active {
    transform: scale(0.95);
}

.mobile-nav .nav-item.active {
    color: var(--org-primary, #667eea);
}

.mobile-nav .nav-item.active i {
    transform: scale(1.1);
}

/* Slide-up Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Slide-up Menu */
.mobile-menu {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 30px 30px 0 0;
    max-height: 80vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
}

.mobile-menu-overlay.active .mobile-menu {
    transform: translateY(0);
}

/* Menu Header */
.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 25px 15px;
    border-bottom: 2px solid #f0f0f0;
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

.mobile-menu-header h3 {
    margin: 0;
    font-size: 24px;
    color: var(--org-primary, #667eea);
}

.close-menu {
    background: #f0f0f0;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-menu i {
    font-size: 20px;
    color: #666;
}

.close-menu:active {
    transform: scale(0.9);
    background: #e0e0e0;
}

/* Menu Content */
.mobile-menu-content {
    padding: 10px 15px 30px;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 18px 15px;
    text-decoration: none;
    color: #333;
    border-radius: 15px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.menu-item:active {
    background: linear-gradient(135deg, var(--org-primary, #667eea), var(--org-secondary, #764ba2));
    color: white;
    transform: scale(0.98);
}

.menu-item i {
    font-size: 24px;
    width: 40px;
    color: var(--org-primary, #667eea);
    transition: all 0.3s ease;
}

.menu-item:active i {
    color: white;
}

.menu-item span {
    font-size: 16px;
    font-weight: 600;
}

/* Special styling for sign out */
.menu-item:last-child {
    border-top: 2px solid #f0f0f0;
    margin-top: 15px;
    padding-top: 20px;
}

.menu-item:last-child i {
    color: #ef4444;
}

/* Desktop - Hide Mobile Nav */
@media (min-width: 769px) {
    .mobile-nav {
        display: none;
    }
    
    .mobile-menu-overlay {
        display: none;
    }
    
    body {
        padding-bottom: 20px !important;
    }
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    body {
        padding-bottom: 80px !important;
    }

    .mobile-menu {
        max-height: 85vh;
    }

    .mobile-menu-content {
        padding-bottom: 40px;
    }

    .menu-item {
        padding: 16px 12px;
    }

    .menu-item i {
        font-size: 22px;
        width: 35px;
    }

    .menu-item span {
        font-size: 15px;
    }
}

/* iPhone X and newer - Safe area adjustments */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .mobile-nav {
        padding-bottom: calc(10px + env(safe-area-inset-bottom));
    }

    body {
        padding-bottom: calc(80px + env(safe-area-inset-bottom)) !important;
    }
}

/* Smooth scrolling for menu */
.mobile-menu {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--org-primary, #667eea) #f0f0f0;
}

.mobile-menu::-webkit-scrollbar {
    width: 6px;
}

.mobile-menu::-webkit-scrollbar-track {
    background: #f0f0f0;
}

.mobile-menu::-webkit-scrollbar-thumb {
    background: var(--org-primary, #667eea);
    border-radius: 3px;
}

/* Animation for menu items appearing */
.mobile-menu-overlay.active .menu-item {
    animation: slideInUp 0.3s ease forwards;
    opacity: 0;
}

.mobile-menu-overlay.active .menu-item:nth-child(1) { animation-delay: 0.05s; }
.mobile-menu-overlay.active .menu-item:nth-child(2) { animation-delay: 0.1s; }
.mobile-menu-overlay.active .menu-item:nth-child(3) { animation-delay: 0.15s; }
.mobile-menu-overlay.active .menu-item:nth-child(4) { animation-delay: 0.2s; }
.mobile-menu-overlay.active .menu-item:nth-child(5) { animation-delay: 0.25s; }
.mobile-menu-overlay.active .menu-item:nth-child(6) { animation-delay: 0.3s; }
.mobile-menu-overlay.active .menu-item:nth-child(7) { animation-delay: 0.35s; }
.mobile-menu-overlay.active .menu-item:nth-child(8) { animation-delay: 0.4s; }
.mobile-menu-overlay.active .menu-item:nth-child(9) { animation-delay: 0.45s; }
.mobile-menu-overlay.active .menu-item:nth-child(10) { animation-delay: 0.5s; }
.mobile-menu-overlay.active .menu-item:nth-child(11) { animation-delay: 0.55s; }
.mobile-menu-overlay.active .menu-item:nth-child(12) { animation-delay: 0.6s; }

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Haptic feedback simulation */
@media (hover: none) and (pointer: coarse) {
    .nav-item:active,
    .menu-item:active,
    .close-menu:active {
        transition: transform 0.05s ease;
    }
}
