/* =============================================
   Diandi Digital – Widget Pharmacies de Garde
   Thème sombre — v2.0
   ============================================= */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@700;800&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ── Reset scoped ── */
#diandi-pharma-widget,
#diandi-pharma-widget * {
  box-sizing: border-box;
}

#diandi-pharma-widget {
  font-family: 'DM Sans', sans-serif;
  max-width: 100%;
  background: #08080f;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.07);
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}

/* ── HEADER ── */
.dp-header {
  background: linear-gradient(135deg, #0d0d1a 0%, #120820 50%, #0a0a15 100%);
  padding: 28px 28px 22px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.dp-header::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(204,42,42,0.18) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.dp-header::after {
  content: '';
  position: absolute;
  bottom: -40px; left: 40px;
  width: 160px; height: 160px;
  background: radial-gradient(circle, rgba(26,79,214,0.12) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.dp-header-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}
.dp-pulse {
  width: 11px; height: 11px;
  background: #CC2A2A;
  border-radius: 50%;
  flex-shrink: 0;
  animation: dp-pulse 2s infinite;
}
@keyframes dp-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(204,42,42,0.6); }
  50%      { box-shadow: 0 0 0 8px rgba(204,42,42,0); }
}
.dp-title {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(1.3rem, 4vw, 1.9rem);
  color: #ffffff;
  line-height: 1.1;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
}
.dp-title span { color: #CC2A2A; }
.dp-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.45);
  position: relative;
  z-index: 1;
}
.dp-badge {
  background: rgba(204,42,42,0.18);
  color: #ff6b6b;
  border: 1px solid rgba(204,42,42,0.35);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.dp-badge.official {
  background: rgba(255,209,102,0.1);
  color: #FFD166;
  border-color: rgba(255,209,102,0.25);
}

/* ── CONTROLS ── */
.dp-controls {
  background: #0e0e1c;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 14px 22px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.dp-search-wrap {
  flex: 1;
  min-width: 180px;
  position: relative;
}
.dp-search-wrap input {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 10px 16px 10px 38px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  color: #ffffff;
  background: rgba(255,255,255,0.05);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.dp-search-wrap input:focus {
  border-color: rgba(204,42,42,0.6);
  background: rgba(255,255,255,0.07);
  box-shadow: 0 0 0 3px rgba(204,42,42,0.12);
}
.dp-search-wrap input::placeholder { color: rgba(255,255,255,0.28); }
.dp-search-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  color: rgba(255,255,255,0.3);
  pointer-events: none;
}
.dp-commune-select {
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 10px 34px 10px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  color: #ffffff;
  background: rgba(255,255,255,0.05);
  outline: none;
  cursor: pointer;
  min-width: 160px;
  transition: border-color 0.2s, background 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
.dp-commune-select option {
  background: #1a1a2e;
  color: #fff;
}
.dp-commune-select:focus {
  border-color: rgba(204,42,42,0.6);
  background-color: rgba(255,255,255,0.07);
}

/* ── STATS ── */
.dp-stats {
  display: flex;
  gap: 24px;
  background: #0b0b18;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 12px 24px;
  flex-wrap: wrap;
  align-items: center;
}
.dp-stat { display: flex; align-items: baseline; gap: 7px; }
.dp-stat-value {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.35rem;
  color: #1A4FD6;
}
.dp-stat-label {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── URGENCE ── */
.dp-urgency {
  background: rgba(204,42,42,0.08);
  border-bottom: 1px solid rgba(204,42,42,0.18);
  padding: 10px 24px;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.5);
  display: flex;
  align-items: center;
  gap: 8px;
}
.dp-urgency strong { color: #ff6b6b; }

/* ── BODY ── */
.dp-body {
  background: #08080f;
  padding: 22px 22px 28px;
  min-height: 120px;
}

/* ── COMMUNE SECTION ── */
.dp-commune {
  margin-bottom: 30px;
  animation: dp-fadeup 0.35s ease both;
}
@keyframes dp-fadeup {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.dp-commune-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 14px;
}
.dp-commune-name {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.88);
}
.dp-commune-count {
  background: rgba(26,79,214,0.15);
  color: #6b9fff;
  border: 1px solid rgba(26,79,214,0.25);
  padding: 2px 9px;
  border-radius: 12px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* ── GRID ── */
.dp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

/* ── CARD ── */
.dp-card {
  background: #0f0f1e;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  padding: 16px 18px;
  transition: box-shadow 0.25s, border-color 0.25s, transform 0.2s;
  position: relative;
  overflow: hidden;
}
.dp-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: linear-gradient(180deg, #CC2A2A 0%, #1A4FD6 100%);
  opacity: 0;
  transition: opacity 0.25s;
}
.dp-card:hover {
  box-shadow: 0 6px 28px rgba(204,42,42,0.18);
  border-color: rgba(204,42,42,0.35);
  transform: translateY(-2px);
}
.dp-card:hover::before { opacity: 1; }
.dp-card-name {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  color: #ffffff;
  margin-bottom: 6px;
  line-height: 1.35;
}
.dp-card-address {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.38);
  line-height: 1.55;
  margin-bottom: 12px;
}
.dp-phones {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.dp-phone {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(26,79,214,0.15);
  border: 1px solid rgba(26,79,214,0.3);
  color: #7aabff;
  text-decoration: none;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 500;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  white-space: nowrap;
}
.dp-phone:hover {
  background: rgba(26,79,214,0.3);
  border-color: rgba(26,79,214,0.55);
  color: #aacfff;
}
.dp-phone-none {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.2);
  font-style: italic;
}

/* ── ÉTATS ── */
.dp-loading {
  text-align: center;
  padding: 50px 20px;
  color: rgba(255,255,255,0.3);
  font-size: 0.9rem;
}
.dp-spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(255,255,255,0.07);
  border-top-color: #CC2A2A;
  border-radius: 50%;
  animation: dp-spin 0.75s linear infinite;
  margin: 0 auto 14px;
}
@keyframes dp-spin { to { transform: rotate(360deg); } }
.dp-error {
  background: rgba(204,42,42,0.08);
  border: 1px solid rgba(204,42,42,0.25);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
}
.dp-error h4 {
  color: #ff6b6b;
  margin-bottom: 8px;
  font-family: 'Syne', sans-serif;
  font-size: 0.95rem;
}
.dp-error p { font-size: 0.82rem; color: rgba(255,255,255,0.4); }
.dp-error a { color: #7aabff; }
.dp-no-results {
  text-align: center;
  padding: 40px;
  color: rgba(255,255,255,0.22);
  font-size: 0.88rem;
}

/* ── FOOTER ── */
.dp-footer {
  text-align: center;
  padding: 12px 22px;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.18);
  border-top: 1px solid rgba(255,255,255,0.05);
}
.dp-footer a {
  color: rgba(255,255,255,0.3);
  text-decoration: none;
  transition: color 0.2s;
}
.dp-footer a:hover { color: #CC2A2A; }

/* ── RESPONSIVE ── */
@media (max-width: 520px) {
  .dp-header { padding: 22px 16px 18px; }
  .dp-controls, .dp-stats, .dp-urgency, .dp-body, .dp-footer { padding-left: 14px; padding-right: 14px; }
  .dp-grid { grid-template-columns: 1fr; }
  .dp-stats { gap: 14px; }
}
