/* ── Page équipements ─────────────────────────────────────────────────────── */

.equip-page {
  flex: 1;
  padding: var(--space-md);
}

.equip-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-xl);
  color: var(--color-text-muted);
  min-height: 200px;
}

.equip-content {
  max-width: 900px;
  margin: 0 auto;
}

.equip-empty {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  text-align: center;
  padding: var(--space-xl);
}

/* ── Lien retour ─────────────────────────────────────────────────────────── */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-sm);
  transition: color 0.2s;
}

.back-link:hover,
.back-link:focus-visible {
  color: var(--color-accent);
  text-decoration: none;
}

/* ── Badges type équipement ──────────────────────────────────────────────── */

.type-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 2px var(--space-sm);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.type-badge--escalier {
  background: rgba(249, 115, 22, 0.15);
  color: var(--color-accent);
  border: 1px solid rgba(249, 115, 22, 0.3);
}

.type-badge--ascenseur {
  background: rgba(96, 165, 250, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(96, 165, 250, 0.3);
}

/* ── En-tête détail ──────────────────────────────────────────────────────── */

.detail-hero {
  margin-bottom: var(--space-lg);
}

.detail-labels {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
  margin-bottom: var(--space-sm);
}

.day-badge {
  display: inline-block;
  padding: 2px var(--space-sm);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  color: var(--color-text);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
}

.detail-description {
  font-size: var(--font-size-sm);
  color: var(--color-text);
  margin-top: var(--space-xs);
}

/* Lien station dans les labels */
.detail-station-link {
  display: inline-block;
  padding: 2px var(--space-sm);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s;
}

.detail-station-link:hover,
.detail-station-link:focus-visible {
  color: var(--color-accent);
  border-color: var(--color-accent);
  text-decoration: none;
}

/* Disques de lignes */
.detail-ligne-disc {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.65rem;
  letter-spacing: -0.03em;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s, box-shadow 0.2s;
  flex-shrink: 0;
  line-height: 1;
  font-family: var(--font-sans);
}

.detail-ligne-disc:hover,
.detail-ligne-disc:focus-visible {
  transform: scale(1.1);
  box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 4px currentColor;
  outline: none;
}

/* ── Stat cards ──────────────────────────────────────────────────────────── */

.detail-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.stat-card {
  flex: 1;
  min-width: 80px;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  padding: var(--space-lg) var(--space-md);
  text-align: center;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1;
  margin-bottom: var(--space-xs);
}

.stat-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/* ── Détails panne ───────────────────────────────────────────────────────── */

.detail-panne {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.detail-panne-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-md);
}

.detail-dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-xs) var(--space-lg);
  align-items: baseline;
}

.detail-dl dt {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.detail-dl dd {
  font-size: var(--font-size-sm);
  color: var(--color-text);
}

/* ── En-tête classement ──────────────────────────────────────────────────── */

.ranking-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.ranking-title {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-text);
}

.date-picker-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.date-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.date-input {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--font-size-sm);
  font-family: var(--font-sans);
  cursor: pointer;
}

.date-input:focus {
  outline: 2px solid var(--color-accent);
  border-color: var(--color-accent);
}

/* ── Liste classement ────────────────────────────────────────────────────── */

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.ranking-spinner {
  display: flex;
  justify-content: center;
  padding: var(--space-xl);
}

.ranking-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  color: var(--color-text);
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}

.ranking-item:hover,
.ranking-item:focus-visible {
  border-color: var(--color-accent);
  background: var(--color-surface-2);
  text-decoration: none;
}

/* Badge rang */

.rank-badge {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.rank-badge--top {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-bg);
}

/* Contenu ligne classement */

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

.rank-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
}

.rank-station {
  font-weight: 600;
  font-size: var(--font-size-base);
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 20ch;
}

.rank-description {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-xs);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-xs);
}

.rank-stat {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.rank-stat--alert {
  color: var(--color-danger);
  font-weight: 500;
}

/* Chevron */

.rank-chevron {
  font-size: 1.5rem;
  color: var(--color-text-muted);
  flex-shrink: 0;
  line-height: 1;
}

/* ── Section signalements ────────────────────────────────────────────────── */

.signal-section {
  margin-bottom: var(--space-xl);
}

.signal-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.signal-item {
  display: flex;
  gap: var(--space-md);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  padding: var(--space-md);
  align-items: flex-start;
}

.signal-item--clickable {
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.signal-item--clickable:hover,
.signal-item--clickable:focus-visible {
  border-color: var(--color-accent);
  background: var(--color-surface-2);
}

.signal-thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--color-surface-2);
}

.signal-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.signal-thumb--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

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

.signal-station {
  font-weight: 600;
  font-size: var(--font-size-base);
  color: var(--color-text);
  margin-bottom: 2px;
}

.signal-date {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.signal-desc {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-xs);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Popup photo ──────────────────────────────────────────────────────────── */

.photo-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.photo-popup-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.photo-popup {
  background: var(--color-surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.photo-popup-overlay.open .photo-popup {
  transform: translateY(0);
}

.photo-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--space-lg) var(--space-md);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  background: var(--color-surface);
  z-index: 1;
}

.photo-popup-title {
  font-size: var(--font-size-base);
  font-weight: 600;
}

.photo-popup-close {
  font-size: var(--font-size-xl);
  color: var(--color-text-muted);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-sans);
  background: none;
  border: none;
}

.photo-popup-close:hover,
.photo-popup-close:focus-visible {
  color: var(--color-text);
  background: var(--color-surface-2);
}

.photo-popup-body {
  padding: var(--space-lg);
}

.photo-popup-img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
}

.photo-popup-desc {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}

.photo-popup-date {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/* ── Responsive (tablette) ───────────────────────────────────────────────── */

@media (min-width: 480px) {
  .photo-popup {
    border-radius: var(--radius-lg);
    max-width: 600px;
    align-self: center;
  }

  .photo-popup-overlay {
    align-items: center;
  }

  .signal-thumb {
    width: 72px;
    height: 72px;
  }
}

/* ── Responsive (desktop) ────────────────────────────────────────────────── */

@media (min-width: 768px) {
  .equip-page {
    padding: var(--space-xl);
  }

  .signal-thumb {
    width: 80px;
    height: 80px;
  }
}
