/**
 * Mobile Navigation Bar Component
 * Modern floating navbar with blur effect + Advanced Search Drawer
 */

/* Mobile Navigation Container */
.mobile-nav-container {
    display: none; /* Hidden on desktop */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    pointer-events: none;
    height: 96px; /* h-24 = 6rem = 96px */
}

.mobile-nav-container * {
    pointer-events: auto;
}

/* Blur Gradient Effect */
.mobile-nav-blur {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 96px; /* h-24 */
    background: linear-gradient(to top, rgba(255,255,255,1) 0%, rgba(255,255,255,0.8) 60%, rgba(255,255,255,0) 100%);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    pointer-events: none;
    z-index: 40;
}

/* The navigation bar itself - Floating rounded pill */
.mobile-nav {
    position: absolute;
    bottom: 20px; /* bottom-5 = 1.25rem = 20px */
    left: 20px;
    right: 20px;
    background: #ffffff;
    border-radius: 9999px; /* fully rounded */
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    padding: 16px 24px; /* py-4 px-6 */
    z-index: 50;
}

.mobile-nav-list {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Navigation Items */
.mobile-nav-item {
    flex: 1;
}

.mobile-nav-item.left {
    display: flex;
    justify-content: flex-start;
    padding-left: 8px; /* pl-2 */
}

.mobile-nav-item.right {
    display: flex;
    justify-content: flex-end;
    padding-right: 8px; /* pr-2 */
}

.mobile-nav-item.center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: -24px; /* -top-6 = -1.5rem = -24px */
    flex: 0;
}

/* Navigation Links */
.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 12px; /* gap-3 */
    text-decoration: none;
    color: #9ca3af; /* gray-400 */
    transition: all 0.3s ease;
    position: relative;
}

.mobile-nav-link:hover {
    color: #000000;
}

.mobile-nav-link.active {
    color: #000000;
}

/* Icon Wrapper with hover animation */
.mobile-nav-icon-wrapper {
    position: relative;
    transition: transform 0.3s ease;
}

.mobile-nav-link:hover .mobile-nav-icon-wrapper {
    transform: translateY(-4px); /* -translate-y-1 */
}

/* Center Account Button (Circle) */
.mobile-nav-link.center-btn {
    display: block;
    width: 56px; /* w-14 = 3.5rem = 56px */
    height: 56px; /* h-14 */
    position: relative;
}

.mobile-nav-circle-bg {
    position: absolute;
    inset: 0;
    background: #000000;
    border-radius: 50%;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 4px solid #ffffff; /* ring-4 ring-white */
    transition: transform 0.2s ease;
}

.mobile-nav-link.center-btn:active .mobile-nav-circle-bg {
    transform: scale(0.95);
}

.mobile-nav-circle-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    z-index: 10;
}

/* Icons */
.mobile-nav-icon {
    width: 24px;
    height: 24px;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    stroke: currentColor;
}

/* Pulsing Notification Dot */
.mobile-nav-notification {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: #000000;
    border-radius: 50%;
    border: 2px solid #ffffff;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ============================================
   MOBILE SEARCH DRAWER STYLES
   ============================================ */

/* Hide scrollbar utility */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Overlay */
.mobile-search-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0);
    z-index: 9990;
    transition: opacity 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.mobile-search-overlay.overlay-hidden {
    opacity: 0;
    pointer-events: none;
}

.mobile-search-overlay.overlay-visible {
    opacity: 1;
    pointer-events: auto;
}

/* Search Drawer (Bottom Sheet) */
.mobile-search-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9995;
    background-color: #ffffff;
    border-radius: 16px 16px 0 0;
    height: 65vh;
    display: flex;
    flex-direction: column;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
}

.mobile-search-drawer.drawer-hidden {
    transform: translateY(100%);
}

.mobile-search-drawer.drawer-visible {
    transform: translateY(0);
}

/* Drag Handle Area */
.drag-handle-area {
    touch-action: none;
}

/* Search Header */
.mobile-search-header {
    flex: none;
    padding: 12px 20px 8px;
}

.mobile-search-drag-handle {
    width: 48px;
    height: 6px;
    background-color: #e5e7eb;
    border-radius: 9999px;
    margin: 0 auto 16px;
}

