/* DWI Color System - matching dogwatchinternational.com */
:root {
    /* Base Colors */
    --black-hsl: 0, 0%, 0%;
    --white-hsl: 0, 0%, 100%;
    /* DWI Brand Colors */
    --accent-hsl: 124, 19%, 61%; /* Green #89af8c */
    --lightAccent-hsl: 51, 100%, 50%; /* Yellow/Gold #ffd100 */
    --darkAccent-hsl: 201, 100%, 27%; /* Dark Blue #005687 */
    --safeLightAccent-hsl: 51, 100%, 50%;
    --safeDarkAccent-hsl: 201, 100%, 27%;
    --safeInverseLightAccent-hsl: 0, 0%, 100%;
    --safeInverseDarkAccent-hsl: 0, 0%, 100%;
}

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Amatic+SC:wght@400;700&family=Outfit:wght@100..900&display=swap');

/* Font declarations */
@font-face {
    font-family: 'FoxBower';
    src: url('public/fonts/FoxBower.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

/* Apply fonts to elements */
h1, h2, h3, h4, h5, h6, .category-header h1, .popup-content h3 {
    font-family: 'FoxBower', serif;
}

body, p, .business-name, .business-address, .popup-content p, .business-item {
    font-family: 'Nunito Sans', sans-serif;
}

.map-container {
    position: relative;
    width: 100%;
    height: 65vh;
    min-height: 450px;
    border: 1px solid #ccc;
    display: flex;
    flex-direction: row;
    overflow: hidden;
}

.controls {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: hsla(var(--white-hsl), 1);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    border: 1px solid hsla(var(--accent-hsl), 0.3);
}

.search-container {
    margin-bottom: 15px;
}

#search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid hsla(var(--accent-hsl), 0.3);
    border-radius: 4px;
    font-size: 14px;
}

#search-input:focus {
    border-color: hsla(var(--accent-hsl), 0.5);
    outline: none;
}

.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-filters button {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.category-filters button:hover {
    background: hsla(var(--lightAccent-hsl), 0.1);
}

.category-filters button.active {
    background: hsla(var(--accent-hsl), 1);
    color: hsla(var(--white-hsl), 1);
    border-color: hsla(var(--darkAccent-hsl), 1);
}

#map {
    flex: 1;
    height: 100%;
    margin-left: 340px;
    z-index: 1; /* Keep map below sidebar and controls */
}

/* Legacy location-popup styles removed - replaced with enhanced styles below */

.map-container:active {
    cursor: grabbing;
}

.map-wrapper {
    position: relative;
    transform-origin: 0 0;
    transition: transform 0.1s ease;
    will-change: transform;
}

.map-image {
    width: 100%;
    height: auto;
    display: block;
}

.map-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.hotspot {
    position: absolute;
    width: 3.5px;
    height: 3.5px;
    background-color: rgba(15, 194, 194, 0.3);
    border: 1px solid rgba(15, 194, 194, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    transform: translate(-50%, -50%) scale(calc(1 / var(--current-scale, 1)));
    transform-origin: center center;
}

/* Removed hardcoded hotspot positions - now set dynamically via JavaScript */

.hotspot:hover {
    background-color: rgba(15, 194, 194, 0.5);
    transform: translate(-50%, -50%) scale(calc(1.1 / var(--current-scale, 1)));
}

.tooltip {
    position: absolute;
    display: block;
    background-color: hsla(var(--white-hsl), 1);
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    width: 200px;
    left: 8px;
    top: 0;
    transform: translateY(-50%) translateX(100%);
    z-index: 100;
    border: 1px solid hsla(var(--accent-hsl), 0.3);
    transition: opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
    font-family: 'Nunito Sans', sans-serif;
}

.hotspot:hover .tooltip {
    opacity: 1;
    pointer-events: auto;
}

/* === Tooltip timing tweaks === */

/* 1 – default state: 800 ms delay before starting to fade-out */
.hotspot .tooltip {
    /* Linger for 0.8s before starting fade-out */
    transition: opacity 0.3s ease 0.8s;
    opacity: 0;
    pointer-events: none;
}

/* 2 – visible state: appear immediately, no delay */
.hotspot:hover .tooltip,
.tooltip:hover {
    /* Cancel hide delay when cursor over tooltip */
    transition: opacity 0.3s ease 0s;
    opacity: 1;
    pointer-events: auto;
}

/* Add a small arrow to the tooltip */
.tooltip::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    border-style: solid;
    border-width: 8px 8px 8px 0;
    border-color: transparent hsla(var(--white-hsl), 1) transparent transparent;
}

.tooltip h3 {
    margin: 0 0 5px 0;
    color: hsla(var(--darkAccent-hsl), 1);
    font-family: 'Quicksand', sans-serif;
}

.tooltip p {
    margin: 0;
    color: hsla(var(--accent-hsl), 0.8);
}

.tooltip small {
    color: #999;
    font-style: italic;
}

/* Make links more visible and interactive */
.tooltip a {
    color: hsla(var(--accent-hsl), 1);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.tooltip a:hover {
    color: hsla(var(--darkAccent-hsl), 1);
    text-decoration: underline;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    z-index: 1000;
}

.modal-content {
    position: relative;
    background-color: hsla(var(--white-hsl), 1);
    margin: 15% auto;
    padding: 20px;
    width: 70%;
    max-width: 500px;
    border-radius: 5px;
    cursor: default;
    user-select: text;
}

.close-button {
    position: absolute;
    right: 10px;
    top: 10px;
    font-size: 24px;
    cursor: pointer;
    color: hsla(var(--accent-hsl), 0.8);
}

.close-button:hover {
    color: hsla(var(--darkAccent-hsl), 1);
}

/* Let Leaflet handle zoom controls by default - minimal interference */
.leaflet-control-zoom {
    z-index: 1000 !important; /* Only override z-index for visibility */
}

/* Legacy zoom-controls class for compatibility */
.zoom-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 1000;
}

@media (max-width: 900px) {
    /* Target Leaflet's zoom controls */
    .leaflet-control-zoom {
        position: fixed !important;
        bottom: calc(40vh + 5px) !important; /* Just above the 40vh sidebar with minimal gap */
        left: 20px !important; /* Move to left side to avoid toggle button clash */
        right: auto !important; /* Override Leaflet's right positioning */
        z-index: 2000 !important; /* Higher z-index to stay above sidebar and map */
        transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }
    
    /* When sidebar is minimized, move zoom controls down closer to the visible portion */
    .sidebar.minimized ~ .map-container .leaflet-control-zoom,
    .sidebar.minimized ~ #map .leaflet-control-zoom {
        bottom: 70px !important; /* Just above the minimized sidebar portion (60px + 10px margin) */
    }
    
    /* Minimized sidebar state */
    .sidebar.minimized {
        height: 80px !important;
        min-height: 80px !important;
        overflow: hidden;
    }
    
    .sidebar.minimized .sidebar-content-viewport {
        display: none;
    }
    
    .sidebar.minimized #compact-search {
        display: flex !important;
    }
}

.zoom-button {
    width: 40px;
    height: 40px;
    border: none;
    background: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-button:hover {
    background: #f0f0f0;
}

.zoom-button:first-child {
    border-bottom: 1px solid #eee;
}

.filter-container {
    max-width: 100%;
    margin: 0 auto 20px auto;
    padding: 15px;
    background: #f7f7f7;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.filter-container h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
}

.filter-option {
    margin-bottom: 5px;
}

.filter-option label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.filter-option input[type="checkbox"] {
    margin-right: 8px;
}

/* First Friday indicator in tooltips */
.first-friday-badge {
    display: inline-block;
    background: #A1D91F;
    color: #FFFFFF;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    margin-top: 5px;
}

/* Filtered locations */
.filtered-out {
    display: none !important;
}

/* Container layout */
.container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    padding-left: 0;
}

/* Business panel styles */
.business-panel {
    width: 300px;
    background-color: hsla(var(--white-hsl), 1);
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 15px;
    margin-right: 20px;
    max-height: 90vh;
    overflow-y: auto;
}

.business-panel h2 {
    margin-top: 0;
    margin-bottom: 15px;
    color: hsla(var(--darkAccent-hsl), 1);
    font-size: 1.4em;
}

.search-box {
    margin-bottom: 15px;
}

.search-box input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.panel-filter {
    margin-bottom: 15px;
}

.business-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.business-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
}

.business-item:hover {
    background-color: rgba(161, 217, 31, 0.1);
}

.business-item.first-friday:after {
    content: "First Friday";
    display: inline-block;
    background: #A1D91F;
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 5px;
    vertical-align: middle;
}

.business-item.active {
    background-color: rgba(161, 217, 31, 0.1);
    border-left: 3px solid #0FC2C2;
}

.business-name {
    font-weight: bold;
    display: block;
    margin-bottom: 3px;
}

.business-address {
    font-size: 12px;
    color: hsla(var(--accent-hsl), 0.8);
}

/* Main content area */
.main-content {
    margin-left: 0;
    min-height: 100vh;
    background: hsla(var(--white-hsl), 1);
    display: flex;
    flex-direction: column;
}

.hotspot.highlight {
    transform: scale(1.3);
    background-color: rgba(161, 217, 31, 0.6);
    border: 2px solid rgba(161, 217, 31, 0.8);
    box-shadow: 0 0 15px rgba(161, 217, 31, 0.5);
    z-index: 200;
}

/* Category Filters */
.category-filters {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 10px;
}

