/* ==========================================================================
   BAP / WildApricot "Whiteboard Maya Blue" Theme Override
   ========================================================================== */

:root {
  --bap-maya-blue: #00a8e8;
  --bap-maya-blue-hover: #0086ba;
  --bap-dark-slate: #1e293b;
  --bap-light-slate: #f8fafc;
  --bap-border-color: #e2e8f0;
  --bap-text-main: #334155;
  --bap-text-muted: #64748b;
  --bap-emerald: #10b981;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  background-color: #f1f5f9;
  color: var(--bap-text-main);
  line-height: 1.5;
  padding: 20px;
}

.directory-wrapper {
  max-width: 1200px;
  margin: 0 auto;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  padding: 20px 24px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  border-bottom: 3px solid var(--bap-maya-blue);
  margin-bottom: 24px;
}

header h1 {
  font-size: 1.75rem;
  color: var(--bap-dark-slate);
  font-weight: 700;
}

/* Base Panel Cards */
.panel {
  background: #ffffff;
  border: 1px solid var(--bap-border-color);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.panel h2 {
  font-size: 1.25rem;
  color: var(--bap-dark-slate);
  margin-bottom: 16px;
  font-weight: 600;
  border-bottom: 2px solid var(--bap-light-slate);
  padding-bottom: 8px;
}

/* Form Controls & Inputs */
input[type="text"],
select {
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.95rem;
  color: var(--bap-text-main);
  background-color: #ffffff;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus,
select:focus {
  border-color: var(--bap-maya-blue);
  box-shadow: 0 0 0 3px rgba(0, 168, 232, 0.15);
}

/* Buttons */
.btn {
  background-color: var(--bap-maya-blue);
  color: #ffffff;
  border: none;
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.btn:hover {
  background-color: var(--bap-maya-blue-hover);
}

.btn:disabled {
  background-color: #cbd5e1;
  cursor: not-allowed;
}

/* Map Section */
#map {
  width: 100%;
  height: 450px;
  border-radius: 6px;
  border: 1px solid var(--bap-border-color);
}

/* Table Design */
#search-input {
  width: 100%;
  margin-bottom: 16px;
}

.table-wrapper {
  overflow-x: auto;
}

table#contacts-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

table#contacts-table th {
  background-color: var(--bap-light-slate);
  color: var(--bap-dark-slate);
  padding: 12px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--bap-border-color);
  user-select: none;
}

table#contacts-table th:hover {
  color: var(--bap-maya-blue);
}

table#contacts-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--bap-border-color);
  font-size: 0.95rem;
}

table#contacts-table tbody tr:hover {
  background-color: rgba(0, 168, 232, 0.03);
}

/* Badges */
.badge {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--bap-emerald);
  border: 1px solid rgba(16, 185, 129, 0.2);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  margin-left: 8px;
  text-transform: uppercase;
}

/* Loading Overlay */
#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#loading-overlay span {
  margin-top: 16px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--bap-dark-slate);
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--bap-border-color);
  border-top-color: var(--bap-maya-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Footer Image Badge Styling */
.vork-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px 0 12px 0;
  margin-top: 20px;
}

.vork-badge-link {
  display: inline-block;
  text-decoration: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.vork-badge-link:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.vork-footer-img {
  max-width: 180px; /* Adjust height/width as needed for your layout */
  height: auto;
  display: block;
  border-radius: 8px; /* Optional subtle rounding */
}

/* Map Legend Below Map */
.map-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 12px;
  margin-bottom: 24px;
  padding: 12px 16px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #334155;
}

.legend-color {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(0, 0, 0, 0.15);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Intro Text Styling - Changed grey to crisp black and added soft background */
.search-intro-text {
  color: #1e293b; /* Dark black/slate for clear readability */
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 20px;
  background-color: #f8fafc;
  padding: 16px;
  border-radius: 8px;
  border-left: 4px solid #0284c7; /* Subtle accent line on the left */
}

.search-intro-text p {
  margin: 0 0 10px 0;
}

.search-intro-text p:last-child {
  margin-bottom: 0;
}

.search-intro-text strong {
  color: #0369a1;
}

/* Spacing adjustments */
.nearest-search-section {
  margin-bottom: 24px;
}

.map-container {
  margin-top: 16px;
}

/* Restored Blue Search Button */
#find-nearest-btn,
.btn-primary {
  background-color: #0284c7;
  color: #ffffff;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

#find-nearest-btn:hover,
.btn-primary:hover {
  background-color: #0369a1;
}

/* Search Controls Layout */
.search-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 20px;
}

/* Vertical Search Results Layout */
.nearest-results {
  display: flex;
  flex-direction: column; /* Forces vertical stacking */
  gap: 12px;
  margin-top: 16px;
}

/* Individual Result Cards stacked vertically */
.nearest-results .result-card,
.nearest-result-item {
  width: 100%;
  display: block;
}

