/* ==========================================================================
   Toilet Finder Tool - Styles (matching food-hygiene layout)
   ========================================================================== */

/* --------------------------------------------------------------------------
   Tool Container Layout
   -------------------------------------------------------------------------- */
.tool-container {
  display: flex;
  max-height: 700px;
  background-color: var(--bg);
}

/* --------------------------------------------------------------------------
   Sidebar
   -------------------------------------------------------------------------- */
.tool-sidebar {
  width: 380px;
  background-color: var(--card);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  flex-shrink: 0;
  box-shadow: var(--shadow);
}

.sidebar-content {
  padding: 20px;
}

.sidebar-content label {
  display: block;
  font-size: 13px;
  margin-bottom: 8px;
  margin-top: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.sidebar-content label:first-of-type {
  margin-top: 0;
}

.tool-section {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.tool-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.tool-section h3 {
  font-size: 15px;
  margin-bottom: 16px;
  color: var(--text);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --------------------------------------------------------------------------
   Input Section
   -------------------------------------------------------------------------- */
.input-section {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--card) 100%);
  margin: -20px -20px 24px -20px;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.divider {
  display: flex;
  align-items: center;
  margin: 16px 0;
  color: var(--text-muted);
  font-size: 13px;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.divider span {
  padding: 0 12px;
}

/* --------------------------------------------------------------------------
   Suggestions Dropdown
   -------------------------------------------------------------------------- */
.input-with-suggestions {
  position: relative;
}

.suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}

.suggestions.show {
  display: block;
}

.suggestions .item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
}

.suggestions .item:last-child {
  border-bottom: none;
}

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

/* --------------------------------------------------------------------------
   Facility Guide
   -------------------------------------------------------------------------- */
.facility-guide {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.guide-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.guide-icon {
  font-size: 1rem;
  width: 24px;
  text-align: center;
}

/* --------------------------------------------------------------------------
   Facility Tags
   -------------------------------------------------------------------------- */
.facility-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--bg-secondary);
  color: var(--text-muted);
}

.facility-tag.wheelchair {
  background: #dbeafe;
  color: #1d4ed8;
}

.facility-tag.baby {
  background: #fce7f3;
  color: #be185d;
}

.facility-tag.free {
  background: #d1fae5;
  color: #059669;
}

.facility-tag.radar {
  background: #fef3c7;
  color: #b45309;
}

.facility-tag.changing-places {
  background: #e0e7ff;
  color: #4338ca;
}

.facility-tag.fee {
  background: #fee2e2;
  color: #dc2626;
}

/* --------------------------------------------------------------------------
   Results Summary
   -------------------------------------------------------------------------- */
.results-summary {
  display: flex;
  gap: 12px;
}

.summary-stat {
  flex: 1;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 8px;
  text-align: center;
}

.summary-stat.accessible {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
}

.summary-stat.baby {
  border-color: #ec4899;
  background: rgba(236, 72, 153, 0.1);
}

.summary-stat .stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  display: block;
}

.summary-stat.accessible .stat-value {
  color: #3b82f6;
}

.summary-stat.baby .stat-value {
  color: #ec4899;
}

.summary-stat .stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* --------------------------------------------------------------------------
   Results List
   -------------------------------------------------------------------------- */
.results-section {
  border-bottom: none !important;
  padding-bottom: 0 !important;
}

.results-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 400px;
  overflow-y: auto;
}

.result-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.result-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

.result-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.result-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.result-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.result-logo-fallback {
  font-size: 1.25rem;
}

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

.result-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  margin: 0 0 2px 0;
  line-height: 1.3;
}

