/* ============================================
   News Dashboard Hub — Glow Up Theme
   Modern, fresh, minimal — cohesive across all pages
   ============================================ */

/* ---------- Custom Properties ---------- */
:root {
  --bg: #f8f9fc;
  --bg-gradient:
    radial-gradient(ellipse 80% 50% at 15% 0%, rgba(99,102,241,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 85% 100%, rgba(168,85,247,0.05) 0%, transparent 55%),
    radial-gradient(ellipse 50% 35% at 50% 50%, rgba(129,140,248,0.03) 0%, transparent 50%),
    linear-gradient(168deg, #f8f9fc 0%, #f0eeff 30%, #eef2ff 55%, #f5f3ff 75%, #f8f9fc 100%);
  --surface: rgba(255,255,255,0.7);
  --surface-solid: #ffffff;
  --surface-hover: rgba(255,255,255,0.92);
  --border: rgba(148,163,184,0.16);
  --border-light: rgba(148,163,184,0.07);
  --border-hover: rgba(99,102,241,0.28);
  --text: #0f172a;
  --text-secondary: #475569;
  --muted: #94a3b8;
  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-dark: #4f46e5;
  --accent-bg: rgba(99,102,241,0.06);
  --accent-glow: rgba(99,102,241,0.14);
  --green: #10b981;
  --green-bg: rgba(16,185,129,0.08);
  --red: #ef4444;
  --red-bg: rgba(239,68,68,0.06);
  --shadow-xs: 0 1px 2px rgba(15,23,42,0.03);
  --shadow-sm: 0 1px 3px rgba(15,23,42,0.04), 0 1px 2px rgba(15,23,42,0.02);
  --shadow: 0 4px 14px rgba(15,23,42,0.06), 0 1px 4px rgba(15,23,42,0.03);
  --shadow-md: 0 12px 32px rgba(15,23,42,0.07), 0 4px 12px rgba(99,102,241,0.04);
  --shadow-glow: 0 0 0 3px var(--accent-glow), 0 8px 24px rgba(99,102,241,0.12);
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 0.35s cubic-bezier(0.2, 0.85, 0.3, 1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-gradient);
  background-color: var(--bg);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* Subtle grain texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.018;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

.wrap {
  position: relative;
  z-index: 1;
}

/* ---------- Links ---------- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  margin-bottom: 1.5rem;
  transition: color var(--transition), gap var(--transition-spring);
  letter-spacing: -0.01em;
}
.back-link:hover { color: var(--accent-dark); gap: 0.55rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: all var(--transition-spring);
  box-shadow: 0 2px 8px rgba(99,102,241,0.22), inset 0 1px 0 rgba(255,255,255,0.15);
  letter-spacing: -0.01em;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99,102,241,0.32), inset 0 1px 0 rgba(255,255,255,0.15);
  filter: brightness(1.05);
}
.btn:active { transform: translateY(0); box-shadow: 0 1px 4px rgba(99,102,241,0.2); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; filter: none; }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.15rem;
  background: var(--surface);
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: all var(--transition-spring);
  letter-spacing: -0.01em;
}
.btn-outline:hover {
  border-color: var(--border-hover);
  background: var(--accent-bg);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.btn.secondary {
  background: var(--surface);
  color: var(--accent);
  border: 1px solid var(--accent);
  box-shadow: none;
}
.btn.secondary:hover {
  background: var(--accent-bg);
  box-shadow: none;
}
.btn.full { width: 100%; justify-content: center; }

/* ---------- Cards (glass-morphism lite) ---------- */
.card, .form-section, .section, .headline-box, .topic, .register-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: all var(--transition-spring);
}
.card:hover, .topic:hover {
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,0.5);
  border-color: var(--border-hover);
}

/* ---------- Inputs ---------- */
input[type="text"], input[type="password"], textarea {
  width: 100%;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface-solid);
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
input[type="text"]:focus, input[type="password"]:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: #fff;
}
input[type="text"]::placeholder, input[type="password"]::placeholder, textarea::placeholder {
  color: var(--muted);
  opacity: 0.7;
}
textarea { resize: vertical; min-height: 80px; }

/* ---------- Tags / Badges ---------- */
.card-tag {
  font-size: 0.68rem;
  padding: 0.22rem 0.65rem;
  border-radius: 100px;
  background: var(--accent-bg);
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.card-tag.muted {
  background: rgba(148,163,184,0.06);
  color: var(--muted);
  border: 1px solid var(--border-light);
}

/* ---------- Messages ---------- */
.msg {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-xs);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  backdrop-filter: blur(8px);
}
.msg.error { background: var(--red-bg); color: var(--red); border: 1px solid rgba(239,68,68,0.15); }
.msg.success { background: var(--green-bg); color: var(--green); border: 1px solid rgba(16,185,129,0.15); }

/* ---------- Scrollbars ---------- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.2); border-radius: 10px; transition: background 0.15s; }
::-webkit-scrollbar-thumb:hover { background: rgba(148,163,184,0.35); }
* { scrollbar-width: thin; scrollbar-color: rgba(148,163,184,0.2) transparent; }

/* ---------- Animations ---------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

.wrap { animation: fadeIn 0.35s ease-out; }

/* ---------- Footer ---------- */
footer {
  text-align: center;
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
  font-size: 0.73rem;
  color: var(--muted);
  line-height: 1.8;
  animation: fadeIn 0.5s ease-out 0.4s both;
}
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ---------- Loading / Empty / Error ---------- */
.loading {
  text-align: center;
  padding: 3rem;
  color: var(--muted);
  font-size: 0.88rem;
}
.empty-state, .error-state {
  text-align: center;
  padding: 4rem 1rem;
}
.empty-state .emoji, .error-state .emoji { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h2, .error-state h2 { font-size: 1.15rem; font-weight: 600; margin-bottom: 0.5rem; letter-spacing: -0.02em; }
.empty-state p, .error-state p { font-size: 0.88rem; color: var(--muted); margin-bottom: 1.5rem; }

/* ---------- Selection ---------- */
::selection {
  background: rgba(99,102,241,0.15);
  color: var(--text);
}

/* ---------- Focus visible ---------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
