/* Force light mode across all browsers and prevent dark mode */
:root {
    color-scheme: light only;
}

html {
    color-scheme: light only;
}

body {
    font-family: 'TikTok Sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

/* Heading styles with TikTok Sans font */
h1, h2, h3, h4, h5, h6 {
    font-family: 'TikTok Sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    font-weight: 700;
}

/* All your existing styles go here */
html, body { 
    margin: 0; 
    padding: 0; 
    overflow: hidden; /* Prevent body scroll */
    background-color: #f3f4f6 !important; /* Force light background */
    color: #111827 !important; /* Force dark text */
}
#map { 
    height: 100%; 
    width: 100%; 
    background-color: #e5e7eb;
}

/* Force light mode scrollbars and prevent dark mode interference */
::-webkit-scrollbar {
    background-color: #f1f5f9 !important;
}

::-webkit-scrollbar-thumb {
    background-color: #cbd5e1 !important;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #94a3b8 !important;
}

/* Prevent any dark mode media queries from overriding */
@media (prefers-color-scheme: dark) {
    :root, html, body {
        color-scheme: light only !important;
        background-color: #f3f4f6 !important;
        color: #111827 !important;
    }
}

/* Dashboard-specific styles */
.dashboard-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.tools-section, .map-section {
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

#map {
    height: 500px;
    width: 100%;
    border-radius: 8px;
}

/* Restaurant card styles */
.restaurant-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.restaurant-card h3 {
    margin: 0 0 0.5rem 0;
    color: #111827;
}

.restaurant-card p {
    margin: 0.25rem 0;
    color: #6b7280;
    font-size: 0.875rem;
}

.restaurant-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
}

.restaurant-actions button {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-edit {
    background-color: #3b82f6;
    color: white;
    border: none;
}

.btn-edit:hover {
    background-color: #2563eb;
}

.btn-delete {
    background-color: #ef4444;
    color: white;
    border: none;
}

.btn-delete:hover {
    background-color: #dc2626;
}
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
}


.custom-scrollbar::-webkit-scrollbar-track {
    background: #f3f4f6;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #9ca3af;
    border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

#video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* prevent scrollbars on modal */
    padding: 1rem;
}
/* Hide modal scrollbar in all browsers */
#video-modal { -ms-overflow-style: none; scrollbar-width: none; }
#video-modal::-webkit-scrollbar { display: none; }
#video-modal.show {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}
.modal-content-wrapper {
    position: relative;
    /* Adjust top for slight upward shift on mobile */
    top: -20px; /* This moves the video player up by 20px */
}

/* Video Header Container */
.video-header-container {
    position: relative;
    z-index: 10;
}

/* Video Header Styles */
.video-header {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 16px 16px 0 0;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    margin-bottom: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    width: 330px;
    max-width: 330px;
    position: relative;
    min-height: 60px;
    box-sizing: border-box;
}

.video-header-left {
    flex: 1;
    min-width: 0;
}

.video-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.video-restaurant-name {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
    font-family: 'TikTok Sans', sans-serif;
    flex-shrink: 1;
}

.video-header-actions {
    display: flex;
    gap: 8px;
}

.video-action-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 50%;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af; /* Same default gray as restaurant card buttons */
    width: 36px;
    height: 36px;
}

.video-action-btn:hover {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Favorite button specific styles to match restaurant cards */
.video-action-btn#video-favorite-btn:hover {
    color: #f59e0b; /* Yellow on hover */
}

.video-action-btn#video-favorite-btn.favorited {
    color: #f59e0b; /* Filled yellow color */
    background: rgba(245, 158, 11, 0.1);
}

.video-action-btn#video-favorite-btn.favorited svg {
    fill: #f59e0b;
    stroke: #f59e0b;
}

/* Collection button specific styles to match restaurant cards */
.video-action-btn#video-collection-btn:hover {
    color: #6366f1; /* Purple color on hover */
    background-color: rgba(99, 102, 241, 0.1);
    border-color: #6366f1;
}