.category-filters select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-width: 150px;
    background-color: white;
    cursor: pointer;
}

.category-filters select:hover {
    border-color: #999;
}

.category-filters select:focus {
    outline: none;
    border-color: #666;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

/* Category Pages */
.category-header {
    text-align: center;
    padding: 40px 20px;
    background: hsla(var(--white-hsl), 1);
    /* margin-bottom: 30px; */
}

.category-header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: hsla(var(--darkAccent-hsl), 1);
}

.category-header p {
    font-size: 1.1em;
    color: white;
    max-width: 600px;
    margin: 0 auto;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Color Preview Styles */
.color-preview {
    padding: 20px;
    margin: 20px auto;
    max-width: 800px;
    background: hsla(var(--white-hsl), 1);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.color-preview h2 {
    text-align: center;
    margin-bottom: 20px;
    color: hsla(var(--black-hsl), 1);
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    padding: 20px;
}

.color-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.color-swatch {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    border: 1px solid hsla(var(--black-hsl), 0.1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.color-item span {
    font-size: 14px;
    color: hsla(var(--black-hsl), 0.8);
    text-align: center;
}

/* === DBBA Hero Section Styles === */
.dbba-hero {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  background: hsla(var(--darkAccent-hsl), 1);
  padding: 3rem 2rem;
  gap: 2rem;
}

.dbba-hero-logo {
  flex: 0 0 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dbba-hero-logo img {
  width: 100%;
  max-width: 260px;
  height: auto;
}

.dbba-hero-main {
  flex: 2 1 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 2.5rem;
}

.dbba-hero-title {
  font-family: 'FoxBower', serif;
  font-weight: 700;
  font-size: 2.3rem;
  color: hsla(var(--white-hsl), 1);
  letter-spacing: 1px;
  line-height: 1.1;
  margin-bottom: 1.2rem;
}

.dbba-hero-mission {
  font-family: 'Poppins', sans-serif;
  color: hsla(var(--white-hsl), 0.85);
  font-size: 1.15rem;
  margin-bottom: 1.5rem;
  max-width: 520px;
}

.dbba-hero-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.dbba-hero-nav a {
  color: hsla(var(--lightAccent-hsl), 1);
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 2rem;
  text-decoration: underline;
  text-underline-offset: 4px;
  letter-spacing: 0.5px;
  transition: color 0.2s;
}

.dbba-hero-nav a:hover {
  color: hsla(var(--accent-hsl), 1);
}

.dbba-hero-buttons {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.dbba-hero-btn {
  background: hsla(var(--accent-hsl), 1);
  color: hsla(var(--white-hsl), 1);
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  border: none;
  border-radius: 40px;
  padding: 1.1rem 2.5rem;
  cursor: pointer;
  transition: background 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.dbba-hero-btn:hover {
  background: hsla(var(--lightAccent-hsl), 1);
  color: hsla(var(--darkAccent-hsl), 1);
}

.dbba-hero-contact {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  color: hsla(var(--white-hsl), 1);
  font-family: 'Poppins', sans-serif;
  font-size: 1.1rem;
  gap: 0.7rem;
  min-width: 270px;
}

.dbba-hero-contact a {
  color: hsla(var(--white-hsl), 1);
  text-decoration: underline;
  transition: color 0.2s;
}

.dbba-hero-contact a:hover {
  color: hsla(var(--lightAccent-hsl), 1);
}

.dbba-hero-social {
  display: flex;
  gap: 1.2rem;
  margin-bottom: 0.7rem;
}

.dbba-hero-social svg, .dbba-hero-social img {
  width: 28px;
  height: 28px;
  fill: hsla(var(--accent-hsl), 1);
  opacity: 0.85;
  transition: opacity 0.2s;
}

.dbba-hero-social a:hover svg, .dbba-hero-social a:hover img {
  opacity: 1;
}

@media (max-width: 900px) {
    .dbba-hero {
        flex-direction: column;
        text-align: center;
        padding: 40px 20px;
    }

    .dbba-hero-contact {
        margin-top: 20px;
    }

    /* Removed conflicting map-container styles - handled by main mobile styles */
}

.business-image-container {
    width: 100%;
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
}

.business-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
}

.first-friday-note {
    background-color: rgba(161, 217, 31, 0.1);
    padding: 10px;
    border-radius: 4px;
    margin-top: 8px;
    font-style: italic;
    color: #666;
    border-left: 3px solid #A1D91F;
}

/* === Sidebar Redesign (map frame version) === */
.sidebar {
    position: absolute;
    top: 0;
    left: 0;
    width: 340px;
    height: 100%;
    background: #0FC2C2;
    color: hsla(var(--white-hsl), 1);
    display: flex;
    flex-direction: column;
    z-index: 2000; /* Higher z-index to ensure arrow button stays visible */
    box-shadow: 2px 0 12px rgba(0,0,0,0.08);
    flex-shrink: 0;
    transition: height 0.3s ease, transform 0.3s ease;
}

.sidebar-icons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px 16px 28px;
    gap: 18px;
    flex-shrink: 0;
}

.sidebar-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.sidebar-tab-label {
    font-size: 0.75em;
    color: hsla(var(--white-hsl), 0.7);
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.2s ease;
}

/* Update label color when tab is active */
.sidebar-tab:has(.sidebar-icon.active) .sidebar-tab-label {
    color: hsla(var(--lightAccent-hsl), 1);
}

.sidebar-icon {
    background: hsla(var(--white-hsl), 0.08);
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: hsla(var(--white-hsl), 1);
    font-size: 1.2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.sidebar-icon:hover, .sidebar-icon:focus {
    background: hsla(var(--lightAccent-hsl), 0.18);
    outline: none;
}

.sidebar-icon.active {
    background: hsla(var(--lightAccent-hsl), 1);
    color: hsla(var(--darkAccent-hsl), 1);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.sidebar-sections {
    flex: 1;
    overflow-y: visible !important;
    padding: 0 0 24px 0;
}

.sidebar-section {
    margin-bottom: 8px;
    background: none;
}

.sidebar-section-header {
    font-family: 'Amatic SC', sans-serif;
    font-weight: 700;
    font-style: normal;
    font-size: 2rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 18px 32px 14px 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    color: #FFFFFF;
    background: #0FC2C2;
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 1px solid hsla(var(--white-hsl), 0.1);
}

/* Desktop-only sticky positioning to avoid mobile touch conflicts */
@media (min-width: 901px) {
    .sidebar-section-header {
        position: sticky;
        top: 0;
        z-index: 10;
        backdrop-filter: blur(8px);
        font-size: 2rem;
    }
}

/* Desktop hover effects - reduced transform to prevent flickering */
@media (min-width: 901px) {
    .sidebar-section-header:hover {
        background: #5FD9D9 !important;
        color: #FFFFFF;
        transform: translateX(2px); /* Reduced movement to prevent sticky conflicts */
        box-shadow: 0 2px 8px rgba(161, 217, 31, 0.2);
        border-left: 3px solid #A1D91F; /* Thinner border */
        backdrop-filter: blur(12px);
    }
}

/* Desktop-only glow effect to prevent mobile conflicts */
@media (min-width: 901px) {
    .sidebar-section-header:hover::before {
        content: '';
        position: absolute;
        top: 0;
        left: -3px; /* Reduced from -4px to match thinner border */
        bottom: 0;
        width: 3px;
        background: linear-gradient(
            180deg, 
            #A1D91F 0%, 
            rgba(161, 217, 31, 0.7) 50%, 
            #A1D91F 100%
        );
        box-shadow: 0 0 6px rgba(161, 217, 31, 0.4); /* Reduced glow */
    }
}

.sidebar-section.expanded .sidebar-section-header {
    background: #5FD9D9;
    color: #FFFFFF;
    border-bottom: 1px solid hsla(var(--white-hsl), 0.2);
    backdrop-filter: blur(12px);
}

.arrow {
    font-size: 1em; /* Almost double the size from 1.1em */
    margin-right: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    order: -1; /* Move to the left side */
    display: inline-block;
    transform: rotate(-90deg); /* Point right when closed */
    line-height: 1; /* Prevent affecting text line height */
    color: #A1D91F;
}

/* Arrow hover effect when hovering over the header */
.sidebar-section-header:hover .arrow {
    color: #A1D91F;
    transform: rotate(-90deg) scale(1.1); /* Slightly larger on hover */
}

.sidebar-section.expanded .sidebar-section-header:hover .arrow {
    transform: rotate(0deg) scale(1.1); /* Maintain expanded rotation but scale */
}

.sidebar-section.expanded .arrow {
    transform: rotate(0deg); /* Point down when expanded */
}

.sidebar-section:not(.expanded) .arrow {
    transform: rotate(-90deg); /* Point right when closed */
}

.sidebar-list {
    list-style: none;
    margin: 0;
    padding: 8px 0 0 32px; /* Add top padding to account for sticky header */
    background: #5FD9D9;
    border-radius: 0 8px 8px 0;
    overflow: hidden;
    transition: max-height 0.3s;
}

.sidebar-section:not(.expanded) .sidebar-list {
    display: none;
}

.sidebar-list li {
    padding: 8px 12px;
    margin: 2px 0;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'Nunito Sans', sans-serif;
    color: hsla(var(--white-hsl), 0.8);
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.sidebar-list li:last-child {
    margin-bottom: 0;
}

.sidebar-list li.active {
    background: rgba(161, 217, 31, 0.15);
    color: #A1D91F;
    transform: translateX(4px);
}

/* Hover effect - transform and background only, no text color change */
.sidebar-list li:hover {
    background: rgba(161, 217, 31, 0.15);
    transform: translateX(4px);
}

/* Additional styles for clickable business names */
.sidebar-list li.clickable {
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
    position: relative; /* Needed for tooltip positioning */
}

.sidebar-list li.clickable:hover {
    border-left-color: #A1D91F;
    background: rgba(161, 217, 31, 0.1);
    transform: translateX(4px);
}

.sidebar-list li.clickable:active {
    transform: translateX(2px);
    background: hsla(var(--darkAccent-hsl), 0.2);
}

/* Desktop-only business name tooltip */
@media (min-width: 901px) {
    .sidebar-list li.clickable::after {
        content: attr(data-business-name);
        position: absolute;
        left: 100%;
        top: 50%;
        transform: translateY(-50%);
        background: hsla(var(--darkAccent-hsl), 0.95);
        color: hsla(var(--white-hsl), 1);
        padding: 8px 12px;
        border-radius: 6px;
        font-family: 'Nunito Sans', sans-serif;
        font-size: 0.85em;
        white-space: nowrap;
        opacity: 0;
        visibility: hidden;
        transition: all 0.2s ease;
        pointer-events: none; /* Prevent tooltip from interfering with clicks */
        z-index: 1000; /* High z-index but lower than popups */
        margin-left: 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        backdrop-filter: blur(8px);
        border: 1px solid hsla(var(--white-hsl), 0.1);
    }
    
    .sidebar-list li.clickable:hover::after {
        opacity: 1;
        visibility: visible;
        transform: translateY(-50%) translateX(4px);
    }
    
    /* Hide tooltip when popup is open to prevent conflicts */
    .popup-open .sidebar-list li.clickable::after {
        opacity: 0 !important;
        visibility: hidden !important;
    }
}

/* === Main Content Layout === */
.category-header {
    margin-top: 0;
    padding-top: 32px;
}

@media (max-width: 900px) {
    .sidebar {
        width: 100vw;
        height: auto;
        position: relative;
        flex-direction: column;
        box-shadow: none;
        /* Use CSS custom property for adjustable height - balanced for content accessibility */
        --sidebar-height: 40vh;
        transition: height 0.3s ease;
    }
    /* Hide tab system on mobile */
    .sidebar-icons,
    .tab-header {
        display: none !important;
    }
    .map-container {
        flex-direction: column;
        height: 100vh;
        min-height: 100vh;
    }
    #map {
        margin-left: 0;
        order: -1;
        flex: 1;
        min-height: calc(100vh - var(--sidebar-height, 50vh)); /* Use the custom property */
    }
    .sidebar {
        order: 2;
        flex-shrink: 0;
        height: var(--sidebar-height, 50vh); /* Consistent height using custom property */
        max-height: var(--sidebar-height, 50vh);
        min-height: var(--sidebar-height, 50vh); /* Ensure minimum height for consistency */
    }
    .sidebar-content-viewport {
        height: calc(var(--sidebar-height, 50vh) - 80px); /* Account for icons, consistent height */
        max-height: calc(var(--sidebar-height, 50vh) - 80px);
        min-height: calc(var(--sidebar-height, 50vh) - 80px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        /* Performance optimizations for mobile scrolling */
        will-change: scroll-position;
        transform: translateZ(0); /* Force hardware acceleration */
        /* Better scrollbar behavior on mobile */
        scrollbar-width: thin;
        -webkit-scrollbar-track: transparent;
        /* Improved momentum scrolling */
        overscroll-behavior: contain;
    }
    .sidebar-sections {
        overflow-y: visible;
        /* Ensure smooth scrolling for nested content */
        scroll-behavior: smooth;
        min-height: 100%; /* Ensure sections fill the available space */
    }
    .sidebar-list {
        /* Optimize list rendering for mobile */
        transform: translateZ(0);
        /* Reduce list item margins for better space utilization */
        padding: 0 0 0 28px; /* Reduced from 32px */
    }
    .sidebar-list li {
        font-size: 1.1em;
        /* Slightly reduce padding for better space efficiency */
        padding: 6px 12px; /* Reduced from 8px 12px */
        margin: 1px 0; /* Reduced from 2px 0 */
    }
    
    /* Ensure search panel takes full available height */
    .search-panel {
        height: 100%;
        min-height: 100%;
        display: flex;
        flex-direction: column;
    }
    
    .search-container {
        flex-shrink: 0; /* Don't shrink the search input */
    }
    
    .search-results {
        flex: 1; /* Take remaining space */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .category-header h1 {
        font-size: 1.5em;
    }
    .category-header p {
        font-size: 1em;
    }
    .sidebar .filter-container .filter-option label {
        font-size: 1.2em;
    }
    .sidebar .filter-container input[type="checkbox"] {
        width: 24px;
        height: 24px;
    }
    .sidebar .filter-container select {
        font-size: 1.1em;
    }
}

/* Old floating toggle button styles removed */

/* Compact search visible when minimized */
.compact-search-container {
    display: none;
    position: relative;
    align-items: center;
    gap: 12px;
}

/* menu-reopen-btn styles removed - functionality moved to arrow button */

.compact-search-container .search-icon {
    width: 20px;
    height: 20px;
    color: #A1D91F;
    flex-shrink: 0;
}

.compact-search-container #search-input-compact {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    font-size: 16px;
    font-family: 'Nunito Sans', sans-serif;
    outline: none;
}

.compact-search-container #search-input-compact::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.compact-search-container #search-input-compact:focus {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 2px #A1D91F;
}

/* Minimized state for mobile - keep top part visible */
@media (max-width: 900px) {
  .sidebar.minimized {
      transform: translateY(calc(100% - 60px)); /* Keep 60px visible at top */
      transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .sidebar:not(.minimized) {
      transform: translateY(0);
      transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .sidebar.minimized #compact-search,
  .sidebar.compact #compact-search {
      display: flex !important;
      align-items: center;
      position: fixed;
      bottom: 90px; /* Above the toggle button */
      left: 50%;
      transform: translateX(-50%);
      width: min(400px, calc(100vw - 120px));
      background: #0FC2C2;
      border: 2px solid #A1D91F;
      border-radius: 28px;
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
      padding: 12px 20px;
      z-index: 1900;
      backdrop-filter: blur(12px);
  }
  
  /* Map grows when minimized */
  .sidebar.minimized ~ #map,
  .sidebar.minimized ~ .map-container #map {
      height: 100vh;
      min-height: 100vh;
  }
  
  /* Mobile reopen button removed - replaced with universal tab lever */
}


/* === Sidebar Filter Panel Styles === */
.sidebar .filter-container {
    background: none;
    padding: 24px 28px;
    border: none;
}

.sidebar .filter-container h3 {
    margin-top: 0;
    margin-bottom: 16px;
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #FFFFFF;
}

.sidebar .filter-container .filter-option {
    margin-bottom: 12px;
}

.sidebar .filter-container .filter-option label {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    color: #A1D91F;
    display: flex;
    align-items: center;
}

.sidebar .filter-container input[type="checkbox"] {
    appearance: none;
    width: 18px;
    height: 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 4px;
    margin-right: 10px;
    cursor: pointer;
    position: relative;
    transition: background 0.2s, border-color 0.2s;
}

.sidebar .filter-container input[type="checkbox"]:checked {
    background: #A1D91F;
    border-color: #A1D91F;
}

.sidebar .filter-container input[type="checkbox"]:checked::after {
    content: '\2713';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%);
    font-size: 0.9rem;
    color: #FFFFFF;
}

.sidebar .filter-container select {
    width: 100%;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 4px;
    color: #A1D91F;
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 600;
    cursor: pointer;
}

.sidebar .filter-container select option {
    color: #0FC2C2;
}

/* Make links in modal more prominent */
.modal-content a {
    color: hsla(var(--accent-hsl), 1);
    text-decoration: none;
    font-weight: 500;
    padding: 2px 4px;
    border-radius: 3px;
    transition: background-color 0.2s ease;
}

.modal-content a:hover {
    background-color: hsla(var(--accent-hsl), 0.1);
    text-decoration: underline;
}

.sidebar-content-viewport {
    flex-grow: 1;
    overflow-y: auto;
    min-height: 0;
}

@media (max-width: 900px) {
    .sidebar-content-viewport {
        flex: 1 1 auto;
        min-height: 0;
    }
    
    /* Ensure sidebar sections are visible by default on mobile */
    .sidebar-sections {
        display: block !important;
        padding: 0 0 8px 0 !important; /* Reduce bottom padding to save space */
    }
    
    /* Reduce section margins on mobile to save space */
    .sidebar-section {
        margin-bottom: 4px !important; /* Reduce from 8px to 4px */
    }

    .sidebar-list li {
        font-size: 1.1em;
    }

    .category-header h1 {
        font-size: 1.5em;
    }

    .category-header p {
        font-size: 1em;
    }

    .category-header {
        padding: 5px 10px; /* Drastically reduced from 40px 20px */
        margin: 0; /* Remove any margin */
        min-height: auto; /* Allow natural height */
    }
    
    /* Hide header completely on mobile for maximum map space */
    @media (max-width: 768px) {
        .category-header {
            display: none; /* Hide completely to maximize map space */
        }
        
        /* Adjust main content to account for hidden header */
        .main-content {
            padding-top: 0;
        }
        
        /* Give map container full height */
        .map-container {
            height: 100vh; /* Full viewport height */
            min-height: 100vh;
        }
        
        /* Adjust map to use more vertical space */
        #map {
            min-height: calc(100vh - var(--sidebar-height, 50vh));
            height: calc(100vh - var(--sidebar-height, 50vh));
        }
    }

    .sidebar .filter-container .filter-option label {
        font-size: 1.2em;
    }

    .sidebar .filter-container input[type="checkbox"] {
        width: 24px;
        height: 24px;
    }

    .sidebar .filter-container select {
        font-size: 1.1em;
    }
}

/* Mobile scrollbar optimizations */
@media (max-width: 900px) {
    .sidebar-content-viewport::-webkit-scrollbar {
        width: 4px;
    }
    
    .sidebar-content-viewport::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 2px;
    }
    
    .sidebar-content-viewport::-webkit-scrollbar-thumb {
        background: rgba(161, 217, 31, 0.5);
        border-radius: 2px;
    }
    
    .sidebar-content-viewport::-webkit-scrollbar-thumb:hover {
        background: rgba(161, 217, 31, 0.7);
    }
    
    /* Optimize search results scrolling on mobile */
    .sidebar .search-results {
        max-height: calc(45vh - 80px); /* Account for search input height */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        will-change: scroll-position;
        transform: translateZ(0);
        overscroll-behavior: contain;
    }
    
    /* Ensure sections expand properly on mobile */
    .sidebar-section.expanded .sidebar-list {
        max-height: none;
        transition: none; /* Remove transitions on mobile for better performance */
    }
    
    /* Optimize section headers for touch */
    .sidebar-section-header {
        padding: 12px 16px 8px 16px; /* Further reduced padding to prevent cutoff */
        font-size: 2rem; /* Much smaller text to match subcategory size */
    }
    
    /* Enhanced mobile hover effects with touch-friendly feedback */
    .sidebar-section-header:hover,
    .sidebar-section-header:active {
        background: #5FD9D9;
        color: #FFFFFF;
        transform: translateX(2px); /* Reduced movement for mobile */
        box-shadow: 0 1px 4px rgba(161, 217, 31, 0.3);
        border-left: 3px solid #A1D91F; /* Thinner border for mobile */
        backdrop-filter: blur(12px); /* Enhanced blur on mobile touch */
    }
    
    /* Mobile-specific header improvements with sticky */
    .sidebar-section-header {
        background: #0FC2C2 !important; /* Stronger background for mobile */
        box-shadow: 0 1px 3px rgba(15, 194, 194, 0.3); /* Subtle shadow for depth */
        /* Improve touch event handling */
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        /* Restore sticky positioning with better touch handling */
        position: sticky;
        top: 0;
        z-index: 15; /* Higher than desktop to ensure it works */
        /* Prevent touch conflicts */
        pointer-events: auto;
        cursor: pointer;
    }
    
    .sidebar-section.expanded .sidebar-section-header {
        background: #5FD9D9 !important; /* Solid background when expanded */
        color: #FFFFFF !important;
        border-bottom: 1px solid rgba(161, 217, 31, 0.4);
    }
    
    /* Mobile arrow hover effect */
    .sidebar-section-header:hover .arrow,
    .sidebar-section-header:active .arrow {
        color: #FFFFFF;
        transform: rotate(-90deg) scale(1.05); /* Smaller scale for mobile */
    }
    
    .sidebar-section.expanded .sidebar-section-header:hover .arrow,
    .sidebar-section.expanded .sidebar-section-header:active .arrow {
        color: #FFFFFF;
        transform: rotate(0deg) scale(1.05);
    }
}

/* Mobile Safari and viewport optimizations */
@supports (-webkit-touch-callout: none) {
    /* iOS Safari specific optimizations */
    .sidebar-content-viewport {
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: contain;
    }
    
    @media (max-width: 900px) {
        .map-container {
            height: 100vh;
            height: -webkit-fill-available; /* iOS Safari viewport fix */
        }
        
        .sidebar-content-viewport {
            max-height: calc(45vh - env(safe-area-inset-bottom, 0px)); /* Account for safe area */
        }
    }
}

/* Ensure smooth scrolling performance on all mobile devices */
@media (max-width: 900px) and (pointer: coarse) {
    .sidebar-content-viewport,
    .sidebar-sections,
    .sidebar .search-results {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        /* Prevent text selection during scroll */
        -webkit-user-select: none;
        -moz-user-select: none;
        user-select: none;
    }
    
    /* Re-enable text selection for specific elements */
    .sidebar-list li,
    .search-results li {
        -webkit-user-select: text;
        -moz-user-select: text;
        user-select: text;
    }
}

.hidden {
    display: none !important;
}

.hotspot-marker-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none; /* allow clicks to pass through to the hotspot */
    z-index: 1;
}

.hotspot[style*='background: none'] {
    background: none !important;
    border: none !important;
} 

/* Sidebar search bar */
.sidebar .search-container {
    position: relative;
    padding: 8px 14px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.sidebar .search-container .search-icon {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: rgba(255, 255, 255, 0.8);
    pointer-events: none;
}
.sidebar .search-container #search-input {
    width: calc(100% - 20px);
    padding: 8px 10px 8px 42px; /* left padding for icon */
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    color: #FFFFFF;
    font-family: 'Nunito Sans', sans-serif;
    font-size: 14px;
    box-sizing: border-box;
}

/* Mobile search input size increase */
@media (max-width: 900px) {
    .sidebar .search-container #search-input {
        padding: 12px 14px 12px 46px;
        font-size: 16px;
        height: 48px;
        box-sizing: border-box;
    }
    
    .sidebar .search-container .search-icon {
        width: 20px;
        height: 20px;
        left: 14px;
    }
}
.sidebar .search-container #search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}
.sidebar .search-container #search-input:focus {
    outline: none;
    border-color: #A1D91F;
    background: rgba(255, 255, 255, 0.12);
}
/* Search results list */
.sidebar .search-results {
    list-style: none;
    margin: 0;
    padding: 0 0 8px 0;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
}
.sidebar .search-results li {
    padding: 6px 14px;
    cursor: pointer;
    font-family: 'Nunito Sans', sans-serif;
    color: rgba(255, 255, 255, 0.9);
    transition: background 0.2s, color 0.2s;
}
.sidebar .search-results li:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #A1D91F;
} 

