/* Premium Mobile UI/UX Enhancements */

/* Mobile Variables */
@media (max-width: 768px) {
    :root {
        --mobile-spacing: 16px;
        --mobile-radius: 20px;
        --safe-area-inset: env(safe-area-inset-bottom);
    }
}

/* Smooth iOS-style Scrolling */
* {
    -webkit-overflow-scrolling: touch;
    -webkit-tap-highlight-color: transparent;
}

/* Premium Mobile Navigation */
.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    z-index: 1000;
    padding: 0 var(--mobile-spacing);
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-nav.scrolled {
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
}

.mobile-nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

/* Hamburger Menu - Premium Animation */
.hamburger {
    width: 28px;
    height: 28px;
    position: relative;
    cursor: pointer;
    z-index: 1002;
}

.hamburger span {
    display: block;
    position: absolute;
    width: 100%;
    height: 2px;
    background: var(--secondary);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.hamburger span:nth-child(1) {
    top: 6px;
}

.hamburger span:nth-child(2) {
    top: 13px;
}

.hamburger span:nth-child(3) {
    top: 20px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg);
    top: 13px;
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg);
    top: 13px;
}

/* Mobile Menu Overlay */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.mobile-menu-content {
    padding: 80px 30px;
    height: 100%;
    overflow-y: auto;
}

.mobile-menu-list {
    list-style: none;
    padding: 0;
}

.mobile-menu-item {
    margin-bottom: 10px;
    opacity: 0;
    transform: translateY(20px);
    animation: slideInMenu 0.4s forwards;
}

.mobile-menu.active .mobile-menu-item {
    animation-delay: calc(var(--item-index) * 0.1s);
}

.mobile-menu-link {
    display: flex;
    align-items: center;
    padding: 18px 20px;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--secondary);
    text-decoration: none;
    border-radius: 15px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.mobile-menu-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    transition: width 0.3s ease;
    z-index: -1;
}

.mobile-menu-link:active {
    transform: scale(0.98);
}

.mobile-menu-link:hover::before,
.mobile-menu-link.active::before {
    width: 100%;
}

.mobile-menu-link:hover,
.mobile-menu-link.active {
    color: white;
    padding-left: 30px;
}

/* Mobile Search - Premium Style */
.mobile-search {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    padding: 10px var(--mobile-spacing);
    background: linear-gradient(to bottom, rgba(255,255,255,0.98), rgba(255,255,255,0.95));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 998;
    transform: translateY(-100%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

.mobile-search.active {
    transform: translateY(0);
    opacity: 1;
}

.mobile-search-input {
    width: 100%;
    padding: 15px 20px;
    font-size: 16px; /* Prevents zoom on iOS */
    border: 2px solid var(--border);
    border-radius: 15px;
    background: white;
    transition: all 0.3s ease;
}

.mobile-search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.1);
    outline: none;
}

/* Premium Card Design for Mobile */
@media (max-width: 768px) {
    .restaurant-card {
        border-radius: 20px;
        margin-bottom: 20px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        transform-origin: center;
    }
    
    .restaurant-card:active {
        transform: scale(0.98);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
    }
    
    .restaurant-card .card-image {
        height: 180px;
        position: relative;
        overflow: hidden;
    }
    
    .restaurant-card .card-image::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.1) 100%);
    }
    
    .card-content {
        padding: 20px;
    }
    
    .card-badges {
        display: flex;
        gap: 6px;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 5px;
    }
    
    .badge {
        white-space: nowrap;
        flex-shrink: 0;
        padding: 6px 12px;
        font-size: 0.7rem;
        border-radius: 12px;
        font-weight: 700;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }
}

