/* ===== Custom Properties (shared with wt-progress) ===== */
:root {
  --bg-primary: #0D0F1A;
  --bg-secondary: #161929;
  --card-bg: rgba(255,255,255,0.04);
  --card-border: rgba(37,42,58,0.5);
  --card-radius: 12px;
  --red: #C62828;
  --pink: #E53935;
  --gold: #F5A623;
  --green: #22c55e;
  --warning: #f59e0b;
  --text-primary: #f1f5f9;
  --text-secondary: #e2e8f0;
  --text-muted: #6B7194;
  --text-dim: #4A5068;

  /* Patch-notes functional colors */
  --color-buff: #22c55e;
  --color-buff-bg: rgba(34,197,94,0.12);
  --color-nerf: #ef4444;
  --color-nerf-bg: rgba(239,68,68,0.12);
  --color-rework: #f59e0b;
  --color-rework-bg: rgba(245,158,11,0.12);
  --color-new: #3b82f6;
  --color-new-bg: rgba(59,130,246,0.12);
  --color-rule: #8b5cf6;
  --color-rule-bg: rgba(139,92,246,0.12);
  --color-fix: #64748b;
  --color-fix-bg: rgba(100,116,139,0.12);

  --impact-high: #ef4444;
  --impact-medium: #f59e0b;
  --impact-low: #6b7280;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
  background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 40%, #0c0a14 70%, var(--bg-primary) 100%);
  color: var(--text-secondary);
  line-height: 1.6;
  min-height: 100vh;
  color-scheme: dark;
}

::selection { background: rgba(229,57,53,0.2); color: #fff; }

*:focus { outline: none; }
*:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 2px;
}
button:focus-visible, a:focus-visible {
  outline: 3px solid var(--pink);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(229,57,53,0.2);
}
input:focus-visible { outline: none; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar       { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.14); }

/* ===== Animations ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes highlight {
  0%, 100% { background: var(--card-bg); }
  50% { background: rgba(229,57,53,0.08); }
}

@keyframes slideIn {
  from { transform: translateY(100px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* Staggered page entrance */
.meta-tldr-card      { animation: fadeInUp 0.4s ease both; }
.filter-bar          { animation: fadeInUp 0.4s ease 0.1s both; }
.collapsible-section { animation: fadeInUp 0.4s ease 0.2s both; }

/* ===== Container ===== */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

/* ===== Meta TLDR Card ===== */
.meta-tldr-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 40px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.meta-tldr-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(229,57,53,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.meta-tldr-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--red), var(--pink), rgba(245,166,35,0.4));
  border-radius: 16px 16px 0 0;
}

.meta-tldr-card:hover {
  border-color: rgba(229,57,53,0.18);
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
}

.tldr-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.season-badge {
  background: rgba(229,57,53,0.12);
  border: 1px solid rgba(229,57,53,0.25);
  color: var(--pink);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.tldr-title {
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 800;
  color: var(--text-primary);
  flex: 1;
  letter-spacing: -0.02em;
}

.tldr-content { margin-bottom: 24px; }

.impact-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.5;
  transition: background 0.2s ease;
}

.impact-item:hover { background: rgba(255,255,255,0.06); }

.impact-icon {
  font-size: 20px;
  flex-shrink: 0;
  width: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.impact-icon i {
  font-size: 20px;
  color: var(--pink);
}

.tldr-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ===== Buttons ===== */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background: linear-gradient(135deg, var(--red), var(--pink));
  color: #fff;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(229,57,53,0.35);
}

.btn-primary:active {
  transform: scale(0.97);
  transition-duration: 0.05s;
}

.btn-secondary {
  background: var(--card-bg);
  color: var(--text-secondary);
  border: 1px solid var(--card-border);
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.15);
}

.btn i { font-size: 16px; }

/* ===== Filter Bar ===== */
.filter-bar {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  padding: 20px;
  margin-bottom: 30px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.filter-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.filter-toggle {
  padding: 8px 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.filter-toggle:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.15);
}

.filter-toggle.active {
  background: linear-gradient(135deg, var(--red), var(--pink));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(229,57,53,0.3);
}

.search-input {
  flex: 1;
  min-width: 250px;
  padding: 10px 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input::placeholder { color: var(--text-dim); }

.search-input:focus {
  outline: none;
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(229,57,53,0.12);
}

/* ===== Change Card ===== */
.change-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  padding: 24px;
  margin-bottom: 16px;
  border-left: 4px solid var(--card-border);
  transition: all 0.2s ease;
}

.change-card:hover {
  box-shadow: 0 12px 28px rgba(0,0,0,0.35), 0 0 0 1px rgba(229,57,53,0.1);
  transform: translateY(-2px);
}

.change-card.impact-high   { border-left-color: var(--impact-high); }
.change-card.impact-medium { border-left-color: var(--impact-medium); }
.change-card.impact-low    { border-left-color: var(--impact-low); }

.change-card.highlight-flash { animation: highlight 2s ease-out; }

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.tag-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(255,255,255,0.04);
  color: var(--text-muted);
}

.tag-buff   { background: var(--color-buff-bg);   color: var(--color-buff); }
.tag-nerf   { background: var(--color-nerf-bg);   color: var(--color-nerf); }
.tag-rework { background: var(--color-rework-bg); color: var(--color-rework); }
.tag-new    { background: var(--color-new-bg);    color: var(--color-new); }
.tag-rule   { background: var(--color-rule-bg);   color: var(--color-rule); }
.tag-fix    { background: var(--color-fix-bg);    color: var(--color-fix); }

