/* css/airsoft_directory.css */

/* ── Page layout (mirrors find_technician_artist.css) ─── */
html, body { margin: 0; padding: 0; }

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body > header,
body > footer { flex: 0 0 auto; }

.main-content {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 400px;
  overflow: hidden;
}

.page-container {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

/* ── Intro banner ─────────────────────────────────────── */
.find-intro {
  background: #fff;
  border-bottom: 1px solid #dde1e7;
  padding: 14px 20px;
}

.find-intro-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1400px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.find-intro-text h1 {
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 3px;
}

.find-intro-text p {
  font-size: 0.82rem;
  color: #6b7280;
  margin: 0;
  line-height: 1.4;
}

.find-intro-features {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.find-intro-feature {
  background: #f0f4e8;
  color: #3d5020;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid #d0dfa8;
  white-space: nowrap;
}

/* ── Sidebar ──────────────────────────────────────────── */
.middle-column.find-sidebar {
  flex: 0 0 380px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #f5f6f7;
  border-right: 1px solid #dde1e7;
  overflow: hidden;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  background: #fff;
  border-bottom: 1px solid #e8eaed;
}

.sidebar-header h2 {
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
}

.result-count {
  font-size: 0.78rem;
  color: #6b7280;
  font-weight: 500;
}

/* ── Search toolbar ───────────────────────────────────── */
.search-toolbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  background: #fff;
  border-bottom: 1px solid #e8eaed;
}

.search-toolbar input,
.search-toolbar select {
  padding: 0.48rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  font-size: 0.84rem;
  font-family: inherit;
  background: #fafafa;
  color: #333;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-toolbar input { width: 100%; box-sizing: border-box; }

.toolbar-row { display: flex; gap: 8px; }
.toolbar-row select { flex: 1; cursor: pointer; }

.search-toolbar input:focus,
.search-toolbar select:focus {
  outline: none;
  border-color: #556B2F;
  box-shadow: 0 0 0 3px rgba(85,107,47,0.12);
  background: #fff;
}

/* ── Card list ────────────────────────────────────────── */
#dirList {
  list-style: none;
  margin: 0;
  padding: 10px;
  overflow-y: auto;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: #c5c9d0 transparent;
}

#dirList::-webkit-scrollbar { width: 5px; }
#dirList::-webkit-scrollbar-thumb { background: #c5c9d0; border-radius: 3px; }

/* ── No results ───────────────────────────────────────── */
.no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem 1.5rem;
  text-align: center;
  color: #6b7280;
  gap: 6px;
  list-style: none;
}

.no-results-icon { font-size: 2.2rem; line-height: 1; margin-bottom: 4px; }
.no-results strong { font-size: 0.95rem; color: #374151; display: block; }
.no-results p { font-size: 0.82rem; margin: 0; color: #9ca3af; }

/* ── Skeleton loader ──────────────────────────────────── */
@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.55; }
  50%       { opacity: 1; }
}

.dir-card--skeleton {
  pointer-events: none;
  border-color: transparent !important;
  box-shadow: none !important;
}

.skeleton-block {
  height: 14px;
  border-radius: 6px;
  background: #e5e7eb;
  animation: skeleton-pulse 1.6s ease-in-out infinite;
  margin-bottom: 8px;
}

/* ── Directory card ───────────────────────────────────── */
.dir-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
  list-style: none;
}

.dir-card:hover {
  border-color: #556B2F;
  box-shadow: 0 2px 10px rgba(85,107,47,0.12);
}

.dir-card.active {
  background: #f3f7ec;
  border-color: #556B2F;
}

.dir-logo {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: #f0f0f0;
  border: 1px solid #e5e7eb;
}

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

.dir-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dir-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

/* ── Type badges ──────────────────────────────────────── */
.dir-type-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 20px;
}

.dir-type--site {
  background: #e8f0d8;
  color: #3d5020;
  border: 1px solid #c5d9a0;
}

.dir-type--shop {
  background: #f5e6d8;
  color: #7a3a10;
  border: 1px solid #d4a88a;
}

.dir-address {
  font-size: 0.78rem;
  color: #6b7280;
  margin: 0 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dir-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
}

.dir-tag {
  font-size: 0.68rem;
  background: #f0f4e8;
  color: #4a6020;
  border: 1px solid #d4e8b0;
  border-radius: 12px;
  padding: 1px 7px;
}

.dir-links {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.dir-link {
  font-size: 0.75rem;
  color: #556B2F;
  text-decoration: none;
  font-weight: 600;
}

.dir-link:hover { text-decoration: underline; }

/* ── Map ──────────────────────────────────────────────── */
.right-column.map-container {
  flex: 1 1 auto;
  position: relative;
  min-width: 0;
  min-height: 400px;
}

#directoryMap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ── Leaflet popup ────────────────────────────────────── */
.leaflet-popup-profile {
  font-family: inherit;
  font-size: 0.84rem;
  min-width: 200px;
}

.popup-dir-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: #1a1a1a;
  margin: 0 0 4px;
}

.popup-dir-address {
  font-size: 0.78rem;
  color: #6b7280;
  margin: 0 0 6px;
}

.popup-dir-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }

.popup-dir-link {
  font-size: 0.75rem;
  color: #556B2F;
  text-decoration: none;
  font-weight: 600;
}

.popup-dir-link:hover { text-decoration: underline; }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 768px) {
  .page-container { flex-direction: column-reverse; }

  .middle-column.find-sidebar {
    flex: 0 0 auto;
    max-height: 50vh;
    border-right: none;
    border-top: 1px solid #dde1e7;
  }

  .right-column.map-container { min-height: 300px; flex: 0 0 300px; }
}

@media (max-width: 480px) {
  .middle-column.find-sidebar { max-height: 45vh; }
}
