/* VPF Venues - Core Styles */

/* Screen Reader Only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Hidden State for Filtering - More specific selector */
.venue-card.vpf-hidden {
  display: none !important;
  opacity: 0;
  transform: scale(0.95);
}

.venue-card.vpf-visible {
  display: flex !important;
  animation: vpfFadeIn 0.3s ease-out forwards;
}

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

/* Feature Chips */
.feature-chip {
  background: rgba(102, 126, 234, .1) !important;
  color: #667eea !important;
  padding: 4px 8px !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  border-radius: 12px !important;
}

/* Base Container */
.venue-filter-container {
  --vpf-primary: #667eea;
  --vpf-primary-2: #764ba2;
  --vpf-dark: #2d3748;
  --vpf-text: #4a5568;
  --accent: var(--nv-secondary-accent, #f2be00);
  --chip-bg: rgba(255,255,255,.18);
  --chip-bg-active: rgba(255,255,255,.32);
  --chip-radius: 999px;
  --chip-py: 6px;
  --chip-px: 14px;

  max-width: 1200px;
  margin: 24px auto;
  padding: 20px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  font-family: system-ui, -apple-system, sans-serif;
}
.venue-filter-container * { box-sizing: border-box; }

/* Toolbar */
.vpf-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  min-height: 60px;
}

#activeFiltersSummary {
  flex: 1;
  color: #4a5568;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 12px;
  background: rgba(102, 126, 234, 0.08);
  border-radius: 8px;
  min-height: 36px;
  display: flex;
  align-items: center;
}

#activeFiltersSummary:empty {
  display: none;
}

.vpf-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vpf-sort select {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  min-width: 210px;
  font-weight: 600;
  color: var(--vpf-dark);
}

.clear-filters {
  background: linear-gradient(135deg, #ff6b6b, #ffa500);
  color: #fff;
  border: 0;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(255,107,107,.35);
}

.vpf-results {
  background: rgba(0,0,0,.06);
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 600;
}

/* Controls Panel */
.vpf-controls {
  background: linear-gradient(135deg, var(--vpf-primary), var(--vpf-primary-2));
  color: #fff;
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
  margin-bottom: 20px;
  min-height: 580px;
  transition: all 0.3s ease;
}

#vpf-filter-toggle {
  display: none !important;
}



.vpf-group {
  border: 1px dashed rgba(255,255,255,.4);
  border-radius: 12px;
  padding: 12px;
  margin: 0;
}

.vpf-group > legend {
  font-weight: 800;
  font-size: 14px;
  letter-spacing: .02em;
  margin-bottom: 8px;
}

/* Range Sliders */
.vpf-range {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
}

.vpf-range input[type="range"] {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,.35);
  outline: 0;
  -webkit-appearance: none;
}

.vpf-range input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(45deg, #ff6b6b, #ffa500);
  cursor: pointer;
}

.vpf-range-value {
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(255,255,255,.15);
}

/* Controls Layout */
@media (min-width: 900px) {
  .vpf-controls {
    display: grid;
    grid-template-columns: 320px 1fr;
    grid-template-areas:
      "day types"
      "price types"
      "drive types"
      "guests guests"
      "features features";
    gap: 14px;
  }
  .vpf-day { grid-area: day; }
  .vpf-price { grid-area: price; }
  .vpf-drive { grid-area: drive; }
  .vpf-types { grid-area: types; }
  .vpf-guests { grid-area: guests; }
  .vpf-features { grid-area: features; }
}

@media (max-width: 899px) {
  .vpf-controls {
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr;
    min-height: 900px;
  }
}

/* Unified Chip Styling */
.vpf-group.vpf-day label,
#guestRanges .checkbox-item,
#venueTypeFilter .checkbox-item,
fieldset.vpf-features .checkbox-item {
  display: inline-flex !important;
  align-items: center !important;
  gap: .55ch !important;
  padding: var(--chip-py) var(--chip-px) !important;
  border-radius: var(--chip-radius) !important;
  background: var(--chip-bg) !important;
  color: #fff !important;
  border: 0 !important;
  cursor: pointer;
  backdrop-filter: saturate(140%) blur(6px);
}

.vpf-group.vpf-day label:has(input:checked),
#guestRanges .checkbox-item:has(input:checked),
#venueTypeFilter .checkbox-item:has(input:checked),
fieldset.vpf-features .checkbox-item:has(input:checked) {
  background: var(--chip-bg-active) !important;
  color: #111 !important;
}

.vpf-group.vpf-day label:hover,
#guestRanges .checkbox-item:hover,
#venueTypeFilter .checkbox-item:hover,
fieldset.vpf-features .checkbox-item:hover {
  background: var(--chip-bg-active) !important;
}