/* === Simplified Popup Styles === */
.location-popup {
    padding: 12px;
    max-width: 300px;
    font-family: 'Nunito Sans', sans-serif;
}

.location-popup h3 {
    margin: 0 0 8px 0;
    color: #0FC2C2;
    font-family: 'Amatic SC', sans-serif;
    font-size: 2.3em;
    font-weight: 700;
    line-height: 1.2;
}

.location-popup .business-address {
    margin: 6px 0;
    color: #A1D91F;
    font-size: 0.95em;
    font-weight: 700;
}

.location-popup .business-description {
    margin: 8px 0;
    color: rgba(0, 0, 0, 0.7);
    font-size: 0.9em;
    line-height: 1.4;
    font-style: italic;
}

/* New scrollable containers for long descriptions */
.location-popup .business-description-container {
    margin: 8px 0;
    max-height: 120px; /* Larger on desktop - increased from 60px */
    overflow-y: auto;
    padding-right: 8px; /* Space for scrollbar */
    box-sizing: border-box;
    position: relative;
}

/* Add visual indicator for scrollable content */
.location-popup .business-description-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 8px; /* Account for scrollbar space */
    height: 20px; /* Taller on desktop */
    background: linear-gradient(transparent, hsla(var(--white-hsl), 0.9));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.location-popup .business-description-container.has-overflow::after {
    opacity: 1;
}

