/* ===================================
   Halal Yalla - Mobile-First Redesign
   New hamburger menu, bottom nav, improved UX
   =================================== */

/* Override existing header for mobile-first design */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--text-white);
    padding: var(--space-md);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: var(--space-md);
    text-align: left !important;
}

.header::before {
    display: none;
}

.header-content {
    display: none;
}

/* Hamburger Button */
.hamburger-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    transition: all var(--transition-normal);
    flex-shrink: 0;
}

.hamburger-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.hamburger-btn.active {
    background: rgba(255, 255, 255, 0.3);
}

.hamburger-icon {
    width: 20px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: all var(--transition-normal);
}

.hamburger-btn.active .hamburger-icon:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger-btn.active .hamburger-icon:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active .hamburger-icon:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Header Center */
.header-center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    min-width: 0;
}

.logo {
    display: flex !important;
    align-items: center;
    gap: var(--space-sm);
    flex-shrink: 0;
    margin-bottom: 0 !important;
    justify-content: flex-start !important;
}

.logo-svg {
    display: block !important;
    flex-shrink: 0;
}

.logo-icon {
    font-size: var(--font-2xl) !important;
}

.logo-text {
    font-size: var(--font-lg) !important;
    font-weight: 700;
}

/* City Selector */
.city-selector {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
    padding: 0;
    background: transparent;
    border: none;
}

.city-selector-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.city-label {
    display: none;
}

.city-icon {
    display: none;
}

.city-select {
    background: linear-gradient(135deg, #FFB800 0%, #FFA000 100%);
    border: none;
    color: white;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    padding: 8px 36px 8px 12px;
    border-radius: 8px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: linear-gradient(135deg, #FFB800 0%, #FFA000 100%), url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat, no-repeat;
    background-position: center, right 10px center;
    background-size: auto, 14px;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(255, 168, 0, 0.3);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    min-width: 140px;
}

.city-select:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(255, 168, 0, 0.4);
}

.city-select:active {
    transform: translateY(0);
}

.city-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 168, 0, 0.3);
}

.city-select option {
    background: var(--primary);
    color: white;
    padding: var(--space-sm);
}

/* Header Actions */
.header-actions {
    display: none;
}

.header-btn {
    display: none !important;
}

.user-menu {
    display: none !important;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: white;
    box-shadow: var(--shadow-xl);
    z-index: 2000;
    transition: left var(--transition-normal);
    display: flex;
    flex-direction: column;
}

.sidebar.active {
    left: 0;
}

