/**
 * Planned outages — card-based timeline (v1.4.0)
 *
 * BEM-ish namespace: .pcp-pl
 * Inspired by the existing PretCurent design system: rounded cards,
 * generous spacing, Plus Jakarta Sans + Inter, primary blue #3B5BDB.
 */

.pcp-pl {
  font-family: 'Inter', sans-serif;
  color: #0F172A;
}

/* ─── Hero stats row ─────────────────────────────────────────────────── */
.pcp-pl__hero {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.pcp-pl__stat {
  background: #FFFFFF;
  border: 1px solid #CDDBFA;
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.pcp-pl__stat:hover {
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}
.pcp-pl__stat-label {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #3B5BDB;
}
.pcp-pl__stat-value {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 56px;
  font-weight: 700;
  line-height: 1;
  color: #0F172A;
  font-variant-numeric: tabular-nums;
}
.pcp-pl__stat-sub {
  font-size: 13px;
  color: #64748B;
  line-height: 1.4;
}

/* ─── Filter bar ─────────────────────────────────────────────────────── */
.pcp-pl__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #F8F9FC;
  border: 1px solid #CDDBFA;
  border-radius: 16px;
  margin-bottom: 24px;
}
.pcp-pl__filter-time {
  display: inline-flex;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 100px;
  padding: 4px;
  gap: 2px;
}
.pcp-pl__chip {
  appearance: none;
  border: none;
  background: transparent;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  padding: 8px 16px;
  border-radius: 100px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
  min-height: 36px;
}
.pcp-pl__chip:hover {
  color: #0F172A;
  background: #F1F4FA;
}
.pcp-pl__chip.is-active {
  background: #3B5BDB;
  color: #FFFFFF;
}
.pcp-pl__chip:focus-visible {
  outline: 2px solid #3B5BDB;
  outline-offset: 2px;
}
.pcp-pl__filter-selects {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.pcp-pl__select-wrap {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
}
.pcp-pl__select-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748B;
}
.pcp-pl__select {
  appearance: none;
  -webkit-appearance: none;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #0F172A;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 8px 36px 8px 12px;
  min-height: 40px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14' fill='none'%3E%3Cpath d='M3 5l4 4 4-4' stroke='%2364748B' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
}
.pcp-pl__select:hover {
  border-color: #CBD5E1;
}
.pcp-pl__select:focus-visible {
  outline: 2px solid #3B5BDB;
  outline-offset: 2px;
}

/* ─── Day groups (timeline) ──────────────────────────────────────────── */
.pcp-pl__timeline {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.pcp-pl__day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #E2E8F0;
  margin-bottom: 16px;
  position: sticky;
  top: 0;
  background: #FFFFFF;
  z-index: 2;
}
.pcp-pl__day.is-today .pcp-pl__day-head {
  border-bottom-color: #3B5BDB;
}
.pcp-pl__day-label {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #0F172A;
  margin: 0;
}
.pcp-pl__day.is-today .pcp-pl__day-label {
  color: #3B5BDB;
}
.pcp-pl__day-count {
  font-size: 12px;
  font-weight: 500;
  color: #64748B;
}
.pcp-pl__cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ─── Outage card ────────────────────────────────────────────────────── */
.pcp-pl__card {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 20px;
  align-items: flex-start;
  padding: 20px 24px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.pcp-pl__card:hover {
  border-color: #CDDBFA;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}
.pcp-pl__card-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 64px;
  background: #F8F9FC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
}
.pcp-pl__card-day {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  color: #0F172A;
  padding-top: 12px;
}
.pcp-pl__card-month {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #FFFFFF;
  background: #3B5BDB;
  width: 100%;
  text-align: center;
  padding: 4px 0;
  margin-top: 8px;
}
.pcp-pl__card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.pcp-pl__card-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
}
.pcp-pl__card-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: #0F172A;
  margin: 0;
  line-height: 1.3;
  word-break: break-word;
}
.pcp-pl__card-county {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #3B5BDB;
  text-decoration: none;
  border: 1px solid #CDDBFA;
  background: #EFF4FF;
  padding: 2px 10px;
  border-radius: 100px;
  white-space: nowrap;
  transition: background 0.15s ease;
}
.pcp-pl__card-county:hover {
  background: #DBEAFE;
}
.pcp-pl__card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  align-items: center;
  font-size: 13px;
  color: #475569;
}
.pcp-pl__card-time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: #0F172A;
}
.pcp-pl__card-time-sep {
  color: #94A3B8;
  margin: 0 2px;
}
.pcp-pl__card-time-end.is-soft {
  color: #64748B;
  font-style: italic;
  font-weight: 400;
}
.pcp-pl__card-dso {
  color: #64748B;
}
.pcp-pl__card-dup {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 500;
  color: #64748B;
  background: #F1F4FA;
  padding: 2px 8px;
  border-radius: 100px;
  white-space: nowrap;
}
.pcp-pl__card-toggle {
  appearance: none;
  background: none;
  border: none;
  padding: 6px 0 0;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #3B5BDB;
  cursor: pointer;
  text-align: left;
  align-self: flex-start;
}
.pcp-pl__card-toggle:hover {
  text-decoration: underline;
}
.pcp-pl__card-toggle .pcp-pl__card-toggle-hide { display: none; }
.pcp-pl__card-toggle[aria-expanded="true"] .pcp-pl__card-toggle-show { display: none; }
.pcp-pl__card-toggle[aria-expanded="true"] .pcp-pl__card-toggle-hide { display: inline; }
.pcp-pl__card-streets {
  margin-top: 8px;
  padding: 12px 14px;
  background: #F8F9FC;
  border-radius: 10px;
  font-size: 12px;
  color: #475569;
  line-height: 1.5;
}
.pcp-pl__card-streets p { margin: 0; }
.pcp-pl__card-status {
  display: flex;
  align-items: flex-start;
}
.pcp-pl__pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 100px;
  white-space: nowrap;
}
.pcp-pl__pill--planned {
  background: #DBEAFE;
  color: #1E40AF;
}
.pcp-pl__pill--accidental {
  background: #FEE2E2;
  color: #991B1B;
}
.pcp-pl__pill-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pcp-pl-pulse 2s ease-in-out infinite;
}
@keyframes pcp-pl-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}
@media (prefers-reduced-motion: reduce) {
  .pcp-pl__pill-dot { animation: none; }
  .pcp-pl__stat:hover { transform: none; }
}