.location-popup .business-description-container::-webkit-scrollbar {
    width: 8px; /* Slightly wider on desktop */
}

.location-popup .business-description-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.location-popup .business-description-container::-webkit-scrollbar-thumb {
    background: rgba(15, 194, 194, 0.5);
    border-radius: 4px;
}

.location-popup .business-description-container::-webkit-scrollbar-thumb:hover {
    background: rgba(15, 194, 194, 0.7);
}

.location-popup .business-phone {
    margin: 6px 0;
    color: #A1D91F;
    font-size: 0.95em;
    font-weight: 700;
}

.location-popup .business-website {
    margin: 6px 0;
}

.location-popup .business-website a {
    color: #0FC2C2;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95em;
}

.location-popup .business-website a:hover {
    color: #0FC2C2;
    text-decoration: underline;
}

.location-popup .business-hours {
    margin: 6px 0;
    color: rgba(0, 0, 0, 0.6);
    font-size: 0.9em;
}

.location-popup .business-category {
    margin: 6px 0;
    display: inline-block;
    background: rgba(15, 194, 194, 0.1);
    color: #0FC2C2;
    font-size: 0.8em;
    font-weight: 600;
    font-family: 'Quicksand', sans-serif;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

/* Removed business-subcategory - not applicable to this project */
.business-subcategory,
.location-popup .business-subcategory,
#search-subcategory-filter,
.result-subcategory {
    display: none !important;
}

.location-popup .action-buttons {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.location-popup .action-buttons a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    border: none;
    border-radius: 4px;
    font-family: 'Amatic SC', sans-serif;
    font-size: 1.5em;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-decoration: none;
    color: #FFFFFF;
    transition: all 0.3s ease;
}

/* Different colors for different action types - consistent across desktop and mobile */
.location-popup .action-buttons a[href*="maps"] {
    background: #0FC2C2;
    color: #FFFFFF;
}

.location-popup .action-buttons a[href*="maps"]:hover {
    background: #5FD9D9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.location-popup .action-buttons a[href^="tel"] {
    background: #A1D91F;
    color: #FFFFFF;
}

.location-popup .action-buttons a[href^="tel"]:hover {
    background: rgba(161, 217, 31, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.location-popup .first-friday-info {
    background: rgba(161, 217, 31, 0.1);
    padding: 8px;
    margin-top: 10px;
    border-radius: 4px;
    border-left: 3px solid #A1D91F;
}

.location-popup .first-friday-info p:first-child {
    margin: 0;
    color: #0FC2C2;
    font-family: 'Quicksand', sans-serif;
    font-size: 1.05em;
    font-weight: 700;
}

/* Scrollable container for First Friday details */
.location-popup .first-friday-details-container {
    margin-top: 4px;
    max-height: 80px; /* Larger on desktop - increased from 50px */
    overflow-y: auto;
    padding-right: 6px; /* Space for scrollbar */
    box-sizing: border-box;
    position: relative;
}

/* Add visual indicator for scrollable First Friday content */
.location-popup .first-friday-details-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 6px; /* Account for scrollbar space */
    height: 16px; /* Taller on desktop */
    background: linear-gradient(transparent, rgba(161, 217, 31, 0.1));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.location-popup .first-friday-details-container.has-overflow::after {
    opacity: 1;
}

.location-popup .first-friday-details-container::-webkit-scrollbar {
    width: 6px; /* Slightly wider on desktop */
}

.location-popup .first-friday-details-container::-webkit-scrollbar-track {
    background: rgba(161, 217, 31, 0.1);
    border-radius: 3px;
}

.location-popup .first-friday-details-container::-webkit-scrollbar-thumb {
    background: rgba(161, 217, 31, 0.4);
    border-radius: 3px;
}

.location-popup .first-friday-details-container::-webkit-scrollbar-thumb:hover {
    background: rgba(161, 217, 31, 0.6);
}

.location-popup .first-friday-info p:last-child {
    margin: 0;
    color: rgba(0, 0, 0, 0.7);
    font-family: 'Nunito Sans', sans-serif;
    font-size: 0.9em;
    line-height: 1.3;
}

/* Mobile responsive adjustments for popups */
@media (max-width: 768px) {
    .location-popup {
        padding: 12px;
        max-width: min(300px, calc(100vw - 80px)); /* Smaller for better fit */
        min-width: 240px; /* Reduced minimum width */
        box-sizing: border-box;
    }
    
    /* Enhanced mobile popup styling */
    .mobile-popup {
        max-width: min(280px, calc(100vw - 100px)) !important; /* Even more compact */
        font-size: 1em; /* Increased from 0.9em for better readability */
    }
    
    .location-popup h3 {
        font-size: 2.5em; /* Increased from 1.1em */
        margin-bottom: 6px; /* Reduced spacing */
        line-height: 1.2;
    }
    
    .location-popup .business-address {
        font-size: 0.9em; /* Increased from 0.85em */
        line-height: 1.3;
        margin-bottom: 4px;
    }
    
    /* Mobile-only smaller description container with larger text */
    .location-popup .business-description-container {
        margin: 6px 0;
        max-height: 90px; /* Mobile size - override desktop 120px */
        font-size: 0.95em; /* Increased from 0.85em */
        line-height: 1.4; /* Increased for better readability */
    }
    
    .location-popup .business-description {
        font-size: 1em; /* Increased from 0.85em for much better readability */
        line-height: 1.4; /* Increased from 1.3 */
        margin: 0; /* Remove default margin since container handles it */
    }
    
    .location-popup .business-phone {
        font-size: 0.9em; /* Increased from 0.85em */
        margin-bottom: 4px;
    }
    
    /* Improved mobile website button with larger text */
    .location-popup .business-website {
        font-size: 1em; /* Increased from 0.9em */
        margin-bottom: 6px;
    }
    
    .location-popup .business-website a {
        font-size: 1.05em; /* Increased from 0.95em for better visibility */
        padding: 4px 8px; /* Increased padding from 2px 4px */
        display: inline-block;
        min-height: 28px; /* Increased from 24px */
        font-weight: 500; /* Make it slightly bolder */
    }
    
    .location-popup .business-category,
    .location-popup .business-subcategory {
        font-size: 0.75em; /* Increased from 0.7em */
        padding: 2px 6px;
        margin: 2px 4px 4px 0;
    }
    
    .location-popup .action-buttons {
        flex-direction: row; /* Side by side for better use of space */
        gap: 6px;
        margin-top: 8px;
    }
    
    .location-popup .action-buttons a {
        justify-content: center;
        padding: 12px 14px; /* Increased padding from 10px 12px */
        font-size: 1.2rem; /* Increased from 0.85em */
        min-height: 44px; /* Increased from 40px for better touch target */
        box-sizing: border-box;
        flex: 1; /* Equal width buttons */
    }
    
    .location-popup .first-friday-info {
        margin-top: 6px;
        padding: 6px;
        font-size: 0.85em; /* Increased from 0.8em */
    }
    
    /* Mobile-only smaller First Friday details with larger text */
    .location-popup .first-friday-details-container {
        max-height: 80px; /* Mobile size - override desktop 80px */
        font-size: 0.9em; /* Increased from 0.8em */
    }
    
    .location-popup .first-friday-info p {
        margin-bottom: 3px;
        line-height: 1.3; /* Increased from 1.2 */
    }
    
    .location-popup .first-friday-info p:last-child {
        margin: 0; /* Container handles spacing */
        line-height: 1.3; /* Increased from 1.2 */
    }
    
    /* Enhanced mobile scrollbars with better visibility */
    .location-popup .business-description-container::-webkit-scrollbar,
    .location-popup .first-friday-details-container::-webkit-scrollbar {
        width: 14px; /* Even wider for better touch interaction - increased from 12px */
    }
    
    .location-popup .business-description-container::-webkit-scrollbar-track,
    .location-popup .first-friday-details-container::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.4); /* More visible - increased from 0.3 */
        border-radius: 7px;
    }
    
    .location-popup .business-description-container::-webkit-scrollbar-thumb,
    .location-popup .first-friday-details-container::-webkit-scrollbar-thumb {
        background: rgba(15, 194, 194, 0.9); /* More visible - increased from 0.8 */
        border-radius: 7px;
        border: 2px solid rgba(255, 255, 255, 0.3); /* More contrast */
    }
    
    .location-popup .business-description-container::-webkit-scrollbar-thumb:hover,
    .location-popup .first-friday-details-container::-webkit-scrollbar-thumb:hover {
        background: #0FC2C2; /* Full opacity on hover */
    }
    
    /* iOS momentum scrolling and touch-friendly scrolling */
    .location-popup .business-description-container,
    .location-popup .first-friday-details-container {
        -webkit-overflow-scrolling: touch; /* iOS momentum scrolling */
        scroll-behavior: smooth;
        overscroll-behavior: contain; /* Prevent scroll chaining */
        overflow-y: auto !important; /* Force scrolling on mobile */
    }
    
    /* Enhanced mobile visual indicators with better contrast and always visible */
    .location-popup .business-description-container::after {
        height: 30px; /* Even taller fade on mobile for better visibility - increased from 25px */
        background: linear-gradient(transparent, hsla(var(--white-hsl), 0.98));
        opacity: 0; /* Start hidden - only show when has-overflow class is present */
        transition: opacity 0.3s ease;
    }
    
    .location-popup .business-description-container.has-overflow::after {
        opacity: 1; /* Only show when content actually overflows */
    }
    
    .location-popup .first-friday-details-container::after {
        height: 25px; /* Taller fade on mobile - increased from 20px */
        background: linear-gradient(transparent, hsla(var(--accent-hsl), 0.25)); /* More visible */
        opacity: 0; /* Start hidden - only show when has-overflow class is present */
        transition: opacity 0.3s ease;
    }
    
    .location-popup .first-friday-details-container.has-overflow::after {
        opacity: 1; /* Only show when content actually overflows */
    }
    
    /* Prevent popup from being too close to screen edges */
    .leaflet-popup {
        margin: 15px !important;
    }
    
    /* Ensure popup content doesn't overflow and stays compact */
    .leaflet-popup-content {
        margin: 12px 16px !important;
        max-width: none !important;
        overflow-wrap: break-word;
        overflow: visible !important; /* Allow internal scrolling - changed from hidden */
        word-wrap: break-word;
    }
    
    /* Better popup positioning on mobile */
    .leaflet-popup-content-wrapper {
        border-radius: 8px !important;
        box-shadow: 0 6px 20px rgba(0,0,0,0.15) !important;
        border: 2px solid #0FC2C2 !important;
        background-color: #FFFFFF !important;
    }
    
    /* Prevent popup tip from causing positioning issues */
    .leaflet-popup-tip {
        margin: 0 auto !important;
        background-color: #FFFFFF !important;
        border-left-color: #0FC2C2 !important;
        border-right-color: #0FC2C2 !important;
    }
}

/* Desktop Leaflet popup styling */
.leaflet-popup-content-wrapper {
    border-radius: 8px !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1) !important;
    border: 2px solid #0FC2C2 !important;
    background-color: #FFFFFF !important;
}