/* Radio Buttons */
.vpf-group.vpf-day input[type="radio"] {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.9);
  background: #fff;
  margin: 0 8px 0 0;
}

.vpf-group.vpf-day input[type="radio"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

/* Checkboxes */
#venueTypeFilter .checkbox-item input[type="checkbox"],
#guestRanges .checkbox-item input[type="checkbox"],
fieldset.vpf-features .checkbox-item > input[type="checkbox"] {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 2px solid rgba(255,255,255,0.9);
  background: #fff;
  margin: 0 10px 0 0;
  position: relative;
}

#venueTypeFilter .checkbox-item input[type="checkbox"]:checked,
#guestRanges .checkbox-item input[type="checkbox"]:checked,
fieldset.vpf-features .checkbox-item > input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

#venueTypeFilter .checkbox-item input[type="checkbox"]::after,
#guestRanges .checkbox-item input[type="checkbox"]::after,
fieldset.vpf-features .checkbox-item > input[type="checkbox"]::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: rotate(45deg) scale(0);
  border-right: 2px solid #6b4f00;
  border-bottom: 2px solid #6b4f00;
  width: 6px;
  height: 10px;
  left: 4px;
  top: 0px;
  transition: transform .12s ease-out;
}

#venueTypeFilter .checkbox-item input[type="checkbox"]:checked::after,
#guestRanges .checkbox-item input[type="checkbox"]:checked::after,
fieldset.vpf-features .checkbox-item > input[type="checkbox"]:checked::after {
  transform: rotate(45deg) scale(1);
}

/* Layout Grids */
#venueTypeFilter {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

#guestRanges {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px 12px;
}

fieldset.vpf-features {
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 12px;
  padding: 14px 16px 12px;
}

.vpf-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px 18px;
}

/* Price Section */
.price-section {
  margin: 8px 0 0;
  border-radius: 14px;
  padding: 8px;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  box-shadow: 0 6px 14px rgba(0,0,0,.08) inset;
}

.price-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 14px 16px;
}

.price-item {
  display: grid;
  place-items: center;
  text-align: center;
  color: rgba(255,255,255,.95);
}

.price-item .day {
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: .2px;
  margin-bottom: 6px;
}

.price-badge {
  display: inline-block;
  padding: 6px 10px;
  line-height: 1;
  font-size: 1.1em;
  font-weight: 700;
  color: white;
  border-radius: 999px;
  background: rgba(255, 255, 255, .30);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
}

/* Favorite Button */
.fav-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.72);
  backdrop-filter: saturate(140%) blur(6px);
  box-shadow: 0 6px 18px rgba(0,0,0,.22);
  cursor: pointer;
  transition: all .18s;
}

.fav-btn:hover {
  background: rgba(255,255,255,.88);
  box-shadow: 0 10px 26px rgba(0,0,0,.28);
  transform: translateY(-1px);
}

.fav-btn svg {
  width: 32px;
  height: 32px;
}

.fav-btn svg path {
  fill: none;
  stroke: hsl(350 18% 38%);
  stroke-width: 2.2;
  transition: all .18s;
}

.fav-btn[aria-pressed="true"] svg path {
  fill: #e11d48;
  stroke: #e11d48;
}

/* Map */
.venue-map {
  height: 100%;
  width: 100%;
  border-radius: 12px;
  background: rgba(0,0,0,.05);
  overflow: hidden;
}

.venue-map-wrapper {
  position: relative;
  height: 400px;
  border-radius: 12px;
  margin: 10px 0 20px;
  overflow: hidden;
}

@media (min-width: 1024px) {
  .venue-map-wrapper { height: 480px; }
}

.venue-map-wrapper.is-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 99999 !important;
  margin: 0 !important;
  border-radius: 0 !important;
}