.video-action-btn#video-collection-btn.collected {
    color: #6366f1; /* Purple color when collected */
    background: rgba(99, 102, 241, 0.1);
}

.video-action-btn#video-collection-btn.collected svg {
    fill: #6366f1;
    stroke: #6366f1;
}

.video-action-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.video-close-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 50%;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    width: 36px;
    height: 36px;
}

.video-close-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: #ef4444;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}

.video-close-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
}

/* Mobile responsive styles for video header */
@media (max-width: 768px) {
    .video-header {
        padding: 12px 16px;
        border-radius: 12px 12px 0 0;
        min-height: 50px;
        width: calc(min(80vh, 585px) * 330 / 585);
        max-width: calc(min(80vh, 585px) * 330 / 585);
    }
    
    .video-restaurant-name {
        font-size: 15px;
        max-width: 170px;
    }
    
    .video-header-right {
        gap: 8px;
    }
    
    .video-action-btn, .video-close-btn {
        width: 32px;
        height: 32px;
        padding: 6px;
        border-radius: 50%;
    }
    
    .video-action-btn svg {
        width: 14px;
        height: 14px;
    }
    
    .video-close-btn svg {
        width: 18px;
        height: 18px;
    }
}
.video-container {
    width: 330px;
    height: 585px;
    position: relative;
    background-color: #000;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #4a5568;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: flex;
    -ms-overflow-style: none; /* Hide scrollbar in IE/Edge */
    scrollbar-width: none; /* Hide scrollbar in Firefox */
    align-items: center;
    justify-content: center;
}

/* Hide scrollbar on video container */
.video-container::-webkit-scrollbar {
    display: none;
}

/* Hide scrollbars on video container iframe */
.video-container iframe {
    overflow: hidden !important;
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
}

.video-container iframe::-webkit-scrollbar {
    display: none !important;
}

/* Simplified video loading styles */
.video-loading {
    display: none; /* Hide spinner by default - let TikTok handle loading */
}

.tiktok-embed {
    opacity: 1;
}
.video-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #1a1a1a, #2a2a2a);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
}
.video-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #333;
    border-top: 3px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}
.video-loading-text {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.tiktok-logo {
    width: 60px;
    height: 60px;
    background: #000;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
    margin-bottom: 12px;
}
.video-preload {
    position: absolute;
    top: -9999px;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
.numbered-marker {
    background: #3b82f6;
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: all 0.2s ease;
}
.numbered-marker:hover {
    background: #1d4ed8;
    transform: scale(1.1);
}
.restaurant-number {
    background: #3b82f6;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 11px;
    margin-right: 8px;
    flex-shrink: 0;
}
.directions-button {
    background: #10b981;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: none; /* Hidden by default */
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
    margin-top: 8px;
}
.directions-button:hover {
    background: #059669;
    transform: translateY(-1px);
}
.directions-button:active {
    transform: translateY(0);
}
.directions-icon {
    font-size: 14px;
}
.close-video-btn {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 36px;
    height: 36px;
    background: #f3f4f6;
    color: #111827;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}
#video-title {
    color: #ffffff;
    font-weight: 700;
    font-size: 16px;
    text-align: center;
    margin-bottom: 10px;
}
/* Custom user marker icon */
.user-location-icon { 
    background: transparent; 
    border: none; 
}
.user-icon {
    width: 35px; height: 35px; border-radius: 9999px; background: #ef4444; /* red-500 */
    border: 3px solid #ffffff; box-shadow: 0 0 0 3px rgba(239,68,68,0.5);
    display: flex; align-items: center; justify-content: center; color: #ffffff; font-size: 18px; line-height: 1;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}
/* Highlight for selected restaurant in list */
.active-list-item { 
    background-color: #eef2ff !important; 
    border-color: #a5b4fc !important; 
    border-width: 2px !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
    transform: translateY(-1px) !important;
}
/* Isolate list rendering for perf */
#restaurant-list { 
    contain: content; 
    position: relative;
    z-index: 1;
}

/* Ensure sticky filter buttons stay above restaurant list */
@media (min-width: 768px) {
    .md\\:sticky {
        z-index: 20 !important;
    }
    
    #restaurant-list > div:not(:first-child) {
        margin-top: 1rem; /* 16px spacing between cards on desktop */
    }
}
/* Mobile drawer resizing */
@media (max-width: 767px) {
    :root { --drawer-height: 33vh; }
    main { position: relative; height: calc(100vh - 60px) !important; }
    #map-container { 
        height: 100% !important; 
        z-index: 0; 
        background: #f8fafc;
        border-bottom: 2px solid #e2e8f0;
    }
    aside { 
        position: absolute; 
        left: 0; 
        right: 0; 
        bottom: 0; 
        height: var(--drawer-height); 
        z-index: 200; 
        border-top: 3px solid #e5e7eb;
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
        padding: 0 !important;
        display: flex;
        flex-direction: column;
    }
/* Mobile drawer handle - clean rebuild */
#drawer-handle {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 0;
    cursor: ns-resize;
    touch-action: none;
    position: relative;
    z-index: 5;
    flex-shrink: 0;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    min-height: 32px; /* Reduced from 44px for better space optimization */
}

