/**
 * Cascade Nexus — Cards
 * Reusable card component system with variants.
 */

/* ─── Base Card ──────────────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: 24px;
  transition:
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.35s ease;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--glass-highlight) 0%, transparent 50%);
  pointer-events: none;
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md), 0 0 0 1px var(--glow-cyan-subtle);
}

.card-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: var(--text-tertiary);
  margin-bottom: 14px;
  position: relative;
}

.card-value {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  position: relative;
}

.card-value .unit {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text-tertiary);
  margin-left: 4px;
}

.card-change {
  font-size: 13px;
  font-weight: 500;
  margin-top: 4px;
  position: relative;
}

.card-change.up { color: var(--emerald); }
.card-change.down { color: var(--red); }
.card-change.neutral { color: var(--text-tertiary); }

/* ─── Weather Card ───────────────────────────────────────────────────── */
.weather-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.weather-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 120% 80% at 30% 20%, var(--glow-blue) 0%, transparent 60%);
  pointer-events: none;
}

.weather-main {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  position: relative;
}

.weather-icon-big {
  font-size: 2.8rem;
  line-height: 1;
}

.weather-temp {
  font-family: var(--font-serif);
  font-size: 3rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
}

.weather-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  position: relative;
}

.weather-details {
  display: flex;
  gap: 20px;
  font-size: 12px;
  color: var(--text-tertiary);
  position: relative;
  flex-wrap: wrap;
}

.weather-details span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ─── Financial Card ─────────────────────────────────────────────────── */
.financial-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
  position: relative;
  gap: 8px;
}

.financial-price {
  font-size: 1.4rem;
  font-weight: 700;
  font-family: var(--font-sans);
  letter-spacing: -0.02em;
}

.financial-change {
  font-size: 13px;
}

/* ─── Earthquake Card ────────────────────────────────────────────────── */
.eq-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-light);
}

.eq-item:last-child { border-bottom: none; }

.eq-mag {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}

.eq-mag.major {
  background: var(--badge-red-bg);
  color: var(--red);
}
.eq-mag.moderate {
  background: var(--badge-gold-bg);
  color: var(--gold);
}
.eq-mag.minor {
  background: var(--badge-blue-bg);
  color: var(--pacific-blue);
}

.eq-info {
  flex: 1;
  margin-left: 12px;
  min-width: 0;
}

.eq-location {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.eq-time {
  font-size: 11px;
  color: var(--text-tertiary);
}

/* ─── Economy Item ───────────────────────────────────────────────────── */
.econ-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 13px;
}

.econ-item .label {
  color: var(--text-secondary);
}

.econ-item .value {
  font-weight: 600;
}

/* ─── Article Preview Card ───────────────────────────────────────────── */
.article-preview {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: opacity 0.25s ease, padding-left 0.3s ease;
}

.article-preview:last-child { border-bottom: none; }

.article-preview:hover {
  opacity: 0.75;
  padding-left: 4px;
}

.article-preview-img {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: var(--badge-green-bg);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.article-preview-content {
  flex: 1;
  min-width: 0;
}

.article-preview-content h4 {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
  line-height: 1.4;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-meta {
  font-size: 11px;
  color: var(--text-tertiary);
  display: flex;
  gap: 10px;
}

/* ─── Project Card ───────────────────────────────────────────────────── */
.project-card {
  padding: 20px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  transition:
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.35s ease,
    border-color 0.35s ease;
  box-shadow: var(--shadow-sm);
}

.project-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.project-card h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
}

.project-card .project-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.project-card .project-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.project-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  background: var(--badge-green-bg);
  color: var(--emerald);
  margin-bottom: 8px;
}

.project-status.planning {
  background: var(--badge-blue-bg);
  color: var(--pacific-blue);
}

.project-status.completed {
  background: var(--badge-gray-bg);
  color: var(--text-tertiary);
}

.progress-bar {
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 12px;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--aurora-cyan), var(--emerald));
}

/* ─── Volcano Alert Card ─────────────────────────────────────────────── */
.volcano-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 10px;
  margin-bottom: 8px;
  border: 1px solid;
}

.volcano-alert.green {
  background: var(--badge-green-bg);
  border-color: var(--badge-green-border);
}

.volcano-alert.yellow {
  background: var(--badge-gold-bg);
  border-color: var(--badge-gold-border);
}

.volcano-alert.red {
  background: var(--badge-red-bg);
  border-color: var(--badge-red-border);
}

/* ─── Forecast Card ──────────────────────────────────────────────────── */
.forecast-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 8px;
  text-align: center;
  transition:
    transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.3s ease,
    border-color 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.forecast-card:hover {
  border-color: var(--aurora-cyan);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.forecast-card .day {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.forecast-card .icon {
  font-size: 26px;
  margin-bottom: 8px;
  line-height: 1;
}

.forecast-card .high {
  font-size: 16px;
  font-weight: 600;
}

.forecast-card .low {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ─── Empty State ────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  grid-column: 1 / -1;
}

.empty-state-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state h3 {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.empty-state p {
  font-size: 14px;
  color: var(--text-tertiary);
  max-width: 400px;
  margin: 0 auto;
}

/* ─── Weather Detail Grid ────────────────────────────────────────────── */
.weather-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4px;
}

.weather-detail-item {
  padding: 8px;
  text-align: center;
}

.weather-detail-item .wd-label {
  font-size: 10px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.weather-detail-item .wd-value {
  font-size: 16px;
  font-weight: 600;
  margin-top: 2px;
}

/* ─── Radar / Chart Placeholder ──────────────────────────────────────── */
.radar-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--card-radius);
  background: var(--chart-bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  color: var(--text-tertiary);
  font-size: 13px;
  position: relative;
  overflow: hidden;
}

.radar-placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 40%, var(--glow-blue) 0%, transparent 40%),
    radial-gradient(circle at 70% 60%, var(--glow-cyan-subtle) 0%, transparent 30%);
  animation: pulseGlow 4s ease-in-out infinite;
}

.chart-placeholder {
  width: 100%;
  height: 160px;
  background: var(--chart-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 12px;
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  width: 100%;
  height: 100%;
}

.chart-bars .bar {
  flex: 1;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, var(--aurora-cyan), rgba(45, 212, 191, 0.15));
  min-height: 6px;
  transform-origin: bottom;
}

/* ─── Map Placeholder ────────────────────────────────────────────────── */
.map-placeholder {
  width: 100%;
  aspect-ratio: 21/9;
  background: var(--chart-bg);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
}

.map-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: 0 0 16px currentColor;
}

.map-dot.green { background: var(--emerald); color: var(--emerald); }
.map-dot.blue { background: var(--pacific-blue); color: var(--pacific-blue); }
.map-dot.gold { background: var(--gold); color: var(--gold); }

/* ─── Source Badge ───────────────────────────────────────────────────── */
.source-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 6px;
  background: var(--badge-green-bg);
  border: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}
