/* App-specific styles. Extends theme.css tokens. */

/* ── NAV ───────────────────────────────────────── */
.app-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.app-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-brand { text-decoration: none; font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1.2rem; }
.nav-links { display: flex; gap: 4px; flex: 1; }
.nav-link { padding: 6px 14px; border-radius: 8px; text-decoration: none; color: var(--fg-secondary); font-size: 0.9rem; transition: color 0.2s, background 0.2s; }
.nav-link:hover, .nav-link.active { color: var(--fg-primary); background: rgba(255,255,255,0.05); }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-user { color: var(--fg-muted); font-size: 0.875rem; }

/* ── BUTTONS ───────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 20px; border-radius: var(--radius); font-family: 'Space Grotesk', sans-serif; font-size: 0.9rem; font-weight: 600; cursor: pointer; border: none; text-decoration: none; transition: opacity 0.2s, transform 0.15s; }
.btn:hover { opacity: 0.85; transform: translateY(-1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-outline { background: transparent; border: 1px solid rgba(255,255,255,0.15); color: var(--fg-primary); }
.btn-ghost { background: transparent; color: var(--fg-secondary); }
.btn-ghost:hover { color: var(--fg-primary); }
.btn-success { background: rgba(0, 184, 148, 0.15); color: var(--ads-accent); border: 1px solid rgba(0, 184, 148, 0.25); }
.btn-sm { padding: 6px 14px; font-size: 0.82rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }
.btn-full { width: 100%; justify-content: center; }
.btn-icon { font-size: 1rem; }
.mt-8 { margin-top: 8px; }

/* ── MAIN ──────────────────────────────────────── */
.app-main { min-height: calc(100vh - 60px); padding: 32px 24px; }

/* ── AUTH ──────────────────────────────────────── */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.auth-container { width: 100%; max-width: 420px; padding: 24px; }
.auth-brand { display: block; text-align: center; font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1.5rem; text-decoration: none; margin-bottom: 32px; }
.auth-card { background: var(--bg-card); border: 1px solid rgba(255,255,255,0.06); border-radius: var(--radius-lg); padding: 40px 36px; }
.auth-card h2 { font-size: 1.6rem; margin-bottom: 8px; }
.auth-sub { color: var(--fg-secondary); font-size: 0.9rem; margin-bottom: 28px; }
.auth-switch { text-align: center; color: var(--fg-muted); font-size: 0.875rem; margin-top: 20px; }
.auth-switch a { color: var(--accent-light); text-decoration: none; }

/* ── FORMS ─────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 0.875rem; font-weight: 500; color: var(--fg-secondary); margin-bottom: 6px; }
.required { color: var(--gradient-end); }
.form-input { width: 100%; background: var(--bg-secondary); border: 1px solid rgba(255,255,255,0.08); border-radius: var(--radius); padding: 10px 14px; color: var(--fg-primary); font-family: 'DM Sans', sans-serif; font-size: 0.95rem; outline: none; transition: border-color 0.2s; }
.form-input:focus { border-color: var(--accent); }
.form-textarea { min-height: 90px; resize: vertical; }
.form-select { appearance: none; cursor: pointer; }
.form-hint { font-size: 0.8rem; color: var(--fg-muted); margin-top: 6px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 0.875rem; margin-bottom: 20px; }
.alert-error { background: rgba(253, 121, 168, 0.1); border: 1px solid rgba(253, 121, 168, 0.2); color: var(--content-accent); }

/* ── PROFILE FORM PAGE ─────────────────────────── */
.form-page { max-width: 720px; margin: 0 auto; }
.form-page-header { margin-bottom: 40px; }
.form-page-header h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin-bottom: 12px; }
.form-page-sub { color: var(--fg-secondary); font-size: 1rem; }
.form-section { background: var(--bg-card); border: 1px solid rgba(255,255,255,0.05); border-radius: var(--radius-lg); padding: 28px; margin-bottom: 20px; }
.form-section-title { font-size: 1rem; font-weight: 600; color: var(--fg-primary); margin-bottom: 20px; }
.form-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; }

.tone-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.tone-option { padding: 8px 16px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.08); background: var(--bg-secondary); color: var(--fg-secondary); font-size: 0.875rem; cursor: pointer; transition: all 0.15s; }
.tone-option input { display: none; }
.tone-option.selected, .tone-option:has(input:checked) { border-color: var(--accent); color: var(--accent-light); background: rgba(108, 92, 231, 0.1); }

.days-grid { display: flex; gap: 8px; }
.day-option { padding: 8px 14px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.08); background: var(--bg-secondary); color: var(--fg-secondary); font-size: 0.875rem; cursor: pointer; transition: all 0.15s; }
.day-option input { display: none; }
.day-option.selected, .day-option:has(input:checked) { border-color: var(--social-accent); color: var(--social-accent); background: rgba(0, 206, 201, 0.08); }

/* ── DASHBOARD ─────────────────────────────────── */
.dashboard-layout { max-width: 1100px; margin: 0 auto; }
.dashboard-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 28px; }
.dashboard-header h1 { font-size: clamp(1.6rem, 4vw, 2rem); margin-bottom: 8px; }
.dashboard-meta { display: flex; align-items: center; gap: 10px; color: var(--fg-muted); font-size: 0.875rem; }
.header-actions { display: flex; gap: 10px; }