#drawer-handle::after {
    content: '';
    width: 50px;
    height: 6px;
    background: #6b7280;
    border-radius: 3px;
    display: block;
    transition: background-color 0.2s ease;
}

#drawer-handle:active::after {
    background: #374151;
}

/* Skeleton loading styles */
.skeleton-item {
    background: white;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    margin-bottom: 16px;
    min-height: 80px;
}

.skeleton-number {
    width: 24px;
    height: 24px;
    background: #e5e7eb;
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton-content {
    flex: 1;
    min-width: 0;
}

.skeleton-title {
    height: 20px;
    background: #e5e7eb;
    border-radius: 4px;
    margin-bottom: 8px;
    width: 70%;
}

.skeleton-description {
    height: 14px;
    background: #e5e7eb;
    border-radius: 4px;
    margin-bottom: 8px;
    width: 90%;
}

.skeleton-description:last-of-type {
    width: 60%;
    margin-bottom: 8px;
}

.skeleton-button {
    height: 28px;
    background: #e5e7eb;
    border-radius: 4px;
    width: 100px;
}

@keyframes skeleton-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* Mobile skeleton adjustments */
@media (max-width: 767px) {
    .skeleton-item {
        padding: 8px 2px;
        min-height: 60px;
    }
    
    .skeleton-number {
        width: 20px;
        height: 20px;
        margin-right: 6px;
    }
    
    .skeleton-title {
        height: 14px;
        margin-bottom: 4px;
    }
    
    .skeleton-description {
        height: 10px;
        margin-bottom: 6px;
    }
    
    .skeleton-button {
        height: 20px;
        width: 60px;
        margin-top: 4px;
    }
}
    /* Center modal content with better mobile positioning */
    .modal-content-wrapper { top: -60px; }
    #video-modal { padding-bottom: 0; padding-top: 40px; }
    .video-container { height: min(80vh, 585px); width: calc(min(80vh, 585px) * 330 / 585); }
    #video-modal .video-container iframe { width: 100% !important; height: 100% !important; }
    
    /* Mobile video header styles */
    .video-header {
        padding: 12px 16px;
        border-radius: 8px 8px 0 0;
    }
    
    .video-restaurant-name {
        font-size: 16px;
        max-width: 150px;
    }
    
    .video-header-actions {
        gap: 6px;
    }
    
    .video-action-btn {
        padding: 6px;
        width: 1.75rem;
        height: 1.75rem;
    }
    
    .video-action-btn svg {
        width: 14px;
        height: 14px;
    }
    /* Hide Leaflet zoom controls on mobile */
    .leaflet-control-zoom { display: none !important; }
    /* Show directions button only on mobile */
    .directions-button { display: flex !important; }
    /* Drawer content now has proper spacing from handle */
    /* Restaurant list now inherits from parent flex container */
    #restaurant-list {
        padding: 0.25rem 1rem;
        min-height: 0;
        /* Hide scrollbar on mobile */
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    
    /* Add spacing between restaurant cards, but not for the first one */
    #restaurant-list > div:not(:first-child) {
        margin-top: 0.75rem; /* 12px spacing between cards */
    }
    
    #restaurant-list::-webkit-scrollbar {
        display: none;
    }
    
    /* Mobile-specific optimizations */
    .restaurant-number {
        width: 20px;
        height: 20px;
        font-size: 10px;
        margin-right: 6px;
    }
    
    .directions-button {
        padding: 4px 8px;
        font-size: 10px;
        margin-top: 4px;
    }
    
    .directions-icon {
        font-size: 12px;
    }
    
    /* Improve text truncation on mobile */
    .line-clamp-2 {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    /* Better touch targets */
    .restaurant-item {
        min-height: 60px;
    }
}