.leaflet-popup-tip {
    background-color: #FFFFFF !important;
}

/* Mobile responsive adjustments for admin forms */
@media (max-width: 768px) {
    .form-group input,
    .form-group textarea,
    .form-group select {
        width: calc(100% - 20px);
        max-width: calc(100vw - 40px);
        box-sizing: border-box;
    }
    
    .data-section {
        padding: 15px 10px;
    }
    
    .admin-panel {
        padding: 15px 10px;
    }
    
    .business-list {
        max-width: calc(100vw - 40px);
    }
} 


/* Modern Filter Chips Styles */
.filter-chips-container {
    padding: 16px 20px 8px 20px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.filter-chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.filter-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    font-family: 'Quicksand', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    position: relative; /* Enable dropdown positioning relative to each chip */
}

.filter-chip:hover:not(.disabled),
.filter-chip:focus:not(.disabled) {
    background: rgba(161, 217, 31, 0.12);
    border-color: rgba(161, 217, 31, 0.3);
    transform: translateY(-1px);
    outline: none;
}

.filter-chip:focus:not(.disabled) {
    box-shadow: 0 0 0 2px rgba(161, 217, 31, 0.4);
}

.filter-chip.active {
    background: rgba(161, 217, 31, 0.2);
    border-color: rgba(161, 217, 31, 0.6);
    color: #A1D91F;
}