/* Leaflet Popup Constraints */
.leaflet-popup-content-wrapper {
  border-radius: 8px;
  max-width: 320px !important;
  min-width: 300px !important;
  max-height: 320px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.leaflet-popup-content {
  margin: 0 !important;
  width: 300px !important;
  max-height: 320px;
  overflow-y: auto;
  overflow-x: hidden;
}

.leaflet-popup-tip-container {
  display: none !important;
}

.vpf-infow {
  padding: 12px !important;
  font-family: system-ui, -apple-system, sans-serif;
  line-height: 1.4;
  width: 100%;
  max-width: 300px;
  box-sizing: border-box;
  overflow: hidden;
}

.vpf-infow strong {
  font-size: 15px;
  color: #2d3748;
  display: block;
  margin-bottom: 6px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.vpf-popup-img {
  width: 100%;
  max-width: 276px;
  max-height: 110px !important;
  height: 110px;
  object-fit: contain !important;
  object-position: center;
  border-radius: 6px;
  margin-bottom: 10px;
  display: block;
  background: #f5f5f5;
}

.vpf-popup-btn {
  display: inline-block;
  margin-top: 10px !important;
  padding: 10px 16px !important;
  background: linear-gradient(135deg, #ff6b6b, #ffa500);
  color: #fff !important;
  text-decoration: none !important;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px !important;
  transition: transform .15s, box-shadow .2s;
  box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
  word-wrap: break-word;
  max-width: 100%;
  text-align: center;
  white-space: normal;
  line-height: 1.3;
}

.vpf-popup-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

.vpf-map-fullscreen-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1000;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #ff6b6b, #ffa500);
  color: #fff;
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.vpf-map-fullscreen-btn:hover {
  box-shadow: 0 6px 16px rgba(255, 107, 107, 0.5);
  transform: translateY(-1px);
}

/* Venue Cards */
#venueCards {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)) !important;
  gap: 22px !important;
  position: relative;
}

#vpf-empty-state {
  display: none;
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
  border-radius: 16px;
  border: 2px dashed rgba(102, 126, 234, 0.3);
}

#vpf-empty-state h3 {
  font-size: 24px;
  font-weight: 800;
  color: var(--vpf-dark);
  margin: 0 0 12px;
}

#vpf-empty-state p {
  font-size: 16px;
  color: var(--vpf-text);
  margin: 0;
}

.venue-card {
  background: #fff !important;
  border-radius: 14px !important;
  overflow: hidden !important;
  position: relative !important;
  border: 1px solid rgba(102,126,234,.12) !important;
  box-shadow: 0 10px 26px rgba(0,0,0,.10) !important;
  transition: all .15s !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: 680px !important;
}

.venue-card:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 16px 42px rgba(0,0,0,.16) !important;
}

.card-image {
  width: 100% !important;
  height: 220px !important;
  object-fit: cover !important;
  display: block !important;
  background: linear-gradient(45deg, var(--vpf-primary), var(--vpf-primary-2)) !important;
}

.card-content {
  padding: 18px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  flex: 1 !important;
}

.venue-name {
  margin: 0 !important;
  font-size: 20px !important;
  font-weight: 800 !important;
  color: var(--vpf-dark) !important;
  line-height: 1.3 !important;
  height: 2.6em !important;
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.venue-type {
  align-self: flex-start !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  color: #fff !important;
  background: linear-gradient(135deg, var(--vpf-primary), var(--vpf-primary-2)) !important;
  padding: 4px 10px !important;
  border-radius: 999px !important;
}

.venue-details {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 10px !important;
}

.detail-item {
  font-size: 14px !important;
  font-weight: 800 !important;
  color: var(--vpf-text) !important;
}

.venue-description {
  line-height: 1.4 !important;
  overflow: hidden !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 3 !important;
  -webkit-box-orient: vertical !important;
}

.feature-list {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px 10px !important;
  margin-top: 12px !important;
}

.learn-more-btn {
  width: 100% !important;
  text-align: center !important;
  border: 0 !important;
  border-radius: 10px !important;
  padding: 0.75em 1em !important;
  background: #2d3748 !important;
  color: #fff !important;
  font-weight: 800 !important;
  cursor: pointer !important;
  transition: all .15s !important;
  margin-top: auto !important;
  text-decoration: none !important;
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  min-height: 3.5em !important;
  height: 4.5em !important;
  line-height: 1.4 !important;
  align-items: center !important;
  justify-content: center !important;
}

.learn-more-btn:hover {
  background: #1a202c !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 10px 24px rgba(0,0,0,.18) !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  #venueCards { grid-template-columns: 1fr; }
  .venue-details { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .price-grid { padding: 12px; }
  .price-item .day { font-size: .85rem; }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  #venueCards { grid-template-columns: 1fr; }
  .venue-details { grid-template-columns: 1fr; }
  
  /* Fix toolbar layout on mobile */
  .vpf-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    min-height: auto;
  }
  
  #activeFiltersSummary {
    width: 100%;
    text-align: center;
  }
  
  .vpf-right {
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }
  
  .vpf-sort {
    width: 100%;
  }
  
  .vpf-sort select {
    width: 100%;
    min-width: auto;
  }
  
  .clear-filters {
    width: 100%;
    white-space: nowrap;
  }
  
  .vpf-results {
    width: 100%;
    text-align: center;
  }
}