/* Cuisine icon marker styles */
.numbered-marker {
    background: none !important;
    border: none !important;
}

/* Marker highlight effect for hover */
.numbered-marker.highlighted .numbered-marker-content {
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.8), 0 0 0 6px rgba(255, 255, 255, 0.9);
    transform: scale(1.1);
    z-index: 1000;
    position: relative;
    border-radius: 50%;
}

/* Watched Video Icon Styles */
.watched-icon {
    position: absolute;
    bottom: 0.75rem;
    right: 1rem; /* Position it in the bottom right corner */
    color: #6b7280; /* A subtle gray color */
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    padding: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.watched-icon svg {
    width: 16px;
    height: 16px;
}

/* Skeleton Loader Styles */
.skeleton-card {
    background: white;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: flex-start;
    position: relative;
    margin-bottom: 0.5rem;
}

.skeleton-avatar {
    width: 2rem;
    height: 2rem;
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    border-radius: 50%;
    margin-right: 0.75rem;
    flex-shrink: 0;
    animation: skeleton-loading 1.5s infinite;
}

.skeleton-content {
    flex: 1;
    min-width: 0;
}

.skeleton-title {
    height: 1.25rem;
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
    width: 70%;
    animation: skeleton-loading 1.5s infinite;
}

.skeleton-description {
    height: 0.875rem;
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
    width: 90%;
    animation: skeleton-loading 1.5s infinite;
}

.skeleton-description:nth-child(3) {
    width: 60%;
    margin-bottom: 0.75rem;
}

.skeleton-tags {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.skeleton-tag {
    height: 1.5rem;
    width: 4rem;
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    border-radius: 9999px;
    animation: skeleton-loading 1.5s infinite;
}

.skeleton-tag:nth-child(2) {
    width: 3.5rem;
}

.skeleton-tag:nth-child(3) {
    width: 3rem;
}

.skeleton-favorite {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 1.5rem;
    height: 1.5rem;
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    border-radius: 0.25rem;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.numbered-marker-content {
    background: none;
    color: inherit;
    border: none;
    border-radius: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: normal;
    font-size: 24px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.numbered-marker-content:hover {
    transform: scale(1.2);
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
}

/* Favorited restaurant marker styles */
.numbered-marker-content.favorited {
    text-shadow: 
        0 0 12px #f59e0b, 
        0 0 20px #f59e0b, 
        0 0 30px #f59e0b,
        2px 2px 4px rgba(0, 0, 0, 0.8);
    transform: scale(1.15);
    animation: favoritedGlow 2s ease-in-out infinite alternate;
}

@keyframes favoritedGlow {
    0% {
        text-shadow: 
            0 0 12px #f59e0b, 
            0 0 20px #f59e0b, 
            0 0 30px #f59e0b,
            2px 2px 4px rgba(0, 0, 0, 0.8);
    }
    100% {
        text-shadow: 
            0 0 16px #f59e0b, 
            0 0 24px #f59e0b, 
            0 0 35px #f59e0b,
            2px 2px 4px rgba(0, 0, 0, 0.8);
    }
}

/* Filter modal styles */
#filter-modal {
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 9999 !important;
}

#filter-modal .inline-block {
    transition: transform 0.3s ease;
}

#filter-modal:not(.hidden) .inline-block {
    transform: translateY(0);
}

#filter-modal.hidden .inline-block {
    transform: translateY(100%);
}

