/* Lynnwood Towing Directory - Styles */

body {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text-bright);
}

nav ul {
  display: flex;
  list-style: none;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}

.hero {
  background-color: #3498db;
  color: white;
  padding: 2rem;
  border-radius: 5px;
  margin: 1rem 0;
  text-align: center;
}

.search-container {
  margin: 1rem auto;
  max-width: 600px;
}

.search-input {
  width: 100%;
  padding: 0.75rem;
  border-radius: 25px;
  border: 1px solid var(--border);
  font-size: 1rem;
}

.company-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.company-card {
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.company-name {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.rating {
  display: inline-block;
  background-color: #f1c40f;
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  font-size: 0.8rem;
  margin-bottom: 0.75rem;
}

.company-details {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.view-btn {
  display: block;
  background-color: #2ecc71;
  color: white;
  text-align: center;
  padding: 0.5rem;
  border-radius: 5px;
  margin-top: 1rem;
  text-decoration: none;
  cursor: pointer;
}

.filters {
  display: flex;
  gap: 1rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.5rem 1rem;
  background-color: var(--background);
  border: 1px solid var(--border);
  border-radius: 5px;
  cursor: pointer;
}

.filter-btn.active {
  background-color: #3498db;
  color: white;
  border-color: #3498db;
}

/* Map container */
.map-container {
    height: 400px;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin: 1.5rem 0;
    z-index: 0; /* Ensure map doesn't overlap modal */
  }

/* Responsive: smaller map on mobile */
@media (max-width: 768px) {
  .map-container {
    height: 300px;
  }
}

/* Leaflet popup styling to match site theme */
.leaflet-popup-content-wrapper {
  border-radius: 8px;
}

.leaflet-popup-content {
  margin: 12px;
}

.leaflet-popup-content strong {
  font-size: 1.1em;
  color: var(--text-bright);
}

.leaflet-popup-content a {
  color: var(--links);
}

/* Card highlight for map interaction */
.company-card.highlighted {
  box-shadow: 0 0 0 3px #3498db;
  transition: box-shadow 0.3s ease;
}

/* Modal Styles */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  box-sizing: border-box;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--background-body);
  border-radius: 8px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.modal-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--text-bright);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}

.modal-close:hover {
  color: var(--text-bright);
}

.modal-body {
  padding: 1.5rem;
}

.modal-body h3 {
  margin: 0 0 0.75rem 0;
  font-size: 1rem;
  color: var(--text-bright);
}

.modal-body h3:not(:first-child) {
  margin-top: 1.5rem;
}

.modal-body p {
  margin: 0.5rem 0;
  color: var(--text-main);
}

.modal-body ul {
  margin: 0.5rem 0;
  padding-left: 1.25rem;
}

.modal-body li {
  margin: 0.25rem 0;
  color: var(--text-main);
}

.modal-body .phone-link {
  display: inline-block;
  background-color: #2ecc71;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  margin-top: 1rem;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}

.modal-body .phone-link:hover {
  background-color: #27ae60;
}

.special-offer {
  background-color: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 5px;
  padding: 0.75rem;
  margin-top: 1rem;
  color: #856404;
}

/* Mobile adjustments for modal */
@media (max-width: 600px) {
  .modal-content {
    max-height: 85vh;
    margin: auto;
  }

  .modal-header h2 {
    font-size: 1.1rem;
  }

  .modal-body {
    padding: 1rem;
  }
}

/* CTA / info sections used on multiple pages */
.cta-section {
  text-align: center;
  margin-top: 2rem;
  padding: 2rem;
  background-color: var(--background-alt);
  border-radius: 5px;
}

/* Variant with less padding for non-centered info sections */
.info-section {
  margin-top: 2rem;
  padding: 1.5rem;
  background-color: var(--background-alt);
  border-radius: 5px;
}

/* Small muted text (photo credits, last-updated, fine print) */
.text-muted-sm {
  font-size: 0.9em;
  color: var(--text-muted);
}

/* Even smaller muted text for figcaptions */
.text-muted-xs {
  font-size: 0.85rem;
  color: var(--text-muted);
}

footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Dark mode overrides for custom brand colors */
@media (prefers-color-scheme: dark) {
  .hero {
    background-color: #2980b9;
  }

  .rating {
    background-color: #d4a90a;
    color: #1a1a1a;
  }

  .search-input {
    background-color: var(--background);
    color: var(--text-main);
    border-color: var(--border);
  }

  .company-card {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  }

  .modal-content {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  }

/* Website link in modal - break long URLs gracefully */
#modal-website a {
  word-break: break-all;
}

.special-offer {
    background-color: #3d3200;
    border-color: #665500;
    color: #ffd700;
  }
}