/* Search Input Container */
.mobile-search-input-container {
    position: relative;
    width: 100%;
}

.mobile-search-icon-left {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 12px;
    display: flex;
    align-items: center;
    pointer-events: none;
}

.mobile-search-icon {
    width: 20px;
    height: 20px;
    color: #9ca3af;
}

.mobile-search-field {
    width: 100%;
    padding: 12px 40px;
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    color: #000000;
    font-size: 16px;
    appearance: none;
    -webkit-appearance: none;
}

.mobile-search-field::placeholder {
    color: #9ca3af;
}

.mobile-search-field:focus {
    outline: none;
    border-color: #9ca3af;
}

.mobile-search-clear-btn {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 12px;
    display: flex;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: opacity 0.2s ease;
}

.mobile-search-clear-btn.hidden {
    display: none;
}

.mobile-search-clear-btn.visible {
    display: flex;
}

/* Results Container */
.mobile-search-results-container {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px 8px;
}

/* Empty State */
.mobile-search-empty-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 160px;
    margin-top: 16px;
    text-align: center;
}

.mobile-search-empty-state.flex {
    display: flex;
}

.mobile-search-empty-state.hidden {
    display: none;
}

.mobile-empty-icon-wrapper {
    background-color: #f9fafb;
    border-radius: 9999px;
    padding: 16px;
    margin-bottom: 12px;
}

.mobile-empty-icon {
    width: 32px;
    height: 32px;
    color: #d1d5db;
}

.mobile-empty-title {
    color: #111827;
    font-weight: 500;
    margin: 0;
}

.mobile-empty-subtitle {
    color: #9ca3af;
    font-size: 14px;
    margin: 4px 0 0;
}

/* Results List */
.mobile-search-results-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Result Card */
.mobile-search-result-card {
    padding: 16px 0;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.mobile-search-result-card:active {
    background-color: #f9fafb;
}

.mobile-result-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.mobile-result-text {
    flex: 1;
}

.mobile-result-title {
    color: #000000;
    font-weight: 600;
    font-size: 16px;
    margin: 0 0 4px;
}

.mobile-match-highlight {
    color: #000000;
    font-weight: 800;
}

.mobile-result-meta {
    display: flex;
    align-items: center;
    margin-top: 4px;
}

.mobile-result-category {
    background-color: #f3f4f6;
    color: #4b5563;
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 8px;
    letter-spacing: 0.05em;
}

.mobile-result-source {
    font-size: 12px;
    color: #9ca3af;
}

.mobile-result-price {
    font-size: 12px;
    color: #059669;
    font-weight: 600;
    margin-left: 8px;
}

.mobile-result-arrow {
    margin-left: 12px;
}

.mobile-arrow-icon {
    width: 16px;
    height: 16px;
    color: #d1d5db;
    transform: rotate(-45deg);
}

/* Quick Links Section */
.mobile-search-quick-links {
    flex: none;
    background-color: #ffffff;
    border-top: 1px solid #f3f4f6;
    padding: 16px 20px 32px;
}

.mobile-quick-links-title {
    font-size: 12px;
    font-weight: 700;
    color: #111827;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 12px;
}

.mobile-quick-links-scroll {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding-bottom: 4px;
}

.mobile-quick-link-btn {
    flex-shrink: 0;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #000000;
    background-color: #ffffff;
    cursor: pointer;
    transition: background-color 0.15s ease;
    white-space: nowrap;
}

.mobile-quick-link-btn:active {
    background-color: #f9fafb;
}

/* Show only on mobile devices */
@media (max-width: 768px) {
    .mobile-nav-container {
        display: block;
    }
    
    /* Add padding to body to prevent content from being hidden behind nav */
    body {
        padding-bottom: 100px;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .mobile-nav {
        bottom: 16px;
        left: 16px;
        right: 16px;
        padding: 14px 20px;
    }
    
    .mobile-nav-icon {
        width: 22px;
        height: 22px;
    }
    
    .mobile-nav-link.center-btn {
        width: 52px;
        height: 52px;
    }
    
    .mobile-nav-item.center {
        top: -22px;
    }
    
    .mobile-search-drawer {
        height: 70vh;
    }
    
    .mobile-search-field {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