/* ─── Empty state ────────────────────────────────────────────────────── */
.pcp-pl__empty {
  text-align: center;
  padding: 56px 24px;
  background: #F8F9FC;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
}
.pcp-pl__empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
}
.pcp-pl__empty-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: #0F172A;
  margin: 0 0 8px;
}
.pcp-pl__empty-sub {
  font-size: 14px;
  color: #64748B;
  margin: 0 0 20px;
  line-height: 1.5;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}
.pcp-pl__empty-link,
.pcp-pl__empty-reset {
  display: inline-flex;
  align-items: center;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #3B5BDB;
  text-decoration: none;
  background: #FFFFFF;
  border: 1px solid #CDDBFA;
  padding: 10px 20px;
  border-radius: 100px;
  cursor: pointer;
  transition: background 0.15s ease;
  margin: 0 4px;
}
.pcp-pl__empty-link:hover,
.pcp-pl__empty-reset:hover {
  background: #EFF4FF;
}

/* ─── Source line ────────────────────────────────────────────────────── */
.pcp-pl__source {
  font-size: 12px;
  color: #94A3B8;
  text-align: center;
  margin: 24px 0 0;
  font-style: italic;
}

/* "Actualizat: 7 mai 2026, 16:30" appended to the source line (v1.9.3).
   Inline on wide viewports — sits after the rephrased copy, separated by
   a `·` middle dot so source + freshness read as one sentence. Stacks
   below on <480px so neither line wraps awkwardly. */
.pcp-pl__source-updated {
  display: inline-block;
  margin-left: 8px;
  font-style: normal;
  color: #64748B;
}
.pcp-pl__source-updated::before {
  content: '· ';
  margin-right: 2px;
  color: #CBD5E1;
}
@media (max-width: 480px) {
  .pcp-pl__source-updated {
    display: block;
    margin-left: 0;
    margin-top: 4px;
  }
  .pcp-pl__source-updated::before {
    content: '';
    margin: 0;
  }
}