.badge { padding: 3px 10px; border-radius: 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.5px; }
.badge-social { background: rgba(0, 206, 201, 0.1); color: var(--social-accent); border: 1px solid rgba(0,206,201,0.2); }
.badge-active { background: rgba(0, 184, 148, 0.1); color: var(--ads-accent); border: 1px solid rgba(0,184,148,0.2); }
.dash-detail { color: var(--fg-muted); }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.stat-card { background: var(--bg-card); border: 1px solid rgba(255,255,255,0.05); border-radius: var(--radius); padding: 24px 20px; }
.stat-card-value { font-family: 'Space Grotesk', sans-serif; font-size: 2rem; font-weight: 700; color: var(--fg-primary); }
.stat-card-label { font-size: 0.82rem; color: var(--fg-muted); margin-top: 4px; }

/* Two-column grid */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.dash-panel { background: var(--bg-card); border: 1px solid rgba(255,255,255,0.05); border-radius: var(--radius-lg); padding: 24px; }
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.panel-header h3 { font-size: 1rem; font-weight: 600; }
.panel-link { color: var(--accent-light); font-size: 0.85rem; text-decoration: none; }
.panel-link:hover { text-decoration: underline; }
.panel-empty { color: var(--fg-muted); font-size: 0.9rem; text-align: center; padding: 24px 0; }
.panel-empty p { margin-bottom: 12px; }

/* Profile switcher */
.profile-switcher { display: flex; gap: 4px; margin-bottom: 24px; flex-wrap: wrap; }
.profile-tab { padding: 8px 16px; border-radius: var(--radius); border: 1px solid rgba(255,255,255,0.06); background: var(--bg-card); color: var(--fg-secondary); font-size: 0.875rem; text-decoration: none; transition: all 0.15s; }
.profile-tab:hover { color: var(--fg-primary); border-color: rgba(255,255,255,0.12); }
.profile-tab.active { border-color: var(--accent); color: var(--accent-light); background: rgba(108, 92, 231, 0.1); }
.add-tab { border-style: dashed; }

.add-profile-cta { text-align: center; margin-top: 32px; }

/* Empty state */
.empty-state { text-align: center; padding: 80px 24px; max-width: 500px; margin: 0 auto; }
.empty-icon { font-size: 3.5rem; margin-bottom: 24px; }
.empty-state h2 { font-size: 1.6rem; margin-bottom: 16px; }
.empty-state p { color: var(--fg-secondary); margin-bottom: 28px; line-height: 1.6; }

/* ── POSTS ─────────────────────────────────────── */
.posts-layout { max-width: 820px; margin: 0 auto; }
.posts-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 32px; }
.posts-header h1 { font-size: 1.8rem; margin-bottom: 6px; }
.posts-section { margin-bottom: 40px; }
.section-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.count-badge { background: rgba(255,255,255,0.07); border-radius: 20px; padding: 2px 10px; font-size: 0.8rem; color: var(--fg-muted); font-weight: 400; }

/* Post cards */
.post-list { display: flex; flex-direction: column; gap: 12px; }
.full-list .post-card { padding: 20px; }
.post-card { background: var(--bg-card); border: 1px solid rgba(255,255,255,0.05); border-radius: var(--radius); padding: 16px; transition: border-color 0.2s; }
.post-card:hover { border-color: rgba(255,255,255,0.1); }
.post-queued { border-left: 3px solid var(--accent); }
.post-published { border-left: 3px solid var(--ads-accent); }
.post-body { margin-bottom: 12px; }
.post-content { color: var(--fg-primary); font-size: 0.95rem; line-height: 1.6; white-space: pre-wrap; }
.post-edit-input { width: 100%; background: var(--bg-secondary); border: 1px solid var(--accent); border-radius: 8px; padding: 10px; color: var(--fg-primary); font-family: 'DM Sans', sans-serif; font-size: 0.95rem; min-height: 100px; resize: vertical; }
.post-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.post-meta { display: flex; align-items: center; gap: 10px; font-size: 0.8rem; color: var(--fg-muted); }
.status-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.status-dot.queued { background: var(--accent-light); }
.status-dot.published { background: var(--ads-accent); }
.engagement { color: var(--fg-secondary); }
.post-feedback { margin-top: 10px; font-size: 0.875rem; padding: 8px 12px; border-radius: 8px; }
.post-feedback.success { background: rgba(0, 184, 148, 0.1); color: var(--ads-accent); }
.post-feedback.muted { background: rgba(255,255,255,0.04); color: var(--fg-muted); }

/* ── MODAL ─────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 200; padding: 24px; }
.modal { background: var(--bg-card); border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius-lg); padding: 36px; max-width: 440px; width: 100%; }
.modal h3 { font-size: 1.3rem; margin-bottom: 10px; }
.modal p { color: var(--fg-secondary); font-size: 0.95rem; margin-bottom: 24px; }
.count-selector { display: flex; gap: 10px; margin-bottom: 28px; }
.count-btn { flex: 1; padding: 10px; border-radius: var(--radius); border: 1px solid rgba(255,255,255,0.08); background: var(--bg-secondary); color: var(--fg-secondary); font-family: 'Space Grotesk', sans-serif; font-size: 0.9rem; cursor: pointer; transition: all 0.15s; }
.count-btn.active { border-color: var(--accent); color: var(--accent-light); background: rgba(108, 92, 231, 0.1); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
.modal-status { margin-top: 14px; font-size: 0.875rem; min-height: 20px; }
.modal-status.info { color: var(--fg-muted); }
.modal-status.success { color: var(--ads-accent); }
.modal-status.error { color: var(--content-accent); }

/* ── RESPONSIVE ────────────────────────────────── */
@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .dashboard-header { flex-direction: column; gap: 16px; }
  .posts-header { flex-direction: column; gap: 16px; }
  .form-row { grid-template-columns: 1fr; }
  .days-grid { flex-wrap: wrap; }
  .header-actions { width: 100%; }
}
