/* Core theme tokens */
:root {
  --background: #09090b;
  --foreground: #fafafa;
  --card: #111115;
  --card-foreground: #ffffff;
  --primary: #FF2E2E;
  --secondary: #18181b;
  --muted: #18181b;
  --muted-foreground: #a1a1aa;
  --border: #27272a;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--background);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4, h5, h6 { font-family: 'Plus Jakarta Sans', sans-serif; }
code { font-family: 'JetBrains Mono', Menlo, Consolas, monospace; }

/* Utility mappings for Tailwind-like custom colors */
.bg-background { background-color: var(--background); }
.bg-card { background-color: var(--card); }
.bg-muted { background-color: var(--muted); }
.bg-secondary { background-color: var(--secondary); }
.text-foreground { color: var(--foreground); }
.text-muted-foreground { color: var(--muted-foreground); }
.text-primary { color: var(--primary); }
.border-border { border-color: var(--border); }
.border-border\/50 { border-color: rgba(39, 39, 42, 0.5); }
.bg-primary { background-color: var(--primary); }
.bg-primary\/10 { background-color: rgba(255, 46, 46, 0.1); }
.bg-secondary\/50 { background-color: rgba(24, 24, 27, 0.5); }
.bg-primary\/20 { background-color: rgba(255, 46, 46, 0.2); }

/* App-specific styles copied from React demo */
.post-card {
  background: #121212;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 1.5rem;
  transition: border-color 0.3s ease;
}
.post-card:hover { border-color: rgba(255, 46, 46, 0.3); }
.vote-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.vote-btn:hover { background-color: rgba(255, 255, 255, 0.1); }
.vote-btn.upvoted { color: #FF2E2E; background-color: rgba(255, 46, 46, 0.1); }
.vote-btn.downvoted { color: #6366f1; background-color: rgba(99, 102, 241, 0.1); }
.magazine-overlay { background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.3) 50%, transparent 100%); }
input:focus, textarea:focus {
  outline: none;
  border-color: #FF2E2E;
  box-shadow: 0 0 0 2px rgba(255, 46, 46, 0.2);
}
.btn-primary {
  background-color: #FF2E2E;
  color: white;
  padding: 0.625rem 1.5rem;
  border-radius: 9999px;
  font-weight: 500;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 0 20px rgba(255, 46, 46, 0.3);
  border: none;
}
.btn-primary:hover { background-color: #e62929; transform: scale(1.02); box-shadow: 0 0 30px rgba(255, 46, 46, 0.4); }
.btn-primary:active { transform: scale(0.98); }
.btn-secondary {
  background-color: #27272a;
  color: #fafafa;
  padding: 0.625rem 1.5rem;
  border-radius: 9999px;
  font-weight: 500;
  transition: background-color 0.2s ease;
  border: none;
}
.btn-secondary:hover { background-color: #3f3f46; }
.btn-ghost {
  background-color: transparent;
  color: #a1a1aa;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-weight: 500;
  transition: background-color 0.2s ease, color 0.2s ease;
  border: none;
}
.btn-ghost:hover { background-color: rgba(255, 46, 46, 0.1); color: #FF2E2E; }
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  background-color: #27272a;
  color: #a1a1aa;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.tag:hover { background-color: rgba(255, 46, 46, 0.2); color: #FF2E2E; }
.comment-nested { border-left: 2px solid #27272a; margin-left: 1rem; padding-left: 1rem; }
.comment-nested:hover { border-left-color: #FF2E2E; }
.avatar-ring { border: 2px solid transparent; transition: border-color 0.2s ease; }
.avatar-ring:hover { border-color: #FF2E2E; }
.community-badge { background: linear-gradient(135deg, #FF2E2E 0%, #C41C1C 100%); padding: 0.125rem 0.5rem; border-radius: 4px; font-size: 0.625rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.trending-indicator { display: flex; align-items: center; gap: 0.25rem; color: #FF2E2E; font-size: 0.75rem; font-weight: 600; }
.rich-content p { margin-bottom: 1rem; line-height: 1.7; }
.rich-content strong { color: #fafafa; font-weight: 600; }
.rich-content em { font-style: italic; }
.rich-content a { color: #FF2E2E; text-decoration: underline; text-underline-offset: 2px; }
.rich-content a:hover { color: #ff6b6b; }
.sidebar-sticky { position: sticky; top: 5rem; }
.skeleton { background: linear-gradient(90deg, #18181b 25%, #27272a 50%, #18181b 75%); background-size: 200% 100%; animation: skeleton-loading 1.5s infinite; }
@keyframes skeleton-loading { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.nav-active { color: #FF2E2E; position: relative; }
.nav-active::after { content: ''; position: absolute; bottom: -2px; left: 0; right: 0; height: 2px; background-color: #FF2E2E; border-radius: 1px; }
.sort-tab { padding: 0.5rem 1rem; border-radius: 8px; font-weight: 500; color: #a1a1aa; transition: background-color 0.2s ease, color 0.2s ease; border: none; }
.sort-tab:hover { background-color: #27272a; color: #fafafa; }
.sort-tab.active { background-color: rgba(255, 46, 46, 0.1); color: #FF2E2E; }
.mobile-menu { position: fixed; top: 64px; left: 0; right: 0; bottom: 0; background: #09090b; z-index: 40; padding: 1rem; overflow-y: auto; }
.form-input { background-color: #18181b; border: 1px solid #27272a; border-radius: 8px; padding: 0.75rem 1rem; color: #fafafa; width: 100%; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.form-input::placeholder { color: #71717a; }
.tooltip { background-color: #27272a; color: #fafafa; padding: 0.5rem 0.75rem; border-radius: 6px; font-size: 0.75rem; box-shadow: 0 4px 12px rgba(0,0,0,0.4); }
.badge-counter { position: absolute; top: -4px; right: -4px; background-color: #FF2E2E; color: white; font-size: 0.625rem; font-weight: 700; min-width: 16px; height: 16px; border-radius: 9999px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.glass { background: rgba(9, 9, 11, 0.7); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid rgba(255, 255, 255, 0.05); }
.glow-red { box-shadow: 0 0 30px -10px rgba(255, 46, 46, 0.4); }
.text-gradient { background: linear-gradient(135deg, #FF2E2E 0%, #ff6b6b 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hover-lift { transition: transform 0.3s ease; }
.hover-lift:hover { transform: translateY(-4px); }

.dropdown { background: #111115; }
.dropdown-item { display: block; width: 100%; text-align: left; padding: 0.65rem 1rem; color: #fafafa; background: transparent; border: none; font-size: 0.95rem; }
.dropdown-item:hover { background: rgba(255,46,46,0.08); color: #FF2E2E; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #09090b; }
::-webkit-scrollbar-thumb { background: #27272a; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #3f3f46; }
::selection { background-color: rgba(255, 46, 46, 0.3); color: #fff; }

@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.animate-fade-in-up { animation: fadeInUp 0.5s ease-out forwards; }

[data-debug-wrapper="true"] { display: contents !important; }
