/* Flying Conditions — Flight Data Dashboard
   Aesthetic: Valle del Cauca field log — warm data, altitude precision
   Piedechinche = clay/thermal  |  Roldanillo = sky/altitude
*/

/* ── Page shell ─────────────────────────────────────────── */
.fc-page {
  background: var(--color-bg);
  min-height: 100vh;
}

/* ── Hero ───────────────────────────────────────────────── */
.fc-hero {
  background: var(--color-primary-dark);
  padding: var(--space-16) 0 var(--space-12);
  position: relative;
  overflow: hidden;
}
.fc-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 70% 50%, rgba(61,143,206,0.12) 0%, transparent 70%),
    radial-gradient(ellipse 50% 80% at 20% 80%, rgba(200,82,26,0.08) 0%, transparent 60%);
}
.fc-hero__inner {
  position: relative;
  z-index: 1;
}
.fc-hero .section-label {
  display: block;
  color: var(--color-sky-light);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}
.fc-hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2.8rem, 6vw, 5.5rem);
  font-weight: 800;
  color: #fff;
  line-height: 0.95;
  margin: 0 0 var(--space-5);
  letter-spacing: -0.02em;
}
.fc-hero h1 em {
  font-style: italic;
  color: var(--color-accent-light);
}
.fc-hero__sub {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  color: rgba(255,255,255,0.6);
  max-width: 540px;
  margin: 0;
  line-height: 1.6;
}
.fc-hero__sites {
  display: flex;
  gap: var(--space-6);
  margin-top: var(--space-8);
}
.fc-hero__site {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
}
.fc-hero__site-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.fc-hero__site-dot--p { background: var(--color-accent-light); }
.fc-hero__site-dot--r { background: var(--color-sky); }

/* ── Sticky filter bar ──────────────────────────────────── */
.fc-filters {
  position: sticky;
  top: var(--header-h);
  z-index: 40;
  background: var(--color-primary);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 4px 20px rgba(15,32,53,0.35);
}
.fc-filters__inner {
  padding: var(--space-4) 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* Month picker */
.fc-months {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 3px;
}
@media (max-width: 768px) {
  .fc-months { grid-template-columns: repeat(6, 1fr); }
}
@media (max-width: 480px) {
  .fc-months { grid-template-columns: repeat(4, 1fr); }
}

.fc-month-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: var(--space-2) var(--space-1) var(--space-2);
  height: 64px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.04);
  cursor: pointer;
  transition: all var(--transition-fast);
  overflow: hidden;
  gap: 2px;
}
.fc-month-btn:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.25);
}
.fc-month-btn.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  box-shadow: 0 0 12px rgba(200,82,26,0.4);
}
.fc-month-btn.active .fc-month-bar { background: rgba(255,255,255,0.4); }
.fc-month-name {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  line-height: 1;
  position: relative;
  z-index: 1;
}
.fc-month-btn.active .fc-month-name { color: #fff; }
.fc-month-bar-wrap {
  width: 100%;
  height: 28px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 3px;
}
.fc-month-bar {
  width: 100%;
  border-radius: 1px 1px 0 0;
  background: rgba(136,196,228,0.45);
  transition: height 0.4s ease, background 0.2s;
  min-height: 2px;
}

/* Filter row: location + year */
.fc-filter-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.fc-filter-label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  white-space: nowrap;
}
.fc-toggle-group {
  display: flex;
  gap: 2px;
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-md);
  padding: 2px;
}
.fc-toggle-btn {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  padding: var(--space-1) var(--space-3);
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.fc-toggle-btn:hover { color: #fff; background: rgba(255,255,255,0.08); }
.fc-toggle-btn.active { background: rgba(255,255,255,0.15); color: #fff; }
.fc-toggle-btn.active[data-loc="piedechinche"] { background: var(--color-accent); }
.fc-toggle-btn.active[data-loc="roldanillo"]   { background: var(--color-sky); }

/* Data summary line */
.fc-filter-summary {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.35);
  white-space: nowrap;
}
@media (max-width: 640px) { .fc-filter-summary { display: none; } }

/* ── Main content ───────────────────────────────────────── */
.fc-content {
  padding-top: var(--space-12);
  padding-bottom: var(--space-24);
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

/* ── Stat cards ─────────────────────────────────────────── */
.fc-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}
@media (max-width: 900px) {
  .fc-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .fc-stats { grid-template-columns: 1fr 1fr; }
}

.fc-stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  opacity: 0;
  transform: translateY(10px);
  animation: fcCardIn 0.4s ease forwards;
  box-shadow: var(--shadow-sm);
}
.fc-stat-card:nth-child(1) { animation-delay: 0.05s; }
.fc-stat-card:nth-child(2) { animation-delay: 0.10s; }
.fc-stat-card:nth-child(3) { animation-delay: 0.15s; }
.fc-stat-card:nth-child(4) { animation-delay: 0.20s; }

@keyframes fcCardIn {
  to { opacity: 1; transform: translateY(0); }
}

.fc-stat-label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.fc-stat-value {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1;
  letter-spacing: -0.02em;
}
.fc-stat-value span {
  font-size: 0.45em;
  font-weight: 400;
  color: var(--color-text-muted);
  letter-spacing: 0;
}
.fc-stat-sub {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-light);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fc-stat-card--top .fc-stat-value { color: var(--color-accent); }

/* ── Section title ──────────────────────────────────────── */
.fc-section-title {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-primary);
  margin: 0 0 var(--space-5);
  letter-spacing: -0.01em;
}
.fc-section-title em {
  font-style: italic;
  color: var(--color-text-muted);
  font-weight: 400;
  font-size: 0.75em;
}