.sidebar-header {
    padding: var(--space-lg);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-header h3 {
    font-size: var(--font-xl);
    font-weight: 700;
}

.sidebar-close {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.sidebar-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.sidebar-nav {
    flex: 1;
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.sidebar-nav-btn {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-lg);
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: var(--font-base);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: left;
}

.sidebar-nav-btn:hover {
    background: var(--bg-light);
}

.sidebar-nav-btn.active {
    background: var(--primary-alpha);
    color: var(--primary);
    font-weight: 600;
}

.sidebar-nav-icon {
    font-size: var(--font-2xl);
    width: 32px;
    text-align: center;
}

.sidebar-nav-label {
    flex: 1;
}

/* Sidebar Footer - positioned at bottom */
.sidebar-footer {
    margin-top: auto;
    padding: var(--space-lg);
}

.sidebar-uvp {
    margin-bottom: var(--space-lg);
}

.sidebar-tagline {
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.sidebar-description {
    font-size: var(--font-xs);
    color: var(--text-secondary);
    line-height: 1.5;
}

.sidebar-meta {
    margin-bottom: var(--space-md);
}

.sidebar-cities {
    font-size: var(--font-xs);
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

.sidebar-version {
    font-size: var(--font-xs);
    color: var(--text-muted);
    font-weight: 600;
}

/* Sidebar User Section */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    margin-bottom: var(--space-sm);
}

.sidebar-user-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: var(--primary-alpha);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-2xl);
    flex-shrink: 0;
}

.sidebar-user-avatar.logged-in {
    background: var(--primary);
    color: white;
    font-size: var(--font-lg);
    font-weight: 700;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: var(--font-base);
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-email {
    font-size: var(--font-xs);
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-divider {
    height: 1px;
    background: var(--bg-light);
    margin: var(--space-md) var(--space-md);
}

.sidebar-menu {
    padding: 0 var(--space-md);
}

.sidebar-menu-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: var(--font-base);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: left;
    width: 100%;
    margin-bottom: var(--space-sm);
}

.sidebar-menu-item:hover {
    background: var(--bg-light);
}

.sidebar-menu-item span {
    font-size: var(--font-lg);
}

.sidebar-menu-item.hidden {
    display: none;
}

/* Sidebar Footer - push to bottom */
.sidebar-footer {
    margin-top: auto;
    padding: var(--space-lg);
    padding-bottom: calc(var(--space-xl) + 80px); /* Extra space for bottom nav + comfortable padding */
    border-top: 1px solid var(--bg-light);
}

.sidebar-uvp {
    margin-bottom: var(--space-lg);
}

.sidebar-tagline {
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.sidebar-description {
    font-size: var(--font-xs);
    color: var(--text-secondary);
    line-height: 1.6;
}

.sidebar-meta {
    margin-bottom: var(--space-md);
}

.sidebar-cities {
    font-size: var(--font-xs);
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

.sidebar-version {
    font-size: var(--font-xs);
    color: var(--text-muted);
    font-weight: 600;
}

.sidebar-made-with-love {
    font-size: var(--font-xs);
    color: var(--text-secondary);
    padding-top: var(--space-md);
    border-top: 1px solid var(--bg-light);
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1500;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Hide old navigation */
.nav {
    display: none !important;
}

/* Mobile Section Optimizations */
/* Map Section */
.map-section {
    padding-bottom: calc(70px + env(safe-area-inset-bottom)); /* Bottom nav height + safe area */
    height: calc(100vh - 72px); /* Full height minus header */
}

#map {
    height: 100%;
    width: 100%;
}

/* Card Generator Section */
.card-section {
    padding: var(--space-lg) var(--space-md);
    padding-bottom: calc(70px + var(--space-xl) + env(safe-area-inset-bottom));
    min-height: calc(100vh - 72px);
}

.card-generator {
    max-width: 100%;
    padding: var(--space-md);
}

.dietary-card {
    margin: var(--space-lg) auto;
    touch-action: manipulation;
}

/* Qibla Section */
.qibla-section {
    padding: var(--space-xl) var(--space-md);
    padding-bottom: calc(70px + var(--space-xl) + env(safe-area-inset-bottom));
    min-height: calc(100vh - 72px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.compass-container {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    touch-action: none; /* Prevent accidental scrolling during compass use */
}

/* Saved Places Section */
.saved-section {
    padding: var(--space-lg) var(--space-md);
    padding-bottom: calc(70px + var(--space-xl) + env(safe-area-inset-bottom));
    min-height: calc(100vh - 72px);
}

.saved-places-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

/* Place Panel Mobile */
.place-panel {
    left: var(--space-md);
    right: var(--space-md);
    bottom: calc(70px + var(--space-md) + env(safe-area-inset-bottom)); /* Above bottom nav */
    max-width: 100%;
    border-radius: var(--radius-xl);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Pull to refresh indicator area */
.main-content {
    overscroll-behavior-y: contain; /* Native pull-to-refresh feel */
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: var(--space-sm) 0 calc(var(--space-sm) + env(safe-area-inset-bottom)); /* Safe area for notched devices */
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 999;
    border-top: 1px solid var(--bg-light);
}

.bottom-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: var(--space-xs) var(--space-sm);
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); /* Smooth easing */
    flex: 1;
    max-width: 100px;
    position: relative;
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on iOS */
    touch-action: manipulation; /* Faster touch response */
    min-height: 56px; /* Minimum touch target size (iOS/Android standard) */
}

/* Active tap feedback */
.bottom-nav-btn:active {
    transform: scale(0.95);
}

.bottom-nav-btn:hover {
    color: var(--primary);
}

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

/* Active indicator - native iOS style */
.bottom-nav-btn.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 3px 3px;
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(-3px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.bottom-nav-icon {
    font-size: 24px; /* Slightly larger for better visibility */
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Icon bounces on active */
.bottom-nav-btn.active .bottom-nav-icon {
    animation: iconBounce 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes iconBounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
}

.bottom-nav-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: capitalize;
    margin-top: 2px;
    letter-spacing: 0.3px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.bottom-nav-btn.active .bottom-nav-label {
    font-weight: 700;
}

/* Main Content Adjustments */
.main-content {
    padding-bottom: 0 !important; /* Removed - handled by individual sections */
}

/* Mobile Touch Optimizations */
* {
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight globally */
}

/* Smooth scrolling for mobile */
html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch; /* Momentum scrolling on iOS */
}

/* Better button touch targets */
.btn,
.btn-primary,
.btn-secondary,
.sidebar-nav-btn,
.sidebar-menu-item {
    min-height: 44px; /* iOS/Android minimum touch target */
    min-width: 44px;
    touch-action: manipulation; /* Faster touch response */
}

/* Active touch feedback for buttons */
.btn:active,
.btn-primary:active,
.btn-secondary:active {
    transform: scale(0.97);
    transition: transform 0.1s ease;
}

/* Mobile-optimized modals */
.modal {
    -webkit-overflow-scrolling: touch; /* Smooth scrolling in modals */
}

.modal-content {
    overscroll-behavior: contain; /* Prevent scroll chaining */
}

/* Place cards - swipe-friendly spacing */
.place-card {
    margin-bottom: var(--space-md);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    touch-action: manipulation;
}

.place-card:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Place panel - native drawer behavior */
.place-panel {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    overscroll-behavior: contain;
}

.place-panel.active {
    animation: slideUpPanel 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUpPanel {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Input fields - mobile friendly */
input,
select,
textarea {
    font-size: 16px; /* Prevents iOS zoom on focus */
    touch-action: manipulation;
}

/* Hamburger menu - better touch target */
.hamburger-btn {
    min-width: 48px;
    min-height: 48px;
    padding: var(--space-md);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.hamburger-btn:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.3);
}

/* Sidebar - smooth slide animation */
.sidebar {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-100%);
    overscroll-behavior: contain;
}

.sidebar.active {
    transform: translateX(0);
}

/* Map markers - better touch feedback */
.leaflet-marker-icon {
    transition: transform 0.2s ease;
}

.leaflet-marker-icon:active {
    transform: scale(1.1);
}

/* Card generator buttons - native feel */
.card-actions button {
    min-height: 48px;
    touch-action: manipulation;
}

.card-actions button:active {
    transform: scale(0.97);
}

/* Footer Adjustments */
.footer {
    display: none; /* Hidden on mobile - unnecessary with bottom nav */
    padding-bottom: calc(var(--space-xl) + env(safe-area-inset-bottom)); /* Safe area padding */
}

@media (min-width: 769px) {
    .main-content {
        padding-bottom: var(--space-2xl);
    }
    
    .footer {
        display: block;
        padding-bottom: 0 !important;
    }
}

/* Hide "Made with love" from footer on mobile - it's in the sidebar now */
.footer p:first-child {
    display: none;
}

/* Modal Adjustments for Mobile */
.modal {
    padding: var(--space-md);
    align-items: flex-end; /* Bottom sheet style on mobile */
    z-index: 2500 !important; /* Above bottom nav (999) and sidebar (2000) */
}

.modal-content {
    width: 100% !important;
    max-width: 100% !important;
    max-height: calc(100vh - 100px) !important; /* Leave room for close gesture */
    margin: 0;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0 !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-content.modal-large {
    max-width: 100% !important;
}

.modal-content.modal-small {
    max-width: 100% !important;
}

/* Ensure modal content scrolls properly */
.auth-container,
.submit-container {
    padding: var(--space-xl) var(--space-lg) var(--space-2xl) var(--space-lg) !important;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Hero Section - Hide on mobile */
.hero {
    display: none;
}

/* Detail Card Full Width */
.detail-card-full {
    grid-column: 1 / -1;
}

.detail-address {
    font-size: var(--font-sm);
    line-height: 1.6;
}

/* Place Panel Adjustments */
.place-panel {
    max-height: calc(100vh - 140px); /* Account for header + bottom nav */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

.place-panel.active {
    bottom: 60px; /* Above bottom nav */
}

.panel-content {
    padding: var(--space-xl) var(--space-lg) var(--space-2xl) var(--space-lg) !important; /* Extra bottom padding */
    max-width: 100%;
    overflow-x: hidden;
}

/* Ensure long text wraps properly */
.place-name-local,
.detail-value,
.place-description {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* User Menu */
.user-menu {
    position: absolute;
    top: 60px;
    right: var(--space-md);
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 250px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
    z-index: 1001;
}

.user-menu.active {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

.user-info {
    padding: var(--space-md);
    border-bottom: 1px solid var(--bg-light);
}

.user-name {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.user-email {
    display: block;
    font-size: var(--font-sm);
    color: var(--text-muted);
}

.menu-divider {
    height: 1px;
    background: var(--bg-light);
}

.menu-item {
    width: 100%;
    padding: var(--space-md);
    border: none;
    background: transparent;
    text-align: left;
    color: var(--text-primary);
    font-size: var(--font-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    transition: background var(--transition-fast);
}

.menu-item:hover {
    background: var(--bg-light);
}

.menu-item:first-of-type {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.menu-item:last-of-type {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Responsive Adjustments */
@media (min-width: 768px) {
    .header-center {
        justify-content: flex-start;
        padding-left: var(--space-lg);
    }
    
    .logo-text {
        font-size: var(--font-xl) !important;
    }
    
    .sidebar {
        width: 320px;
        left: -320px;
    }
    
    .place-panel {
        max-width: 500px;
        left: 50%;
        transform: translateX(-50%);
        max-height: calc(100vh - 160px);
    }
    
    .place-panel.active {
        bottom: 60px;
    }
    
    /* Tablet Modal - Centered with max-width */
    .modal {
        align-items: center;
        padding: var(--space-lg);
    }
    
    .modal-content {
        max-width: 500px !important;
        border-radius: var(--radius-xl) !important;
        max-height: 85vh !important;
    }
    
    .auth-container,
    .submit-container {
        max-height: calc(85vh - 80px);
    }
}

@media (min-width: 1024px) {
    /* Desktop Header Layout */
    .header {
        padding: var(--space-lg) var(--space-xl) !important;
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        gap: var(--space-xl);
    }
    
    .hamburger-btn {
        order: 3; /* Move to right side */
        margin-left: auto;
    }
    
    .header-center {
        order: 1;
        flex: 1;
        justify-content: flex-start;
        padding-left: 0;
        gap: var(--space-xl);
    }
    
    .logo {
        margin-right: var(--space-lg);
    }
    
    .logo-text {
        font-size: var(--font-2xl) !important;
    }
    
    .city-selector {
        background: rgba(255, 255, 255, 0.25);
        padding: 8px 16px;
        border: 1px solid rgba(255, 255, 255, 0.3);
    }
    
    .city-select {
        font-size: var(--font-base);
    }
    
    /* Desktop Sidebar - keep it available */
    .sidebar {
        display: flex !important;
        width: 360px; /* Slightly wider for desktop */
    }
    
    /* Hide mobile bottom nav only */
    .bottom-nav {
        display: none;
    }
    
    /* Show and style desktop navigation */
    .nav {
        display: flex !important;
        position: sticky;
        top: 72px;
        justify-content: center;
        gap: var(--space-md);
        padding: var(--space-lg) var(--space-xl);
        background: white;
        z-index: 100;
        box-shadow: 0 2px 8px rgba(0,0,0,0.05);
        border-bottom: 1px solid var(--bg-light);
    }
    
    .nav-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: var(--space-xs);
        padding: var(--space-md) var(--space-xl);
        border-radius: var(--radius-lg);
        background: transparent;
        border: none;
        color: var(--text-secondary);
        cursor: pointer;
        transition: all var(--transition-fast);
        position: relative;
        min-width: 100px; /* Consistent button width */
    }
    
    .nav-btn::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%) scaleX(0);
        width: 40px;
        height: 3px;
        background: var(--primary);
        border-radius: 2px;
        transition: transform var(--transition-normal);
    }
    
    .nav-btn:hover {
        color: var(--primary);
        background: var(--primary-alpha);
        transform: translateY(-2px); /* Subtle lift effect */
    }
    
    .nav-btn.active {
        color: var(--primary);
        font-weight: 600;
        background: var(--primary-alpha);
    }
    
    .nav-btn.active::after {
        transform: translateX(-50%) scaleX(1);
    }
    
    .nav-icon {
        font-size: var(--font-2xl);
    }
    
    .nav-label {
        font-size: var(--font-sm);
        font-weight: 500;
        letter-spacing: 0.3px;
    }
    
    /* Desktop Map Container - Optimize for larger screens */
    .map-section {
        position: relative;
        height: calc(100vh - 160px); /* Account for header + nav + some padding */
        min-height: 600px;
    }
    
    #map {
        height: 100%;
        border-radius: var(--radius-lg); /* Rounded corners for desktop */
        margin: 0 var(--space-lg);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    
    /* Desktop Place Panel - Better width and positioning */
    .place-panel {
        max-width: 480px; /* Wider for better readability */
        max-height: calc(100vh - 200px); /* Account for header + desktop nav */
        right: var(--space-xl); /* More spacing from edge */
        bottom: var(--space-xl);
        border-radius: var(--radius-xl);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    }
    
    .place-panel.active {
        bottom: var(--space-xl); /* Maintain spacing */
    }
    
    /* Desktop Card Generator - Better layout */
    .card-section {
        max-width: 1200px;
        margin: 0 auto;
        padding: var(--space-xl);
    }
    
    .card-generator {
        max-width: 800px;
        margin: 0 auto;
        padding: var(--space-xl);
    }
    
    .dietary-card {
        max-width: 600px;
        margin: 0 auto;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    }
    
    /* Desktop Qibla Section - Centered and spacious */
    .qibla-section {
        max-width: 800px;
        margin: 0 auto;
        padding: var(--space-2xl);
    }
    
    .compass-container {
        max-width: 400px;
        margin: 0 auto;
    }
    
    /* Desktop Saved Places - Grid layout */
    .saved-section {
        max-width: 1400px;
        margin: 0 auto;
        padding: var(--space-xl);
    }
    
    .saved-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
        gap: var(--space-lg);
        padding: var(--space-lg);
    }
    
    /* Content spacing */
    .main-content {
        padding-bottom: var(--space-xl);
    }
    
    .footer {
        padding: var(--space-xl) var(--space-2xl) !important;
        max-width: 1400px;
        margin: 0 auto;
    }
    
    /* Hide "Made with love" from sidebar on desktop - it's in the footer */
    .sidebar-made-with-love {
        display: none;
    }
    
    /* Show "Made with love" in footer on desktop */
    .footer p:first-child {
        display: block;
    }
    
    /* Desktop Modal - Standard centered dialog */
    .modal {
        align-items: center;
        padding: var(--space-xl);
    }
    
    .modal-content {
        max-width: 600px !important;
        border-radius: var(--radius-xl) !important;
        max-height: 90vh !important;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    }
    
    .modal-content.modal-large {
        max-width: 700px !important;
    }
    
    .modal-content.modal-small {
        max-width: 400px !important;
    }
    
    .auth-container,
    .submit-container {
        padding: var(--space-xl) !important;
        max-height: calc(90vh - 100px);
    }
    
    /* Desktop Search and Filters */
    .search-container,
    .filter-container {
        max-width: 1400px;
        margin: 0 auto;
        padding: var(--space-lg) var(--space-xl);
    }
    
    /* Desktop Typography Improvements */
    h1 {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    h2 {
        font-size: 2rem;
        line-height: 1.3;
    }
    
    h3 {
        font-size: 1.5rem;
        line-height: 1.4;
    }
    
    /* Desktop Button Hover Effects */
    .btn:hover,
    .btn-primary:hover,
    .btn-secondary:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(46, 139, 87, 0.3);
    }
}

@media (min-width: 1280px) {
    .header {
        padding: var(--space-lg) var(--space-2xl) !important;
    }
    
    .nav {
        padding: var(--space-lg) var(--space-2xl);
    }
    
    .nav-btn {
        padding: var(--space-lg) var(--space-2xl);
    }
}

/* ===== Logo SVG Styling ===== */
.logo-svg {
    display: block;
    flex-shrink: 0;
}

/* ===== Invite Code & Disclaimer Modal ===== */
.invite-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
}

.invite-modal.hidden {
    display: none;
}

.invite-modal-content {
    background: white;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.4s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.invite-header {
    text-align: center;
    padding: 2rem 2rem 1.5rem;
    border-bottom: 1px solid var(--bg-light);
}

.invite-logo {
    margin: 0 auto 1rem;
    display: block;
}

.invite-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.invite-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
    background: var(--primary-alpha);
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    display: inline-block;
    font-weight: 600;
}

.invite-section {
    padding: 2rem;
}

.invite-section.hidden {
    display: none;
}

.invite-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.invite-section p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.invite-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--bg-light);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
    margin-bottom: 1rem;
}

.invite-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-alpha);
}

.invite-btn {
    width: 100%;
    padding: 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.invite-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.invite-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.invite-error {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    min-height: 1.25rem;
}

.disclaimer-content {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    max-height: 300px;
    overflow-y: auto;
}

.disclaimer-content p {
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

.disclaimer-content ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 1rem;
}

.disclaimer-content li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    line-height: 1.6;
    position: relative;
    padding-left: 1.5rem;
}

.disclaimer-content li::before {
    content: '•';
    position: absolute;
    left: 0.5rem;
    color: var(--primary);
    font-weight: bold;
}

.disclaimer-content a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.disclaimer-content a:hover {
    text-decoration: underline;
}

.disclaimer-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    cursor: pointer;
}

.disclaimer-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: var(--primary);
}

.disclaimer-checkbox span {
    color: var(--text-secondary);
    line-height: 1.6;
    user-select: none;
}

@media (max-width: 480px) {
    .invite-modal-content {
        max-width: calc(100vw - 2rem);
    }
    
    .invite-header,
    .invite-section {
        padding: 1.5rem;
    }
    
    .disclaimer-content {
        max-height: 200px;
    }
    
    /* Extra small screens - optimize spacing */
    .header {
        padding: var(--space-md) !important;
    }
    
    .logo-text {
        font-size: var(--font-lg) !important;
    }
    
    .bottom-nav-label {
        font-size: 9px;
    }
    
    .place-panel {
        left: var(--space-sm);
        right: var(--space-sm);
    }
}

/* ===== Mobile Section Transitions & Animations ===== */
/* Smooth fade-in for sections */
.map-section,
.card-section,
.qibla-section,
.saved-section {
    opacity: 0;
    animation: fadeInSection 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

/* Hide non-active sections on mobile */
@media (max-width: 1023px) {
    .map-section,
    .card-section,
    .qibla-section,
    .saved-section {
        display: none;
    }
    
    .map-section.active,
    .card-section.active,
    .qibla-section.active,
    .saved-section.active {
        display: block;
    }
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid var(--bg-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Haptic-like feedback for interactions */
@media (hover: none) and (pointer: coarse) {
    /* Only on touch devices */
    .bottom-nav-btn:active,
    .btn:active,
    .place-card:active {
        transition: transform 0.05s ease;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .bottom-nav-btn.active::before,
    .bottom-nav-btn.active .bottom-nav-icon {
        animation: none !important;
    }