.filter-chip.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.filter-chip.disabled:hover {
    transform: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.chip-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.chip-text {
    flex: 1;
    white-space: nowrap;
}

.chip-arrow {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.filter-chip.active .chip-arrow {
    transform: rotate(180deg);
}

/* Toggle chips (for checkboxes) */
.toggle-chip.active {
    background: rgba(161, 217, 31, 0.25);
    border-color: rgba(161, 217, 31, 0.8);
    color: #A1D91F;
    box-shadow: 0 2px 8px rgba(161, 217, 31, 0.3);
}

/* Filter Dropdowns */
.dropdown-icon {
    width: 28px;
    height: 28px;
    margin-right: 10px;
    vertical-align: middle;
    display: inline-block;
}

.filter-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(255, 255, 255, 0.98);
    border: 2px solid #0FC2C2;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(12px);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 4px;
    width: 250px;
}

.dropdown-option {
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
    font-family: 'Nunito Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #0FC2C2;
    border-bottom: 1px solid rgba(15, 194, 194, 0.1);
    display: flex;
    align-items: center;
}

.dropdown-option:last-child {
    border-bottom: none;
}

.dropdown-option:hover,
.dropdown-option:focus {
    background: rgba(15, 194, 194, 0.1);
    color: #0FC2C2;
    outline: none;
}

.dropdown-option.selected {
    background: rgba(161, 217, 31, 0.2);
    color: #A1D91F;
    font-weight: 700;
}

/* Mobile optimizations */
@media (max-width: 900px) {
    .filter-chips-container {
        padding: 12px 16px 6px 16px;
    }
    
    .filter-chip {
        padding: 10px 14px;
        font-size: 15px;
        border-radius: 22px;
    }
    
    .chip-icon {
        width: 22px;
        height: 22px;
    }
    
    .chip-arrow {
        width: 16px;
        height: 16px;
    }
    
    /* Ensure mobile dropdown matches desktop background color */
    .filter-dropdown {
        background: rgba(255, 255, 255, 0.98) !important;
        border: 2px solid #0FC2C2 !important;
    }
    
    .dropdown-option {
        color: #0FC2C2 !important;
        border-bottom: 1px solid rgba(15, 194, 194, 0.1) !important;
    }
    
    .dropdown-option:hover,
    .dropdown-option:focus {
        background: rgba(15, 194, 194, 0.1) !important;
        color: #0FC2C2 !important;
    }
    
    .dropdown-option {
        padding: 16px 20px;
        font-size: 16px;
    }
}

/* Enhanced Search Functionality Styles */
.search-filters {
    margin-top: 10px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    border: 1px solid rgba(161, 217, 31, 0.15);
}

.search-filter-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
    margin-bottom: 8px;
}

.search-filter-row select {
    flex: 1;
    min-width: 140px;
    padding: 6px 8px;
    border: 1px solid rgba(161, 217, 31, 0.3);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.9);
    font-family: 'Nunito Sans', sans-serif;
    font-size: 0.85em;
}

.search-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.8);
    font-family: 'Nunito Sans', sans-serif;
    cursor: pointer;
    white-space: nowrap;
}

.search-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #A1D91F;
}

.search-stats {
    font-size: 0.8em;
    color: rgba(161, 217, 31, 0.8);
    font-family: 'Quicksand', sans-serif;
    font-style: italic;
    margin-top: 6px;
    margin-bottom: 12px;
}

/* Tab Headers */
.tab-header {
    padding: 16px 20px 12px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 8px;
}