.result-subname {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.result-distance {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.distance-value {
  background: var(--primary);
  color: white;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.walk-time {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.result-address {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.result-facilities {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.result-hours {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  margin-bottom: 8px;
}

.hours-status {
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.7rem;
}

.hours-status.open {
  background: #d1fae5;
  color: #059669;
}

.hours-status.closed {
  background: #fee2e2;
  color: #dc2626;
}

.hours-status.unknown {
  background: var(--bg-secondary);
  color: var(--text-muted);
}

.hours-text {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.result-actions {
  display: flex;
  gap: 8px;
}

.btn-directions,
.result-actions .btn-directions,
.result-actions a.btn-directions,
a.btn-directions,
a.btn-directions:link,
a.btn-directions:visited,
a.btn-directions:active,
a.btn-directions:focus {
  flex: 1;
  background: #22c55e !important;
  color: white !important;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.2s ease;
  text-decoration: none !important;
}

.btn-directions:hover,
.result-actions .btn-directions:hover,
a.btn-directions:hover {
  background: #16a34a !important;
  color: white !important;
}

/* Additional facility tag colors */
.facility-tag.women {
  background: #fce7f3;
  color: #be185d;
}

.facility-tag.men {
  background: #dbeafe;
  color: #1d4ed8;
}

.facility-tag.gender-neutral {
  background: #e0e7ff;
  color: #4338ca;
}

.facility-tag.children {
  background: #fef3c7;
  color: #b45309;
}

.facility-tag.automatic {
  background: #f1f5f9;
  color: #475569;
}

/* Opening hours details */
.opening-hours-details {
  margin-bottom: 8px;
}

.hours-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  list-style: none;
}

.hours-summary::-webkit-details-marker {
  display: none;
}

.hours-toggle {
  color: var(--primary);
  font-size: 0.75rem;
}

.opening-hours-details[open] .hours-toggle {
  display: none;
}

.hours-grid {
  margin-top: 8px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 0.8rem;
}

.hours-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  border-bottom: 1px solid var(--border);
}

.hours-row:last-child {
  border-bottom: none;
}

.hours-day {
  font-weight: 600;
  color: var(--text);
  min-width: 40px;
}

.hours-time {
  color: var(--text-muted);
}

/* Verified badge */
.result-verified {
  font-size: 0.75rem;
  color: #059669;
  margin-bottom: 8px;
}

/* Notes */
.result-notes {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--bg-secondary);
  padding: 8px 10px;
  border-radius: var(--radius);
  margin-bottom: 8px;
  font-style: italic;
}

/* --------------------------------------------------------------------------
   Loading
   -------------------------------------------------------------------------- */
.loading-indicator {
  text-align: center;
  padding: 40px 20px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-indicator p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* --------------------------------------------------------------------------
   Data Note
   -------------------------------------------------------------------------- */
.data-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.data-note a {
  color: var(--primary);
}

/* --------------------------------------------------------------------------
   Map Container
   -------------------------------------------------------------------------- */
.map-container {
  flex: 1;
  position: relative;
  min-height: 500px;
}

.map {
  width: 100%;
  height: 100%;
  background-color: var(--bg);
}

/* Floating action button */
.fab {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--card);
  color: var(--primary);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.25rem;
  z-index: 1000;
  transition: all 0.2s ease;
}

.fab:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* --------------------------------------------------------------------------
   Map Markers
   -------------------------------------------------------------------------- */
.toilet-marker {
  width: 32px;
  height: 32px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  border: 2px solid #3b82f6;
}

.toilet-marker.accessible {
  border-color: #059669;
}

.toilet-marker.baby {
  border-color: #ec4899;
}

.logo-marker {
  width: 36px;
  height: 36px;
  background: white;
  border-radius: 50%;
  padding: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
}

.logo-marker img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  border-radius: 50%;
}

.user-marker {
  width: 40px;
  height: 40px;
  background: #dc2626;
  border: 3px solid white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* --------------------------------------------------------------------------
   Map Popups
   -------------------------------------------------------------------------- */
.leaflet-popup-content {
  margin: 12px 14px;
  min-width: 200px;
}

.popup-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 6px;
  color: #1e293b;
}

.popup-facilities {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.popup-hours {
  font-size: 0.8rem;
  color: #64748b;
  margin-bottom: 10px;
}

.popup-directions {
  display: block;
  background: #22c55e;
  color: white !important;
  text-align: center;
  padding: 8px;
  border-radius: 6px;
  text-decoration: none !important;
  font-weight: 600;
  font-size: 0.85rem;
  transition: background 0.2s ease;
}

.popup-directions:hover {
  background: #16a34a;
  color: white !important;
}

/* --------------------------------------------------------------------------
   SEO Content Section
   -------------------------------------------------------------------------- */
.seo-content {
  background: var(--bg-secondary);
  padding: 60px 20px;
  border-top: 1px solid var(--border);
}

.seo-inner {
  max-width: 900px;
  margin: 0 auto;
}

.content-section {
  margin-bottom: 40px;
}

.content-section:last-child {
  margin-bottom: 0;
}

.content-section h2 {
  font-size: 1.5rem;
  color: var(--text);
  margin-bottom: 16px;
}

.content-section p {
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 12px;
}

.content-section ul {
  color: var(--text-muted);
  line-height: 1.7;
  padding-left: 24px;
}

.content-section li {
  margin-bottom: 8px;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .tool-container {
    flex-direction: column;
    max-height: none;
    height: auto;
  }
  
  .tool-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: none;
    overflow: visible;
  }
  
  .map-container {
    width: 100%;
    height: 400px;
    min-height: 400px;
    flex: none;
  }
  
  #map {
    width: 100%;
    height: 400px !important;
    min-height: 400px;
  }
  
  .results-list {
    max-height: 400px;
  }
  
  .fab {
    display: none;
  }
}

@media (max-width: 480px) {
  .map-container {
    height: 350px;
    min-height: 350px;
  }
  
  #map {
    height: 350px !important;
    min-height: 350px;
  }
  
  .results-summary {
    gap: 8px;
  }
  
  .summary-stat {
    padding: 8px 4px;
  }
  
  .summary-stat .stat-value {
    font-size: 1rem;
  }
  
  .summary-stat .stat-label {
    font-size: 0.6rem;
  }
  
  .result-card {
    padding: 12px;
  }
  
  .result-facilities {
    gap: 4px;
  }
  
  .facility-tag {
    font-size: 0.65rem;
    padding: 2px 6px;
  }
}