/* ── Chart ──────────────────────────────────────────────── */
.fc-chart-wrap {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: var(--shadow-sm);
}
.fc-chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  gap: var(--space-4);
  flex-wrap: wrap;
}
.fc-chart-legend {
  display: flex;
  gap: var(--space-4);
}
.fc-legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.fc-legend-line {
  width: 20px;
  height: 2px;
  border-radius: 1px;
}
.fc-legend-line--p { background: var(--color-accent); }
.fc-legend-line--r { background: var(--color-sky); }

.fc-chart-svg-wrap {
  position: relative;
  width: 100%;
}
.fc-chart-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

/* Chart tooltip */
.fc-tooltip {
  position: absolute;
  background: var(--color-primary-dark);
  color: #fff;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 1.6;
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transition: opacity var(--transition-fast);
  z-index: 10;
  box-shadow: var(--shadow-md);
  transform: translateX(-50%);
}
.fc-tooltip.visible { opacity: 1; }
.fc-tooltip strong {
  display: block;
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-sky-light);
  margin-bottom: 2px;
}

/* ── Bottom grid ─────────────────────────────────────────── */
.fc-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
}
@media (max-width: 860px) {
  .fc-bottom-grid { grid-template-columns: 1fr; }
}

/* ── Pilots & best flights panels ────────────────────────── */
.fc-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-6) var(--space-4);
  box-shadow: var(--shadow-sm);
}

.fc-table {
  width: 100%;
  border-collapse: collapse;
}
.fc-table th {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--color-text-light);
  padding: var(--space-2) var(--space-3) var(--space-3);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}
.fc-table th:not(:first-child) { text-align: right; }
.fc-table td {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text);
  padding: var(--space-3);
  border-bottom: 1px solid var(--color-bg-alt);
  vertical-align: middle;
}
.fc-table td:not(:first-child) { text-align: right; }
.fc-table tr:last-child td { border-bottom: none; }
.fc-table tr:hover td { background: var(--color-bg); }

.fc-rank {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-text-light);
  width: 24px;
  display: inline-block;
}
.fc-rank--gold   { color: #b8922a; }
.fc-rank--silver { color: #7a8a9a; }
.fc-rank--bronze { color: #8a6040; }

.fc-pilot-name {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
}
.fc-km {
  font-weight: 700;
  color: var(--color-primary);
}
.fc-location-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: var(--space-1);
  vertical-align: middle;
}
.fc-location-dot--p { background: var(--color-accent); }
.fc-location-dot--r { background: var(--color-sky); }

/* ── Empty / loading states ──────────────────────────────── */
.fc-empty {
  text-align: center;
  padding: var(--space-12) var(--space-8);
  color: var(--color-text-light);
  font-family: var(--font-body);
}
.fc-empty svg {
  opacity: 0.25;
  margin-bottom: var(--space-4);
}
.fc-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-16);
  gap: var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.fc-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--color-border-dark);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: fcSpin 0.7s linear infinite;
}
@keyframes fcSpin { to { transform: rotate(360deg); } }

/* ── No-data fallback (JS disabled or load error) ────────── */
#fc-app[aria-busy="true"] .fc-stats,
#fc-app[aria-busy="true"] .fc-chart-wrap,
#fc-app[aria-busy="true"] .fc-bottom-grid {
  opacity: 0.4;
  pointer-events: none;
}