.tab-header h3 {
    margin: 0 0 6px 0;
    color: #A1D91F;
    font-family: 'Quicksand', sans-serif;
    font-size: 1.1em;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.tab-header p {
    margin: 0;
    color: rgba(255, 255, 255, 0.7);
    font-family: 'Nunito Sans', sans-serif;
    font-size: 0.85em;
    line-height: 1.4;
}

/* Enhanced Search Results */
.search-result-item {
    padding: 12px;
    border-bottom: 1px solid rgba(161, 217, 31, 0.1);
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-result-item:hover {
    background: rgba(161, 217, 31, 0.08);
}

.search-result-item .result-content h4 {
    margin: 0 0 6px 0;
    color: rgba(255, 255, 255, 0.95);
    font-family: 'Quicksand', sans-serif;
    font-size: 1.1em;
    font-weight: 600;
}

.search-result-item .result-address {
    margin: 4px 0;
    color: #A1D91F;
    font-size: 0.85em;
    font-weight: 500;
    font-family: 'Nunito Sans', sans-serif;
}

.search-result-item .result-description {
    margin: 6px 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8em;
    font-style: italic;
    line-height: 1.3;
    font-family: 'Nunito Sans', sans-serif;
}

.search-result-item .result-hours,
.search-result-item .result-phone {
    margin: 4px 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8em;
    font-family: 'Nunito Sans', sans-serif;
}

.search-result-item .result-first-friday-details {
    margin: 6px 0;
    padding: 6px 8px;
    background: rgba(161, 217, 31, 0.1);
    border-left: 3px solid #A1D91F;
    border-radius: 3px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.8em;
    font-style: italic;
    line-height: 1.3;
    font-family: 'Nunito Sans', sans-serif;
}

.result-badges {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.result-category {
    background: rgba(161, 217, 31, 0.15);
    color: #A1D91F;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7em;
    font-weight: 600;
    text-transform: uppercase;
    font-family: 'Quicksand', sans-serif;
}

.result-badge {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7em;
    font-weight: 500;
    font-family: 'Nunito Sans', sans-serif;
}

.result-badge.first-friday {
    background: rgba(161, 217, 31, 0.15);
    color: #A1D91F;
    font-weight: 600;
    text-transform: uppercase;
}

/* Search text highlighting */
.search-highlight {
    background: rgba(161, 217, 31, 0.4);
    color: #FFFFFF;
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    border: 1px solid rgba(161, 217, 31, 0.6);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Additional styling for result category when highlighted */
.result-category {
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 6px;
    font-style: italic;
}

.no-results {
    padding: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-family: 'Nunito Sans', sans-serif;
}

.no-results p {
    margin: 0 0 8px 0;
    font-size: 0.9em;
}

.no-results small {
    font-size: 0.8em;
    opacity: 0.8;
}

/* Mobile Search Enhancements */
@media (max-width: 900px) {
    .tab-header {
        padding: 14px 12px 10px 12px;
        margin-bottom: 6px;
    }
    
    .tab-header h3 {
        font-size: 1.05em;
    }
    
    .tab-header p {
        font-size: 0.8em;
    }

    .search-filter-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .search-filter-row select {
        min-width: auto;
        height: 66px;
        font-size: 1.1em;
        padding: 12px 16px;
    }

    .search-checkbox {
        justify-content: flex-start;
        padding: 12px 8px;
        background: hsla(var(--white-hsl), 0.02);
        font-size: 1.1em;
    }

    .search-stats {
        font-size: 1.0em;
        color: #A1D91F;
        font-weight: 700;
        font-family: 'Quicksand', sans-serif;
        margin: 8px 0;
        padding: 12px 16px;
        background: rgba(161, 217, 31, 0.15);
        border-radius: 8px;
        border: 2px solid rgba(161, 217, 31, 0.5);
        text-align: center;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        position: sticky;
        top: 0;
        z-index: 10;
    }

    .search-checkbox input[type="checkbox"] {
        width: 20px;
        height: 20px;
        margin-right: 10px;
    }

    .search-result-item {
        padding: 20px 16px;
        margin-bottom: 8px;
        background: hsla(var(--white-hsl), 0.05);
        border-radius: 8px;
        border: 1px solid hsla(var(--accent-hsl), 0.1);
    }

    .search-result-item .result-content h4 {
        font-size: 1.2em;
        margin-bottom: 8px;
        color: #A1D91F;
    }

    .search-highlight {
        padding: 3px 6px;
        font-size: 1.05em;
        border-radius: 5px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    }

    .search-results {
        padding: 16px 0;
        margin-top: 16px;
        border-top: 1px solid hsla(var(--white-hsl), 0.1);
        max-height: calc(100vh - 300px);
        overflow-y: auto;
    }

    .search-filters-container {
        margin-bottom: 16px;
        padding-bottom: 16px;
        border-bottom: 1px solid hsla(var(--white-hsl), 0.1);
    }
}

/* === Improved Popup Styles === */
/* Business name hover tooltips (desktop only) */
.business-name-tooltip {
    background: hsla(var(--darkAccent-hsl), 0.95) !important;
    color: hsla(var(--white-hsl), 1) !important;
    border: 1px solid hsla(var(--lightAccent-hsl), 0.3) !important;
    border-radius: 6px !important;
    font-family: 'Nunito Sans', sans-serif !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    padding: 6px 10px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    backdrop-filter: blur(8px) !important;
    z-index: 999 !important; /* Below popup z-index to avoid conflicts */
    white-space: nowrap !important;
}

/* Hide tooltips when popup is open to prevent conflicts */
.popup-open .business-name-tooltip {
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Tooltip arrow styling */
.business-name-tooltip::before {
    border-top-color: hsla(var(--darkAccent-hsl), 0.95) !important;
}

/* Hide search bar and filter chips when popup is open */
/* Hide search bar when popup is open to prevent obstruction */
.popup-open .top-search,
.popup-open .compact-search-container,
.popup-open .filter-chips-container {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.3s ease !important;
}


/* Bigger close button for popups */
.leaflet-popup-close-button {
    /* Desktop-default sizing: smaller, cleaner */
    width: 24px !important;
    height: 24px !important;
    font-size: 18px !important;
    line-height: 22px !important;
    text-align: center !important;
    background: #0FC2C2 !important;
    border-radius: 50% !important;
    border: 2px solid #A1D91F !important;
    color: #FFFFFF !important;
    font-weight: bold !important;
    transition: all 0.2s ease !important;
    right: 8px !important;
    top: 8px !important;
    z-index: 10000 !important; /* Ensure it's above everything */
    pointer-events: auto !important; /* Ensure it can be clicked */
    position: absolute !important; /* Explicit positioning */
    display: block !important; /* Ensure visibility */
}

.leaflet-popup-close-button:hover {
    background: #0FC2C2 !important;
    color: #FFFFFF !important;
    border-color: #A1D91F !important;
    transform: scale(1.05) !important;
}

@media (max-width: 768px) {
    .leaflet-popup-close-button {
        /* Standard mobile close button size */
        width: 28px !important;
        height: 28px !important;
        font-size: 18px !important;
        line-height: 24px !important;
        z-index: 10001 !important;
        pointer-events: auto !important;
        touch-action: manipulation !important;
        -webkit-tap-highlight-color: transparent !important;
        position: absolute !important;
        /* Enhanced mobile reliability */
        background: #0FC2C2 !important;
        border: 2px solid #FFFFFF !important;
        color: #FFFFFF !important;
        /* Prevent touch conflicts */
        -webkit-touch-callout: none !important;
        -webkit-user-select: none !important;
        -moz-user-select: none !important;
        -ms-user-select: none !important;
        user-select: none !important;
        /* Force interaction */
        cursor: pointer !important;
        /* Adequate touch area */
        min-width: 36px !important;
        min-height: 36px !important;
        padding: 0 !important;
        margin: 0 !important;
        /* Isolation */
        isolation: isolate !important;
        will-change: transform !important;
        /* Position outside popup content area */
        right: -8px !important;
        top: -8px !important;
        border-radius: 50% !important;
    }
    
    /* Mobile close button hover/active states */
    .leaflet-popup-close-button:hover,
    .leaflet-popup-close-button:active,
    .leaflet-popup-close-button:focus {
        background: #A1D91F !important;
        color: #FFFFFF !important;
        border-color: #FFFFFF !important;
        transform: scale(1.02) !important;
        z-index: 10002 !important;
    }
} 

/* --- Mobile Filters Toggle Styles --- */
@media (max-width: 900px) {
    .mobile-filters-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 18px;
        background: rgba(161, 217, 31, 0.3);
        color: #FFFFFF;
        border-left: 4px solid #A1D91F;
        font-family: 'Quicksand', sans-serif;
        font-size: 1.05em;
        font-weight: 600;
        cursor: pointer;
        user-select: none;
    }
    .mobile-filters-toggle .arrow {
        transition: transform 0.2s ease;
        color: inherit;
    }
    /* search-filters-container distinct bg */
    .search-filters-container {
         margin-bottom: 16px;
         padding-bottom: 16px;
         border-bottom: 1px solid rgba(255, 255, 255, 0.1);
         background: rgba(161, 217, 31, 0.3);
         padding-top: 16px;
    }
}

/* adjust collapsed rule to account for search-stats after container */
@media (max-width: 900px) {
  .search-filters-container.collapsed ~ .search-results {
      margin-top: 0;
  }
} 

/* Add near the beginning of search filter styles */
.search-filters-container {
    padding: 12px 24px 0 24px;
}

/* Hide the mobile toggle by default (desktop) */
@media (min-width: 901px) {
  .mobile-filters-toggle {
      display: none;
  }
}

/* Constrain dropdown width (desktop) */
.search-filter-row select {
    max-width: 260px;
} 

/* Prevent nested scroll trapping in mobile search results */
@media (max-width: 900px) {
  .search-results {
    max-height: none !important;
    overflow-y: visible !important;
  }
} 

@media (max-width: 900px) {
    /* ensure collapsed container hides */
    .search-filters-container.collapsed {
        display: none !important;
    }
} 

/* Map marker clusters */
.marker-cluster-small {
    background-color: rgba(15, 194, 194, 0.6);
    border: 2px solid #0FC2C2;
}
.marker-cluster-small div {
    background-color: rgba(15, 194, 194, 0.7);
    width: 28px;
    height: 28px;
    margin-left: 6px;
    margin-top: 6px;
    font-size: 11px;
    line-height: 28px;
}

.marker-cluster-medium {
    background-color: rgba(161, 217, 31, 0.6);
    border: 2px solid #A1D91F;
}
.marker-cluster-medium div {
    background-color: rgba(161, 217, 31, 0.7);
    width: 30px;
    height: 30px;
    margin-left: 5px;
    margin-top: 5px;
    font-size: 12px;
    line-height: 30px;
}

.marker-cluster-large {
    background-color: rgba(15, 194, 194, 0.8);
    border: 2px solid #0FC2C2;
}
.marker-cluster-large div {
    background-color: rgba(15, 194, 194, 0.9);
    width: 32px;
    height: 32px;
    margin-left: 4px;
    margin-top: 4px;
    font-size: 13px;
    line-height: 32px;
}

.marker-cluster {
    border-radius: 50%;
    text-align: center;
    font-family: inherit;
    font-weight: bold;
    transition: all 0.2s ease;
    cursor: pointer;
}

.marker-cluster div {
    border-radius: 50%;
    text-align: center;
    color: white;
    font-weight: bold;
}

.marker-cluster:hover {
    transform: scale(1.1);
}

/* Cluster spiderfy lines (when clusters expand) */
.leaflet-cluster-anim .leaflet-marker-icon, .leaflet-cluster-anim .leaflet-marker-shadow {
    transition: transform 0.3s ease-out, opacity 0.3s ease-in;
}

/* Ensure cluster icons are always visible */
.marker-cluster {
    z-index: 100;
}

/* === Map Tile Colorway (DWI Branding) === */
/* Strong turquoise/teal tint for DWI branding */
.leaflet-tile-pane {
    filter: hue-rotate(150deg) saturate(1.4) brightness(0.95) contrast(1.05);
}

/* Turquoise overlay with blend mode for stronger DWI feel */
.leaflet-tile-pane::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(15, 194, 194, 0.18); /* #0FC2C2 at higher opacity */
    pointer-events: none;
    mix-blend-mode: multiply;
    z-index: 1;
}

/* Mobile optimizations for clusters */
@media (max-width: 768px) {
    .marker-cluster {
        /* Slightly larger touch targets on mobile */
        transform: scale(1.1);
    }
    
    .marker-cluster div {
        width: 32px;
        height: 32px;
        line-height: 32px;
        font-size: 13px;
    }
} 

/* === Floating Search & Filter Overlay (Mobile & Desktop) === */
.top-search {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: min(500px, calc(100vw - 32px));
    z-index: 2100;
    display: block;
}

/* Desktop: wider search bar */
@media (min-width: 901px) {
    .top-search {
        width: min(700px, calc(100vw - 64px));
    }
}

/* Intermediate screen sizes: adjust search position to avoid sidebar overlap */
@media (min-width: 769px) and (max-width: 1200px) {
    .top-search {
        left: calc(50% + 200px) !important; /* Increased offset to account for sidebar */
        width: min(450px, calc(100vw - 450px)) !important; /* Adjust width to fit */
    }
}

/* Smaller desktop screens: more aggressive positioning adjustment */
@media (min-width: 901px) and (max-width: 1000px) {
    .top-search {
        left: calc(50% + 180px) !important; /* Increased offset for smaller screens */
        width: min(350px, calc(100vw - 500px)) !important; /* Adjusted width */
    }
}

/* Adjust filter overlay positioning to match search bar */
@media (min-width: 769px) and (max-width: 1200px) {
    .filter-overlay {
        left: calc(50% + 200px) !important; /* Match search bar offset */
        width: min(450px, calc(100vw - 450px)) !important; /* Match search bar width */
        transform: translateX(-50%) !important; /* Ensure transform is maintained */
    }
}

@media (min-width: 901px) and (max-width: 1000px) {
    .filter-overlay {
        left: calc(50% + 180px) !important; /* Match search bar offset */
        width: min(350px, calc(100vw - 500px)) !important; /* Match search bar width */
        transform: translateX(-50%) !important; /* Ensure transform is maintained */
    }
}

.top-search-inner {
    position: relative;
    background: transparent;
    border: none;
    border-radius: 25px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 4px;
}

.top-search .search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #0FC2C2;
    pointer-events: none;
}

.top-search #search-input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: none;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.95);
    color: #0FC2C2;
    font-size: 16px;
    font-family: 'Nunito Sans', sans-serif;
    box-sizing: border-box;
    outline: none;
    backdrop-filter: blur(8px);
}

.top-search #search-input::placeholder {
    color: rgba(15, 194, 194, 0.6);
}