/* Bottom Navigation Bar - Premium Mobile */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(65px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 0.5px solid rgba(0, 0, 0, 0.1);
    z-index: 997;
    padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav-content {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 65px;
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    padding: 5px;
}

.bottom-nav-item i {
    font-size: 1.3rem;
    margin-bottom: 4px;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.bottom-nav-item span {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bottom-nav-item.active {
    color: var(--primary);
}

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

.bottom-nav-item::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 30px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.bottom-nav-item.active::before {
    transform: translateX(-50%) scaleX(1);
}

/* Swipe Gestures Indicator */
.swipe-indicator {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
}

.swipe-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.swipe-dot.active {
    width: 24px;
    border-radius: 4px;
    background: var(--primary);
}

/* Pull to Refresh */
.pull-to-refresh {
    position: fixed;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 996;
}

.pull-to-refresh.visible {
    top: 80px;
}

.pull-to-refresh.refreshing {
    animation: spin 1s linear infinite;
}

.pull-to-refresh i {
    font-size: 1.2rem;
    color: var(--primary);
}

/* Filter Pills - Mobile Optimized */
@media (max-width: 768px) {
    .filters-section {
        position: sticky;
        top: 60px;
        padding: 10px 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        z-index: 990;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }
    
    .filters-wrapper {
        display: flex;
        gap: 10px;
        overflow-x: auto;
        padding: 0 var(--mobile-spacing);
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .filters-wrapper::-webkit-scrollbar {
        display: none;
    }
    
    .filter-group {
        min-width: auto;
        flex: 0 0 auto;
    }
    
    .filter-select {
        padding: 10px 15px;
        border-radius: 25px;
        font-size: 0.9rem;
        font-weight: 600;
        background: linear-gradient(135deg, #f8f8f8, #fff);
        border: 1px solid var(--border);
        white-space: nowrap;
        min-width: 100px;
    }
    
    .filter-select:focus {
        box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
    }
    
    .filter-reset {
        flex: 0 0 auto;
        padding: 10px 20px;
        border-radius: 25px;
        min-width: auto;
    }
}

/* Mobile Modal - Full Screen Premium */
@media (max-width: 768px) {
    .modal-content {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        animation: slideUpMobile 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .modal-close {
        top: 15px;
        right: 15px;
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(10px);
    }
    
    .modal-header {
        height: 250px;
        border-radius: 0 0 30px 30px;
    }
    
    .modal-body {
        padding: 25px 20px;
        padding-bottom: calc(25px + env(safe-area-inset-bottom));
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Touch Feedback */
.touchable {
    transition: all 0.2s ease;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.touchable:active {
    opacity: 0.7;
    transform: scale(0.98);
}

/* Loading Skeleton for Mobile */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 10px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card {
    height: 280px;
    margin-bottom: 20px;
    border-radius: 20px;
}

/* Animations */
@keyframes slideInMenu {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUpMobile {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Haptic Feedback Simulation */
@media (max-width: 768px) {
    button, .touchable, .restaurant-card, .filter-select, .mobile-menu-link {
        position: relative;
    }
    
    button::after,
    .touchable::after,
    .restaurant-card::after,
    .filter-select::after,
    .mobile-menu-link::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 100%;
        height: 100%;
        border-radius: inherit;
        transform: translate(-50%, -50%) scale(0);
        background: radial-gradient(circle, rgba(212, 175, 55, 0.2) 0%, transparent 70%);
        pointer-events: none;
    }
    
    button:active::after,
    .touchable:active::after,
    .restaurant-card:active::after,
    .filter-select:active::after,
    .mobile-menu-link:active::after {
        animation: ripple 0.6s ease-out;
    }
}

@keyframes ripple {
    to {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/* iOS Safe Areas */
@supports (padding: env(safe-area-inset-bottom)) {
    .mobile-menu-content {
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .restaurants-section {
        padding-bottom: calc(100px + env(safe-area-inset-bottom));
    }
}

/* High-end Loading State */
.shimmer-container {
    position: relative;
    overflow: hidden;
}

.shimmer-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Premium Mobile Typography */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.2rem;
        line-height: 1.2;
        font-weight: 900;
        letter-spacing: -0.02em;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        opacity: 0.95;
    }
    
    .section-title {
        font-size: 1.8rem;
        font-weight: 800;
    }
    
    .card-title {
        font-size: 1.2rem;
        font-weight: 700;
        line-height: 1.3;
    }
    
    .card-description {
        font-size: 0.9rem;
        line-height: 1.5;
        color: var(--text-secondary);
    }
}

/* Mobile Responsiveness - Premium Adjustments */
@media (max-width: 768px) {
    .container {
        padding: 0;
    }
    
    .hero {
        min-height: 100vh;
        padding-top: 60px;
    }
    
    .hero-content {
        padding: 40px 20px;
    }
    
    .search-container {
        margin: 0 -5px;
    }
    
    .search-wrapper {
        border-radius: 25px;
        padding: 5px 5px 5px 20px;
    }
    
    .search-input {
        font-size: 1rem;
    }
    
    .search-btn {
        padding: 12px 25px;
        border-radius: 22px;
    }
    
    .hero-stats {
        flex-direction: row;
        justify-content: space-around;
        padding: 15px;
        gap: 0;
        border-radius: 15px;
        margin-top: 30px;
    }
    
    .stat-item {
        text-align: center;
    }
    
    .stat-number {
        font-size: 1.8rem;
    }
    
    .stat-label {
        font-size: 0.7rem;
    }
    
    .navbar {
        display: none;
    }
    
    .mobile-nav {
        display: block;
    }
    
    .bottom-nav {
        display: block;
    }
    
    .featured-section,
    .restaurants-section {
        padding: 20px 0;
    }
    
    .featured-grid,
    .restaurant-grid {
        padding: 0 var(--mobile-spacing);
        gap: 0;
    }
    
    .footer {
        margin-bottom: calc(65px + env(safe-area-inset-bottom));
        padding: 30px 20px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 25px;
    }
}