/* Filter toggle button styles */
#filter-toggle-btn {
    transition: all 0.2s ease;
}

#filter-toggle-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#filter-arrow {
    transition: transform 0.3s ease;
}

/* Mobile filter modal improvements */
@media (max-width: 767px) {
    #filter-modal .inline-block {
        width: 100%;
        max-width: none;
        margin: 0;
        border-radius: 1rem 1rem 0 0;
    }
    
    #cuisine-filter-container-mobile {
        max-height: 50vh;
    }
    
    /* Fix oversized SVGs in mobile cuisine filter modal - higher specificity */
    #cuisine-filter-container-mobile .cuisine-card-content svg,
    #cuisine-filter-container-mobile .cuisine-card-content div svg,
    #cuisine-filter-container-mobile svg,
    #cuisine-filter-container-mobile div svg {
        width: 12px !important;
        height: 12px !important;
        margin: 0 auto 2px auto !important;
        max-width: 12px !important;
        max-height: 12px !important;
    }
    
    /* Fix oversized SVGs in mobile collection filter modal */
    #collection-filter-container-mobile svg {
        width: 24px !important;
        height: 24px !important;
        margin: 0 auto 4px auto !important;
    }
    
    /* Catch-all rule for any massive SVGs in mobile filter modals */
    #filter-modal svg,
    #cuisine-filter-container-mobile svg,
    #collection-filter-container-mobile svg {
        max-width: 24px !important;
        max-height: 24px !important;
    }
    
    /* Ensure collection checkboxes have proper small SVGs on mobile */
    #collection-filter-container-mobile .collection-checkbox svg {
        width: 12px !important;
        height: 12px !important;
        margin: 0 !important;
    }
}

/* Favorite Icon Styles */
.favorite-btn {
    cursor: pointer;
    z-index: 10;
    color: #9ca3af; /* Default gray color for the star outline */
    transition: all 0.2s ease-in-out;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.add-to-collection-btn {
    cursor: pointer;
    z-index: 10;
    color: #9ca3af; /* Default gray color */
    transition: all 0.2s ease-in-out;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.add-to-collection-btn:hover {
    color: #6366f1; /* Purple color on hover */
    background-color: rgba(99, 102, 241, 0.1);
    border-color: #6366f1;
    transform: scale(1.1);
}

.add-to-collection-btn.collected {
    color: #6366f1; /* Purple color when collected - just solid color, no background or border */
}

/* 'Click Me' Pulsing Animation */
@keyframes pulse-animation {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
  }
  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 15px rgba(59, 130, 246, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
  }
}

.pulse-me {
  animation: pulse-animation 2s infinite;
  z-index: 100 !important; /* Ensure it's on top */
}

/* Style for tutorial modal to animate in */
#tutorial-modal .transform {
    animation: zoomIn 0.3s ease-out;
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.add-to-collection-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.favorite-btn svg {
    width: 24px;
    height: 24px;
    stroke: #4b5563; /* Darker outline for better visibility */
    stroke-width: 1.5;
    fill: none;
}

.favorite-btn:hover {
    transform: scale(1.2);
    color: #f59e0b; /* Yellow on hover */
}

.favorite-btn.favorited svg {
    fill: #f59e0b; /* Filled yellow color */
    stroke: #f59e0b;
}

/* Custom Marker Cluster Styles - Plate icon for clusters */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
    background: none !important; /* Remove background */
    border: none !important; /* Remove border */
    box-shadow: none !important; /* Remove box shadow */
    border-radius: 0 !important; /* Remove border radius */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    position: relative !important;
    width: 50px !important; /* Larger size to distinguish from individual markers */
    height: 50px !important;
    overflow: visible !important; /* Allow elements to extend beyond bounds */
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
    background: none !important;
    color: transparent !important; /* Hide the original number */
    font-weight: bold !important;
    font-size: 14px !important;
    text-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
    position: relative !important;
}

