/**
 * Virginia AA Districts Map — WordPress Plugin Styles
 * All selectors scoped to .vaaa-map-wrap to avoid theme collisions.
 */

.vaaa-map-wrap {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #1a1814;
  line-height: 1.6;
  box-sizing: border-box;
}
.vaaa-map-wrap *, .vaaa-map-wrap *::before, .vaaa-map-wrap *::after {
  box-sizing: border-box;
  margin: 0; padding: 0;
}

.vaaa-hidden { display: none !important; }

/* ── Layout ── */
.vaaa-map-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 0.75rem;
  min-height: 600px;
}

/* ── Map Container ── */
.vaaa-map-container {
  position: relative;
  background: #ffffff;
  border: 1px solid #ccc8c0;
  border-radius: 0.5rem;
  overflow: hidden;
  min-height: 500px;
}

.vaaa-svg-container {
  width: 100%;
  height: 100%;
  min-height: 500px;
}
.vaaa-svg-container svg {
  width: 100%;
  height: 100%;
  display: block;
}

.vaaa-map-controls {
  position: absolute;
  top: 0.75rem; left: 0.75rem;
  display: flex; flex-direction: column; gap: 0.25rem;
  z-index: 10;
}
.vaaa-map-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  background: #fff; border: 1px solid #ccc8c0; border-radius: 0.375rem;
  color: #6b6960; cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: all 150ms ease;
}
.vaaa-map-btn:hover { background: #eceae4; color: #1a1814; }

/* ── Tooltip ── */
.vaaa-tooltip {
  position: absolute;
  pointer-events: none;
  background: #fff;
  border: 1px solid #ccc8c0;
  border-radius: 0.375rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  opacity: 0;
  z-index: 20;
  white-space: nowrap;
  transition: opacity 100ms ease;
}
.vaaa-tooltip.vaaa-visible { opacity: 1; }

/* ── Info Panel ── */
.vaaa-info-panel {
  background: #fff;
  border: 1px solid #ccc8c0;
  border-radius: 0.5rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 650px;
}

.vaaa-panel-default, .vaaa-panel-detail {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.vaaa-panel-header {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid #ddd9d2;
  flex-shrink: 0;
}
.vaaa-panel-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  line-height: 1.3;
}
.vaaa-panel-header p {
  font-size: 0.875rem;
  color: #6b6960;
}

/* ── Search ── */
.vaaa-district-list-section {
  display: flex; flex-direction: column;
  flex: 1; overflow: hidden;
}
.vaaa-search-box {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  border-bottom: 1px solid #ddd9d2;
  flex-shrink: 0;
}
.vaaa-search-box svg { color: #a8a69e; flex-shrink: 0; }
.vaaa-search-input {
  width: 100%; background: none; border: none; outline: none;
  font-size: 0.875rem; color: #1a1814;
  font-family: inherit;
}
.vaaa-search-input::placeholder { color: #a8a69e; }

/* ── District List ── */
.vaaa-district-list {
  overflow-y: auto; flex: 1;
  padding: 0.35rem 0;
  list-style: none;
}
.vaaa-district-list-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.5rem 1.25rem;
  cursor: pointer;
  transition: background 120ms ease;
  border-left: 3px solid transparent;
}
.vaaa-district-list-item:hover { background: #e8f0f6; }
.vaaa-district-list-item.vaaa-list-active {
  background: #e8f0f6;
  border-left-color: #1a5276;
}
.vaaa-district-list-item.vaaa-inactive { opacity: 0.45; }

.vaaa-dist-num {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  background: #eceae4; border-radius: 0.375rem;
  font-size: 0.75rem; font-weight: 700;
  color: #1a5276; flex-shrink: 0;
}
.vaaa-district-list-item.vaaa-list-active .vaaa-dist-num {
  background: #1a5276; color: #fff;
}
.vaaa-dist-name { font-size: 0.875rem; font-weight: 500; }
.vaaa-dist-status {
  margin-left: auto; font-size: 0.75rem;
  color: #a8a69e; font-style: italic;
}

/* ── Detail Panel ── */
.vaaa-panel-detail { overflow-y: auto; }

.vaaa-back-btn {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem; font-weight: 500;
  color: #1a5276; background: none; border: none;
  border-bottom: 1px solid #ddd9d2;
  width: 100%; cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
}
.vaaa-back-btn:hover { background: #e8f0f6; }

.vaaa-detail-content {
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1;
}

.vaaa-detail-header { margin-bottom: 1.25rem; }
.vaaa-detail-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  background: #1a5276; color: #fff;
  border-radius: 0.5rem;
  font-size: 1.125rem; font-weight: 700;
  margin-bottom: 0.5rem;
}
.vaaa-detail-name {
  font-size: 1.35rem; font-weight: 600; line-height: 1.2;
}
.vaaa-badge-inactive {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.15rem 0.5rem;
  background: #fdecea; color: #c0392b;
  border-radius: 0.375rem; font-size: 0.75rem; font-weight: 600;
  margin-top: 0.35rem;
}

.vaaa-section { margin-bottom: 1rem; }
.vaaa-section-title {
  font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: #6b6960; margin-bottom: 0.35rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid #ddd9d2;
}

.vaaa-row {
  display: flex; gap: 0.75rem;
  padding: 0.35rem 0;
  font-size: 0.875rem; line-height: 1.5;
}
.vaaa-row-icon { flex-shrink: 0; color: #1a5276; margin-top: 2px; }
.vaaa-row a { color: #1a5276; text-decoration: none; }
.vaaa-row a:hover { text-decoration: underline; }

.vaaa-no-info {
  font-size: 0.875rem; color: #6b6960;
  font-style: italic; padding: 1rem 0;
}
.vaaa-no-info a { color: #1a5276; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .vaaa-map-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
    min-height: auto;
  }
  .vaaa-map-container { min-height: 300px; }
  .vaaa-svg-container { min-height: 300px; }
  .vaaa-info-panel { max-height: 400px; }
}