.top-search #search-input:focus {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 0 0 2px #A1D91F;
}

.filter-overlay {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: min(500px, calc(100vw - 32px));
    z-index: 2000;
    display: block;
    padding: 0 16px;
}

/* Medium-large screens: handle the gap between responsive and full desktop */
@media (min-width: 1201px) and (max-width: 1470px) {
    .top-search {
        left: calc(50% + 100px) !important; /* Offset to avoid sidebar */
        width: min(600px, calc(100vw - 400px)) !important;
    }
    
    .filter-overlay {
        left: calc(50% + 100px) !important; /* Match search bar offset */
        width: min(600px, calc(100vw - 400px)) !important;
        transform: translateX(-50%) !important;
    }
}

/* Desktop: wider filter overlay to match search bar (only for very wide screens) */
@media (min-width: 1471px) {
    .filter-overlay {
        width: min(700px, calc(100vw - 64px));
    }
}

/* Override the sidebar filter chips with floating styles */
.filter-overlay .filter-chips-container {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.filter-overlay .filter-chips-container::-webkit-scrollbar {
    display: none;
}

.filter-overlay .filter-chips-row {
    display: flex;
    gap: 10px;
    margin-bottom: 0;
    flex-wrap: nowrap;
    min-width: max-content;
    padding: 8px 0;
}

.filter-overlay .filter-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: #A1D91F;
    border: none;
    border-radius: 25px;
    color: #FFFFFF;
    font-family: 'Quicksand', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    backdrop-filter: blur(8px);
    flex-shrink: 0;
    white-space: nowrap;
}

/* Dropdown positioning for filter chips */
.filter-overlay .filter-chip {
    position: relative;
}

.filter-overlay .filter-chip:hover {
    background: rgba(161, 217, 31, 0.8);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.filter-overlay .filter-chip.active {
    background: #0FC2C2;
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.filter-overlay .filter-chip.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Hide search and directory tabs since we have floating search and merged content */
.sidebar-icon[title="Search"],
.sidebar-tab:has(.sidebar-icon[title="Search"]),
.sidebar-icons {
    display: none;
}

/* Simple Arrow Button for Sidebar Toggle */
.sidebar-arrow-btn {
    position: absolute; /* Absolute within sidebar */
    top: 50%;
    right: -16px; /* Half outside sidebar on the right edge */
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: #0FC2C2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2500; /* Higher z-index to stay above map */
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border: 2px solid #A1D91F;
    backdrop-filter: blur(8px);
}

.sidebar-arrow-btn svg {
    width: 18px;
    height: 18px;
    color: hsla(var(--white-hsl), 1);
    transition: transform 0.3s ease;
}

.sidebar-arrow-btn:hover {
    background: #5FD9D9;
    border-color: #A1D91F;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

/* Arrow direction changes based on sidebar state */
.sidebar.minimized .sidebar-arrow-btn svg {
    transform: rotate(180deg); /* Points right when closed */
}

/* Desktop minimized sidebar behavior */
@media (min-width: 901px) {
    .sidebar.minimized {
        transform: translateX(calc(-100% + 32px)); /* Slide left but keep arrow button visible */
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .sidebar:not(.minimized) {
        transform: translateX(0);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    /* Adjust arrow button position when minimized */
    .sidebar.minimized ~ * .sidebar-arrow-btn,
    .sidebar.minimized + .sidebar-arrow-btn {
        left: 16px; /* Move to left when sidebar is minimized */
    }
    
    /* Map expands when sidebar is minimized on desktop */
    .sidebar.minimized ~ #map {
        margin-left: 32px !important; /* Leave space for arrow button */
        width: calc(100% - 32px) !important;
    }
    
    /* Hide sidebar content when minimized on desktop */
    .sidebar.minimized .sidebar-content-viewport,
    .sidebar.minimized .sidebar-icons {
        opacity: 0;
        pointer-events: none;
    }
}

/* Old button styles removed - replaced with universal tab lever */

/* Mobile floating toggle button - positioned away from Leaflet conflicts */
@media (max-width: 900px) {
    /* Hide the old arrow button on mobile */
    .sidebar-arrow-btn {
        display: none !important;
    }
    
    /* Create new floating toggle button */
    .mobile-menu-toggle {
        position: fixed !important;
        bottom: 20px !important;
        right: 20px !important;
        width: 56px;
        height: 56px;
        background: #0FC2C2;
        border: 2px solid #A1D91F;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 10000 !important;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
        backdrop-filter: blur(12px);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        pointer-events: auto !important;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(161, 217, 31, 0.3);
        user-select: none;
        -webkit-user-select: none;
    }
    
    .mobile-menu-toggle:hover {
        transform: scale(1.1);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
        background: #5FD9D9;
        border-color: #A1D91F;
    }
    
    .mobile-menu-toggle svg {
        width: 24px;
        height: 24px;
        color: #FFFFFF;
        transition: transform 0.3s ease;
    }
    
    /* Different icon when sidebar is minimized */
    .sidebar.minimized ~ .mobile-menu-toggle svg {
        transform: rotate(180deg);
    }
}

/* Hide mobile menu toggle on desktop */
@media (min-width: 901px) {
    .mobile-menu-toggle {
        display: none !important;
    }
}

@media (max-width: 900px) {
    .top-search {
        width: min(400px, calc(100vw - 32px));
    }
    
    .filter-chip .chip-icon {
        width: 16px;
        height: 16px;
        flex-shrink: 0;
    }
    
    .filter-chip .chip-arrow {
        width: 14px;
        height: 14px;
        flex-shrink: 0;
    }
    
    .filter-dropdown {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: hsla(var(--darkAccent-hsl), 0.98);
        border: 1px solid hsla(var(--white-hsl), 0.2);
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
        margin-top: 4px;
        max-height: 200px;
        overflow-y: auto;
        z-index: 3000;
    }
    
    .dropdown-option {
        padding: 12px 16px;
        color: hsla(var(--white-hsl), 0.9);
        cursor: pointer;
        transition: background 0.2s ease;
        font-family: 'Poppins', sans-serif;
        font-size: 14px;
    }
    
    .dropdown-option:hover {
        background: hsla(var(--white-hsl), 0.1);
    }
    
    .dropdown-option.selected {
        background: hsla(var(--lightAccent-hsl), 0.2);
        color: hsla(var(--lightAccent-hsl), 1);
    }
}

/* One-time disclaimer bubble */
@media (max-width: 900px) {
    .directory-disclaimer {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: #A1D91F;
        color: #0FC2C2;
        padding: 16px 20px;
        border-radius: 12px;
        box-shadow: 0 8px 24px rgba(0,0,0,0.3);
        z-index: 3500;
        max-width: min(400px, calc(100vw - 40px));
        text-align: center;
        font-family: 'Nunito Sans', sans-serif;
    }
    
    .directory-disclaimer p {
        margin: 0 0 12px 0;
        font-size: 15px;
        line-height: 1.4;
    }
    
    .disclaimer-btn {
        background: #0FC2C2;
        color: #FFFFFF;
        border: none;
        padding: 8px 16px;
        border-radius: 6px;
        font-family: 'Quicksand', sans-serif;
        font-weight: 600;
        cursor: pointer;
        transition: background 0.2s ease;
    }
    
    .disclaimer-btn:hover {
        background: #5FD9D9;
    }
}

/* Enhanced mobile scrollbars with better visibility */
.location-popup .business-description-container::-webkit-scrollbar,
.location-popup .first-friday-details-container::-webkit-scrollbar {
    width: 10px; /* Wider for better touch interaction */
}

.location-popup .business-description-container::-webkit-scrollbar-track,
.location-popup .first-friday-details-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
}

.location-popup .business-description-container::-webkit-scrollbar-thumb,
.location-popup .first-friday-details-container::-webkit-scrollbar-thumb {
    background: rgba(15, 194, 194, 0.7);
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.location-popup .business-description-container::-webkit-scrollbar-thumb:hover,
.location-popup .first-friday-details-container::-webkit-scrollbar-thumb:hover {
    background: rgba(15, 194, 194, 0.9);
}

/* iOS momentum scrolling and touch-friendly scrolling */
.location-popup .business-description-container,
.location-popup .first-friday-details-container {
    -webkit-overflow-scrolling: touch; /* iOS momentum scrolling */
    scroll-behavior: smooth;
    overscroll-behavior: contain; /* Prevent scroll chaining */
}

/* Enhanced mobile visual indicators with better contrast */
.location-popup .business-description-container::after {
    height: 20px; /* Taller fade on mobile for better visibility */
    background: linear-gradient(transparent, hsla(var(--white-hsl), 0.95));
}

.location-popup .first-friday-details-container::after {
    height: 16px; /* Taller fade on mobile */
    background: linear-gradient(transparent, hsla(var(--accent-hsl), 0.15));
}