/* Plate icon background - larger size */
.marker-cluster-small::before,
.marker-cluster-medium::before,
.marker-cluster-large::before {
    content: "🍽️" !important;
    position: absolute !important;
    font-size: 40px !important; /* Larger plate icon */
    z-index: 1 !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
}

/* Red circle in top-right corner */
.marker-cluster-small::after,
.marker-cluster-medium::after,
.marker-cluster-large::after {
    content: "" !important;
    position: absolute !important;
    top: 0px !important;
    right: 0px !important;
    width: 18px !important;
    height: 18px !important;
    background-color: #dc2626 !important;
    border: 2px solid white !important;
    border-radius: 50% !important;
    z-index: 2 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3) !important;
}

/* Move the count number to the red circle */
.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
    position: absolute !important;
    top: 0px !important;
    right: 0px !important;
    width: 18px !important;
    height: 18px !important;
    background-color: #dc2626 !important;
    color: white !important;
    border: 2px solid white !important;
    border-radius: 50% !important;
    z-index: 3 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 11px !important;
    font-weight: bold !important;
    text-shadow: none !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3) !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* New styles for SVG markers */
.svg-marker-container svg {
    width: 100%;
    height: 100%;
    /* You can add a drop shadow for better visibility on the map */
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
}

/* Scale SVG icons in restaurant card cuisine tags */
.restaurant-item span svg,
.restaurant-item .inline-block svg {
    width: 12px !important;
    height: 12px !important;
    display: inline-block !important;
    vertical-align: middle !important;
    margin-right: 4px !important;
    flex-shrink: 0 !important;
}

/* Ensure all SVG elements in cuisine tags are small */
#restaurant-list span svg {
    width: 12px !important;
    height: 12px !important;
    display: inline-block !important;
    vertical-align: middle !important;
    margin-right: 4px !important;
}

/* Scale SVG icons in cuisine filter modal - desktop only */
@media (min-width: 768px) {
    .cuisine-card-content svg,
    .cuisine-card-content div svg {
        width: 32px !important;
        height: 32px !important;
        display: block !important;
        margin: 0 auto 8px auto !important;
    }
}

/* Scale SVG icons in category headers */
.space-y-3 span svg {
    width: 24px !important;
    height: 24px !important;
    display: inline-block !important;
    vertical-align: middle !important;
    margin-right: 8px !important;
}

/* Collection Selection Modal Styles */
#collection-selection-modal {
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

#collection-selection-modal .bg-white {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}


/* Toast Notification Styles */
#toast-notification {
    max-width: 300px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

#toast-notification.success {
    background-color: #059669;
}

#toast-notification.error {
    background-color: #dc2626;
}

#toast-notification.warning {
    background-color: #d97706;
}

#toast-notification.show {
    transform: translateX(0);
}

/* --- Homepage Styles --- */
/* Fix body height and scrolling for homepage */
body.homepage {
  height: auto;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  font-family: 'TikTok Sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

html {
  height: auto;
  overflow-y: auto;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 4%;
  background-color: #f9fafb;
  color: #111827;
  border-bottom: 1px solid #e5e7eb;
  font-family: 'TikTok Sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  min-height: 60px;
}

/* Mobile header styles */
@media (max-width: 768px) {
  .header {
    padding: 0.75rem 3%;
    min-height: 56px;
  }
  
  .header nav {
    gap: 0.5rem !important;
  }
  
  .header nav a {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.875rem !important;
    flex-shrink: 0;
  }
  
  .header nav a svg {
    width: 1rem !important;
    height: 1rem !important;
  }
  
  /* Mobile drawer optimization for smooth dragging */
  aside {
    will-change: height;
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    contain: layout style;
  }
  
  /* Prevent browser interference with dragging */
  #drawer-handle {
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }
}