/* ─── Card entrance animation (filter changes) ───────────────────────── */
.pcp-pl[data-animating-cards="true"] .pcp-pl__card {
  animation: pcp-pl-card-in 280ms cubic-bezier(0.2, 0.6, 0.2, 1) backwards;
}
.pcp-pl[data-animating-cards="true"] .pcp-pl__card:nth-child(1) { animation-delay: 0ms; }
.pcp-pl[data-animating-cards="true"] .pcp-pl__card:nth-child(2) { animation-delay: 30ms; }
.pcp-pl[data-animating-cards="true"] .pcp-pl__card:nth-child(3) { animation-delay: 60ms; }
.pcp-pl[data-animating-cards="true"] .pcp-pl__card:nth-child(4) { animation-delay: 90ms; }
.pcp-pl[data-animating-cards="true"] .pcp-pl__card:nth-child(5) { animation-delay: 120ms; }
.pcp-pl[data-animating-cards="true"] .pcp-pl__card:nth-child(6) { animation-delay: 150ms; }
.pcp-pl[data-animating-cards="true"] .pcp-pl__card:nth-child(7) { animation-delay: 180ms; }
.pcp-pl[data-animating-cards="true"] .pcp-pl__card:nth-child(8) { animation-delay: 210ms; }
@keyframes pcp-pl-card-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .pcp-pl[data-animating-cards="true"] .pcp-pl__card { animation: none; }
}

/* ─── Mobile (<768px) ────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .pcp-pl__hero {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
  }
  .pcp-pl__stat {
    padding: 16px;
    gap: 4px;
  }
  .pcp-pl__stat-value {
    font-size: 36px;
  }
  .pcp-pl__stat-sub {
    font-size: 12px;
    line-height: 1.35;
  }
  .pcp-pl__filters {
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    gap: 12px;
  }
  .pcp-pl__filter-time {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding: 4px;
  }
  .pcp-pl__chip {
    flex-shrink: 0;
    scroll-snap-align: start;
  }
  .pcp-pl__filter-selects {
    flex-direction: column;
    gap: 8px;
  }
  .pcp-pl__select-wrap { width: 100%; }
  .pcp-pl__select { width: 100%; }

  .pcp-pl__day-head { position: static; }
  .pcp-pl__card {
    grid-template-columns: 56px 1fr;
    gap: 14px;
    padding: 16px 18px;
  }
  .pcp-pl__card-status {
    grid-column: 2;
    margin-top: 4px;
  }
  .pcp-pl__card-date {
    width: 56px;
    height: 56px;
  }
  .pcp-pl__card-day {
    font-size: 20px;
    padding-top: 8px;
  }
  .pcp-pl__card-month {
    font-size: 9px;
    padding: 3px 0;
  }
  .pcp-pl__card-title { font-size: 16px; }
  .pcp-pl__card-county {
    font-size: 11px;
    padding: 2px 8px;
  }
}

/* ─── Day-overflow toggle (v1.8.2) ────────────────────────────────────────
   Pillar's "today" view caps visible cards at 12; overflow lives inside a
   native <details> block. Summary mirrors the brand's chip styling so it
   reads as an interactive control, not a header. */
.pcp-pl__day-overflow {
  margin-top: 12px;
}

.pcp-pl__day-overflow-summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid #CDDBFA;
  border-radius: 999px;
  background: #FFFFFF;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #1E3A8A;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  user-select: none;
}

.pcp-pl__day-overflow-summary:hover {
  background: #F5F8FF;
  border-color: #3B5BDB;
}

.pcp-pl__day-overflow-summary:focus-visible {
  outline: 2px solid #3B5BDB;
  outline-offset: 2px;
}

/* Hide the default disclosure triangle in browsers that show one. */
.pcp-pl__day-overflow-summary::-webkit-details-marker {
  display: none;
}

/* Custom chevron rendered via ::after — rotates when <details> is open. */
.pcp-pl__day-overflow-summary::after {
  content: '';
  width: 10px;
  height: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 0.2s ease;
}

.pcp-pl__day-overflow[open] .pcp-pl__day-overflow-summary::after {
  transform: rotate(-135deg) translate(-2px, -2px);
}

.pcp-pl__cards--overflow {
  margin-top: 12px;
}

@media (prefers-reduced-motion: reduce) {
  .pcp-pl__day-overflow-summary,
  .pcp-pl__day-overflow-summary::after {
    transition: none;
  }
}

/* v1.9.63 — city → county fallback notice (rendered between the hero
   cards and the timeline when the locality-scoped query was empty but
   the county-scoped query returned rows). Soft blue panel using the
   same #3B5BDB brand accent as the planned-outage pills above, so
   visually it reads as "informational, on-theme" rather than
   "warning/error". */
.pcp-pl__fallback-note {
  background: #F5F8FF;
  border-left: 4px solid #3B5BDB;
  border-radius: 6px;
  color: #1E3A8A;
  font-size: 0.95rem;
  line-height: 1.45;
  margin: 0 0 16px;
  padding: 12px 16px;
}
