/* ========== Reset & Base ========== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #273449;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --accent: #38bdf8;
  --accent-hover: #7dd3fc;
  --tag-bg: #334155;
  --success: #22c55e;
  --warning: #f59e0b;
  --radius: 12px;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover { color: var(--accent-hover); }

/* ========== Header ========== */
.header {
  background: linear-gradient(135deg, #0f172a 0%, #1a1a3e 50%, #0f172a 100%);
  padding: 3rem 1.5rem 2rem;
  text-align: center;
  border-bottom: 1px solid var(--tag-bg);
}

.logo {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-sub {
  color: var(--text-muted);
  font-size: 1rem;
  margin-top: 0.25rem;
}

/* ========== Stats Bar ========== */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 3rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--tag-bg);
}

.stat {
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ========== Container ========== */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text);
}

/* ========== Briefing Card ========== */
.briefing-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 2rem;
}

.briefing-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.weather-block {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem;
  background: rgba(56, 189, 248, 0.08);
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.weather-temp {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent);
}

.weather-details {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.8;
}

.news-list {
  list-style: none;
}

.news-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--tag-bg);
}

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

.news-title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.news-title a {
  color: var(--text);
  transition: color 0.2s;
}

.news-title a:hover {
  color: var(--accent);
}

.news-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem;
  font-style: italic;
}

/* ========== History ========== */
.briefing-history {
  margin-top: 2rem;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.history-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: background 0.2s;
}

.history-item:hover {
  background: var(--bg-card-hover);
}

.history-item.active {
  border-left: 3px solid var(--accent);
}

.history-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.history-date {
  font-weight: 700;
  font-size: 1rem;
}

.history-day {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.history-right {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.history-badge {
  background: var(--tag-bg);
  color: var(--text-muted);
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
}

.history-badge.sent {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

/* ========== Detail Modal ========== */
.detail-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 100;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.detail-overlay.show {
  display: flex;
}

.detail-content {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 700px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}

.detail-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.detail-close:hover {
  color: var(--text);
}

/* ========== Footer ========== */
.footer {
  text-align: center;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--tag-bg);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer a {
  display: inline-block;
  margin-top: 0.5rem;
  font-weight: 600;
}

/* ========== Responsive ========== */
@media (max-width: 600px) {
  .stats-bar {
    gap: 1.5rem;
  }
  .stat-value {
    font-size: 1.3rem;
  }
  .weather-block {
    flex-direction: column;
    text-align: center;
  }
  .briefing-card {
    padding: 1.25rem;
  }
}