.logo { 
  font-weight: 700; 
  font-size: 1.25rem; 
  color: #111827; 
  flex-shrink: 0;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.nav-link { 
  color: #6b7280; 
  text-decoration: none; 
  transition: color 0.2s; 
  font-size: 0.875rem;
  white-space: nowrap;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-link:hover { 
  color: #111827; 
}

.nav-button { 
  background-color: #3b82f6; 
  color: white; 
  padding: 0.5rem 0.75rem; 
  border-radius: 6px; 
  text-decoration: none; 
  font-weight: 600; 
  font-size: 0.875rem;
  transition: background-color 0.2s; 
  white-space: nowrap;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-button:hover { 
  background-color: #2563eb; 
}

/* Mobile responsive header */
@media (max-width: 768px) {
  .header {
    padding: 0.75rem 4%;
    min-height: 56px;
  }
  
  .logo {
    font-size: 1.125rem;
  }
  
  .nav {
    gap: 0.25rem;
  }
  
  .nav-link {
    font-size: 0.8125rem;
    margin: 0 0.25rem;
  }
  
  .nav-button {
    padding: 0.375rem 0.625rem;
    font-size: 0.8125rem;
  }
}

.hero {
  text-align: center;
  padding: 4rem 5%;
  background-color: #ffffff;
  color: #111827;
  font-family: 'TikTok Sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

.hero h1 { 
  font-size: 2.5rem; 
  max-width: 600px; 
  margin: 0 auto 2rem auto; 
  color: #111827; 
  font-weight: 700; 
  line-height: 1.2;
}

.search-container { 
  display: flex; 
  justify-content: center; 
  position: relative; 
  flex-direction: column; 
  align-items: center; 
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

.search-row { 
  display: flex; 
  justify-content: center; 
  position: relative; 
  width: 100%;
  max-width: 400px;
}

.search-bar { 
  font-size: 1rem; 
  padding: 0.75rem 1rem; 
  width: 100%; 
  border: 1px solid #d1d5db; 
  border-radius: 8px 0 0 8px; 
  background-color: #ffffff; 
  color: #111827; 
  flex: 1;
  min-width: 0;
}

.search-bar:focus { 
  outline: none; 
  border-color: #3b82f6; 
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); 
}

.search-button { 
  font-size: 1rem; 
  padding: 0.75rem 1.5rem; 
  border: none; 
  background-color: #3b82f6; 
  color: white; 
  border-radius: 0 8px 8px 0; 
  cursor: pointer; 
  font-weight: 600; 
  transition: background-color 0.2s; 
  flex-shrink: 0;
  white-space: nowrap;
}

.search-button:hover { 
  background-color: #2563eb; 
}

/* Mobile responsive hero and search */
@media (max-width: 768px) {
  .hero {
    padding: 2rem 4%;
  }
  
  .hero h1 {
    font-size: 1.875rem;
    line-height: 1.3;
    margin-bottom: 1.5rem;
  }
  
  .search-container {
    max-width: 100%;
    padding: 0 1rem;
  }
  
  .search-row {
    max-width: 100%;
    width: 100%;
  }
  
  .search-bar {
    font-size: 0.875rem;
    padding: 0.625rem 0.75rem;
  }
  
  .search-button {
    font-size: 0.875rem;
    padding: 0.625rem 1rem;
  }
}

/* Autocomplete dropdown */
.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: white;
  border: 1px solid #d1d5db;
  border-top: none;
  border-radius: 0 0 8px 8px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Mobile responsive autocomplete */
@media (max-width: 768px) {
  .autocomplete-dropdown {
    max-height: 150px;
  }
}

/* --- City Switcher Modal --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.modal-overlay.show {
    display: flex;
}
.modal-content {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    width: 90%;
    max-width: 450px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.modal-header h3 { 
    font-size: 1.5rem; 
    margin: 0;
}
#close-modal-button { 
    background: none; 
    border: none; 
    font-size: 2rem; 
    cursor: pointer; 
    color: #666;
}
#close-modal-button:hover {
    color: #333;
}
#city-search-input { 
    width: 100%; 
    padding: 0.75rem; 
    font-size: 1rem; 
    border: 1px solid #ccc; 
    border-radius: 8px; 
    margin-bottom: 1rem; 
    box-sizing: border-box;
}
#city-search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
#modal-city-list { 
    list-style: none; 
    padding: 0; 
    margin: 0; 
    overflow-y: auto; 
}
#modal-city-list li { 
    padding: 0.75rem 0.5rem; 
    font-size: 1.1rem; 
    cursor: pointer; 
    border-radius: 6px; 
    transition: background-color 0.2s ease;
}
#modal-city-list li:hover { 
    background-color: #f0f0f0; 
}

/* --- My Collections Button Layout Fix --- */
@media (min-width: 769px) {
    #collections-btn {
        display: inline-flex !important;
        align-items: center !important;
        flex-direction: row !important;
        gap: 0.375rem !important; /* 1.5 in Tailwind */
        white-space: nowrap !important;
    }
}

/* Hide collections button on mobile */
@media (max-width: 768px) {
    #collections-btn {
        display: none !important;
    }
}

#collections-btn svg {
    flex-shrink: 0 !important;
    margin: 0 !important;
}

/* --- Mobile Location Button Styling --- */
@media (max-width: 768px) {
    #location-btn {
        background-color: rgba(255, 255, 255, 0.9) !important;
        color: #374151 !important;
        border: 1px solid rgba(0, 0, 0, 0.1);
        backdrop-filter: blur(10px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    #location-btn:hover {
        background-color: rgba(255, 255, 255, 0.95) !important;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
}

/* --- Mobile Menu Modal --- */
#mobile-menu-modal {
    backdrop-filter: blur(5px);
}

#mobile-menu-modal .fixed {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

/* --- Media Query for Responsiveness --- */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    #modal-city-list li {
        font-size: 1rem;
        padding: 0.875rem 0.5rem;
    }
}