.tag i { font-size: 11px; margin-right: 4px; }

/* Impact tag variants */
.tag.impact-high   { background: rgba(239,68,68,0.12);  color: var(--impact-high); }
.tag.impact-medium { background: rgba(245,158,11,0.12); color: var(--impact-medium); }
.tag.impact-low    { background: rgba(107,114,128,0.12); color: var(--impact-low); }

.copy-link-btn {
  padding: 6px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.copy-link-btn:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.15);
}

.copy-link-btn i {
  font-size: 13px;
  margin-right: 4px;
  vertical-align: middle;
}

.change-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.value-change {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  margin-right: 8px;
  font-size: 15px;
  font-weight: 600;
  padding: 6px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 8px;
}

.value-stat {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
}

.value-before {
  color: var(--text-muted);
  text-decoration: line-through;
}

.value-arrow {
  color: var(--pink);
  font-weight: 700;
}

.value-after {
  color: var(--pink);
}

.change-details {
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.6;
}

.developer-note {
  background: rgba(229,57,53,0.04);
  border-left: 3px solid var(--pink);
  padding: 14px 18px;
  border-radius: 0 8px 8px 0;
  color: var(--text-muted);
  font-size: 14px;
  font-style: italic;
  line-height: 1.6;
}

/* ===== Collapsible Section ===== */
.collapsible-section { margin-bottom: 24px; }

.section-header {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 20px 24px;
  border-radius: var(--card-radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.2s ease;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.section-header::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--red), var(--pink));
  opacity: 0.6;
}

.section-header:hover {
  border-color: rgba(229,57,53,0.18);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.section-header:hover::before { opacity: 1; }

.section-icon {
  font-size: 22px;
  width: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.section-icon i {
  font-size: 22px;
  color: var(--pink);
}

.section-info { flex: 1; }

.section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.section-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

.section-meta {
  display: flex;
  align-items: center;
  gap: 16px;
}

.change-count {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

.impact-dots {
  display: flex;
  gap: 6px;
}

.impact-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.impact-dot.high   { background: var(--impact-high); }
.impact-dot.medium { background: var(--impact-medium); }
.impact-dot.low    { background: var(--impact-low); }

.section-chevron {
  color: var(--text-muted);
  transition: transform 0.3s;
}

.section-header.expanded {
  background: rgba(255,255,255,0.06);
  border-color: rgba(229,57,53,0.15);
}

.section-header.expanded .section-chevron {
  transform: rotate(180deg);
}

.section-content {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s ease-out;
}

.section-content.expanded {
  grid-template-rows: 1fr;
}

.section-content-inner {
  overflow: hidden;
}

.section-content.expanded .section-content-inner {
  padding-top: 16px;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(13,15,26,0.95);
  border: 1px solid rgba(229,57,53,0.3);
  border-radius: 10px;
  padding: 16px 24px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 1000;
  animation: slideIn 0.3s ease-out;
  color: var(--text-secondary);
  font-size: 14px;
  backdrop-filter: blur(12px);
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}

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

.empty-state p {
  font-size: 16px;
  margin-bottom: 20px;
}

/* ===== Footer (matches wt-progress .page-footer) ===== */
.page-footer {
  text-align: center;
  padding: 2rem 1rem;
  color: #888;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 0.85rem;
  margin-top: 2rem;
}

.page-footer p { margin: 0; }

.page-footer a {
  color: var(--gold);
  text-decoration: none;
  transition: color 0.15s ease, opacity 0.15s ease;
}

.page-footer a:hover {
  color: #FFD054;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-disclaimer {
  color: #666;
  font-size: 0.75rem;
  margin: 0.5rem 0 0.75rem;
}

.footer-tip {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  color: #888;
}

.footer-tip a {
  color: #F5A623;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.25s ease;
}

.footer-tip a:hover {
  color: #FFD054;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  font-size: 0.75rem;
}

.footer-links a.feedback { color: #F5A623; }
.footer-links a.feedback:hover { color: #FFD054; }

/* ===== Hover-only effects (prevent sticky hovers on touch) ===== */
@media (hover: none) {
  .change-card:hover,
  .meta-tldr-card:hover,
  .section-header:hover {
    transform: none;
    box-shadow: none;
  }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .container { padding: 16px 14px 40px; }

  .tldr-title { font-size: 22px; }

  .meta-tldr-card { padding: 24px; }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group { flex-wrap: wrap; }
  .filter-toggle { min-height: 44px; }

  .search-input { min-width: 100%; min-height: 44px; }

  .section-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .section-header { padding: 16px 18px; }

  .change-card { padding: 18px; }

  .page-footer { font-size: 0.8rem; padding: 1.5rem 0.75rem; }

  .toast {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    max-width: calc(100% - 32px);
  }
}

@media (max-width: 480px) {
  .container { padding: 12px 14px 36px; }

  .tldr-title { font-size: 20px; }
  .meta-tldr-card { padding: 20px; border-radius: 12px; }
  .filter-toggle { padding: 6px 12px; font-size: 13px; }
  .change-card { padding: 16px; }
  .change-title { font-size: 18px; }
  .section-title { font-size: 18px; }
  .footer-links { gap: 1rem; }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
