/* =============================================
   LAYOUT PRINCIPAL
   ============================================= */

.container {
  display: flex;
  /* gap: 16px; */
  height: 680px;
  border-radius: 12px;
  /* overflow: hidden; */
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* =============================================
   HEADER — filtres
   ============================================= */

.header {
  background-color: white;
  padding: 16px 20px;
  flex-shrink: 0;
}

.header label {
  font-weight: 600;
  color: #374151;
  display: block;
  margin-bottom: 10px;
}

.theme-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.theme-btn {
  padding: 7px 14px;
  border: 2px solid #d1d5db;
  background-color: white;
  color: #374151;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-size: 0.85rem;
}

.theme-btn:hover {
  border-color: #9ca3af;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.theme-btn.active {
  border-color: white;
  color: white;
  background: linear-gradient(135deg, #7da6b5 0%, #56828b 100%);
}

.theme-color {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.theme-btn.active .theme-color {
  background-color: white !important;
}

.theme-count {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 12px;
  background-color: #f3f4f6;
  color: #6b7280;
}

.theme-btn.active .theme-count {
  background-color: white;
  color: #1f2937;
}

.info-text {
  font-size: 13px;
  color: #6b7280;
  margin-top: 10px;
  margin-bottom: 0;
}

/* =============================================
   CARTE LEAFLET
   ============================================= */

#map {
  flex: 1;
  min-height: 0; /* crucial pour que flex:1 fonctionne dans une colonne */
  background-color: #e5e7eb;
}

/* =============================================
   MARQUEUR
   ============================================= */

.marker-pin {
  width: 24px;
  height: 24px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 2px solid white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease;
}

/* =============================================
   SIDEBAR — toujours visible
   ============================================= */

.sidebar {
  width: 300px;
  min-width: 260px;
  background-color: white;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}

/* =============================================
   MODE LISTE — header
   ============================================= */

#listView {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.sidebar-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}

.sidebar-list-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: #1a1a2e;
}

.sidebar-list-count {
  background: #f0f4ff;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 20px;
}

/* =============================================
   MODE LISTE — scroll
   ============================================= */

.service-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.service-list::-webkit-scrollbar {
  width: 4px;
}
.service-list::-webkit-scrollbar-thumb {
  background: #dde3f0;
  border-radius: 4px;
}

.empty-list {
  text-align: center;
  color: #9ca3af;
  font-size: 0.85rem;
  padding: 24px 0;
}

/* =============================================
   CARTE DE SERVICE
   ============================================= */

.service-card {
  background: #fafbff;
  border: 1px solid #eaecf5;
  border-radius: 10px;
  padding: 11px 12px;
  cursor: pointer;
  transition:
    box-shadow 0.18s,
    border-color 0.18s,
    transform 0.15s;
}

.service-card:hover {
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.12);
  border-color: #c7d5f5;
  transform: translateY(-1px);
}

.service-card-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.service-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}

.service-card-body {
  flex: 1;
  min-width: 0;
}

.service-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: #1a1a2e;
  line-height: 1.3;
  margin-bottom: 5px;
}

.service-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 4px;
}

.service-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  letter-spacing: 0.02em;
}

.service-address {
  font-size: 0.73rem;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.service-arrow {
  font-size: 1.1rem;
  color: #9ca3af;
  line-height: 1;
  flex-shrink: 0;
  align-self: center;
}

/* =============================================
   MODE DÉTAIL
   ============================================= */

#detailView {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: #64748b;
  font-size: 0.83rem;
  font-weight: 600;
  padding: 14px 18px 10px;
  cursor: pointer;
  transition: color 0.15s;
  flex-shrink: 0;
  text-align: left;
}

.back-btn:hover {
  color: #535a63;
}

.detail-color-bar {
  height: 1px;
  width: 100%;
  flex-shrink: 0;
}

.detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.detail-body::-webkit-scrollbar {
  width: 4px;
}
.detail-body::-webkit-scrollbar-thumb {
  background: #dde3f0;
  border-radius: 4px;
}

.detail-name {
  font-size: 0.97rem;
  font-weight: 700;
  color: #1a1a2e;
  line-height: 1.35;
  margin: 0;
}

.detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.detail-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.detail-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ca3af;
}

.detail-contact {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.contact-row {
  font-size: 0.82rem;
  color: #374151;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.contact-row a {
  color: #3b82f6;
  text-decoration: none;
  word-break: break-all;
}

.contact-row a:hover {
  text-decoration: underline;
}

.detail-resume {
  font-size: 0.82rem;
  color: #374151;
  line-height: 1.6;
}

.detail-resume strong {
  display: block;
  margin-top: 10px;
  margin-bottom: 3px;
}

.detail-resume ul {
  margin: 0 0 6px 16px;
  padding: 0;
}

.detail-resume li {
  margin-bottom: 3px;
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 900px) {
  .container {
    flex-direction: column;
    height: auto;
    gap: 0;
    border-radius: 8px;
  }

  .main-content {
    height: 420px;
  }

  #map {
    flex: 1;
    min-height: 0;
  }

  .sidebar {
    width: 100%;
    min-width: unset;
    max-height: 380px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
  }
}

@media (max-width: 600px) {
  .theme-btn {
    padding: 6px 10px;
    font-size: 0.78rem;
  }

  .main-content {
    height: 340px;
  }

  .sidebar {
    max-height: 450px;
  }
}