.autocomplete-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid #f3f4f6;
  transition: background-color 0.2s;
  font-size: 0.875rem;
  color: #374151;
}

.autocomplete-item:hover {
  background-color: #f3f4f6;
  color: #111827;
}

.autocomplete-item:last-child {
  border-bottom: none;
  border-radius: 0 0 8px 8px;
}

.autocomplete-item:first-child {
  border-top: 1px solid #f3f4f6;
}

/* Fix authentication modal positioning - more specific to avoid conflicts */
#auth-modal {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background-color: rgba(0, 0, 0, 0.5) !important;
  z-index: 10000 !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 1rem !important;
}

#auth-modal:not(.flex) {
  display: none !important;
}

#auth-modal.flex {
  display: flex !important;
}

.featured-cities { 
  padding: 4rem 5% 6rem 5%; 
  text-align: center; 
  background-color: #f9fafb; 
  min-height: auto; 
  padding-bottom: 6rem; /* Extra bottom padding to ensure scrolling shows everything */
}
.featured-cities h2 { font-size: 2rem; color: #111827; margin-bottom: 2rem; }
.city-grid { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
  gap: 1.5rem; 
  max-width: 1200px;
  margin: 0 auto;
}
.city-card { 
  position: relative; 
  border-radius: 12px; 
  overflow: hidden; 
  display: block; 
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); 
  transition: transform 0.3s ease, box-shadow 0.3s ease; 
  height: 300px; /* Fixed height for consistency */
}
.city-card:hover { transform: translateY(-2px); box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); }
.city-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.city-card:hover img { transform: scale(1.05); }
.city-card span { position: absolute; bottom: 1rem; left: 1rem; font-size: 1.5rem; font-weight: 700; color: white; text-shadow: 2px 2px 4px rgba(0,0,0,0.7); }
