/* PostAgent Design System */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=DM+Sans:wght@400;500&display=swap');

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

:root {
  --bg: #06060b;
  --surface: #0d0d14;
  --surface-hover: #13131f;
  --border: #1a1a2e;
  --text: #e8e8ed;
  --text-dim: #8888a0;
  --accent: #00c8ff;
  --accent-glow: rgba(0, 200, 255, 0.15);
  --accent-hover: #00b0e0;
  --green: #00e88f;
  --green-glow: rgba(0, 232, 143, 0.15);
  --red: #ff4466;
  --red-glow: rgba(255, 68, 102, 0.15);
  --yellow: #ffb800;
  --yellow-glow: rgba(255, 184, 0, 0.15);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
}

body {
  font-family: 'DM Sans', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5 {
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: -0.5px;
}

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

/* Layout */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* Nav */
.app-nav {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  background: rgba(6, 6, 11, 0.9);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}
.app-nav .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--text);
  letter-spacing: -0.5px;
  text-decoration: none;
}
.logo span { color: var(--accent); }
.nav-right { display: flex; align-items: center; gap: 16px; }
.nav-link {
  font-size: 0.9rem;
  color: var(--text-dim);
  transition: color 0.2s;
}
.nav-link:hover { color: var(--text); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: var(--bg);
  box-shadow: 0 0 20px rgba(0, 200, 255, 0.2);
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 30px rgba(0, 200, 255, 0.3);
  transform: translateY(-1px);
  color: var(--bg);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: rgba(0, 200, 255, 0.3);
  color: var(--text);
}
.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  padding: 8px 16px;
}
.btn-ghost:hover { color: var(--text); background: var(--surface); }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; border-radius: var(--radius-sm); }
.btn-green { background: var(--green); color: var(--bg); }
.btn-green:hover { background: #00cc7d; color: var(--bg); }
.btn-red { background: transparent; color: var(--red); border: 1px solid var(--red); }
.btn-red:hover { background: var(--red-glow); color: var(--red); }

/* Form Elements */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-input::placeholder { color: var(--text-dim); opacity: 0.6; }
.form-textarea { resize: vertical; min-height: 80px; }
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238888a0' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}
.form-select option { background: var(--surface); color: var(--text); }
.form-hint { font-size: 0.8rem; color: var(--text-dim); margin-top: 6px; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: border-color 0.2s;
}
.card:hover { border-color: rgba(0, 200, 255, 0.2); }

/* Auth Card (centered) */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  position: relative;
}
.auth-wrapper::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(0, 200, 255, 0.04) 0%, transparent 70%);
  pointer-events: none;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  position: relative;
}
.auth-card .logo {
  font-size: 1.5rem;
  margin-bottom: 8px;
}
.auth-card h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.auth-card .subtitle {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin-bottom: 36px;
}
.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.9rem;
  color: var(--text-dim);
}

/* Alert */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 20px;
  display: none;
}
.alert-error {
  background: var(--red-glow);
  color: var(--red);
  border: 1px solid rgba(255, 68, 102, 0.2);
}
.alert-success {
  background: var(--green-glow);
  color: var(--green);
  border: 1px solid rgba(0, 232, 143, 0.2);
}
.alert.show { display: block; }

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.badge-draft { background: var(--accent-glow); color: var(--accent); }
.badge-approved { background: var(--green-glow); color: var(--green); }
.badge-scheduled { background: var(--yellow-glow); color: var(--yellow); }
.badge-rejected { background: var(--red-glow); color: var(--red); }
.badge-tip { background: rgba(0, 200, 255, 0.1); color: var(--accent); }
.badge-question { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
.badge-hot_take { background: rgba(255, 68, 102, 0.1); color: var(--red); }
.badge-story { background: rgba(0, 232, 143, 0.1); color: var(--green); }
.badge-stat { background: rgba(255, 184, 0, 0.1); color: var(--yellow); }
.badge-behind_the_scenes { background: rgba(136, 136, 160, 0.15); color: var(--text-dim); }

/* Stats Bar */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}
.stat-card .stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}
.stat-card .stat-name {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Loading overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 6, 11, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  gap: 20px;
}
.loading-overlay .spinner {
  width: 40px;
  height: 40px;
  border-width: 3px;
  border-top-color: var(--accent);
}
.loading-overlay p {
  color: var(--text-dim);
  font-size: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
  .stat-card .stat-value { font-size: 1.5rem; }
}
@media (max-width: 480px) {
  .stats-bar { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 14px; }
  .card { padding: 20px; }
  .btn { padding: 10px 20px; }
}
