/* 615Vibe App Styles - Matches landing page design language */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0a0a0f;
  --surface: #12121a;
  --surface-hover: #1a1a26;
  --border: #1e1e2e;
  --border-light: #2a2a3e;
  --text: #e8e6e3;
  --text-muted: #8a8697;
  --text-dim: #5a5670;
  --accent: #f97316;
  --accent-hover: #fb923c;
  --accent-glow: rgba(249, 115, 22, 0.15);
  --accent-subtle: rgba(249, 115, 22, 0.08);
  --purple: #a78bfa;
  --purple-glow: rgba(167, 139, 250, 0.15);
  --green: #34d399;
  --green-glow: rgba(52, 211, 153, 0.15);
  --red: #ef4444;
  --red-glow: rgba(239, 68, 68, 0.15);
  --blue: #60a5fa;
  --blue-glow: rgba(96, 165, 250, 0.15);
}

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

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', sans-serif;
}

/* Noise texture overlay */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  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)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* LAYOUT */
.app-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* NAV */
.app-nav {
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

.app-nav .logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--text);
  letter-spacing: -0.5px;
  text-decoration: none;
}

.app-nav .logo span { color: var(--accent); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-user {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--border-light);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 8px 12px;
}

.btn-ghost:hover {
  color: var(--text);
  background: var(--surface);
}

.btn-danger {
  background: transparent;
  color: var(--red);
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: var(--red-glow);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.82rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* FORMS */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  transition: border-color 0.2s;
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-dim);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.5;
}

.form-select {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238a8697' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* CARDS */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.3px;
}

/* STATS GRID */
.stats-grid {
  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: 12px;
  padding: 20px;
  transition: border-color 0.3s;
}

.stat-card:hover {
  border-color: rgba(249, 115, 22, 0.2);
}

.stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -1px;
}

.stat-accent { color: var(--accent); }
.stat-purple { color: var(--purple); }
.stat-green { color: var(--green); }
.stat-blue { color: var(--blue); }

/* SECTION LAYOUT */
.section-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

.section-full {
  margin-bottom: 32px;
}

/* PAGE HEADER */
.page-header {
  margin-bottom: 32px;
}

.page-header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.page-header p {
  color: var(--text-muted);
  font-size: 1rem;
}

/* BADGE */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-draft { background: var(--surface-hover); color: var(--text-muted); }
.badge-scheduled { background: var(--blue-glow); color: var(--blue); }
.badge-posted { background: var(--green-glow); color: var(--green); }

/* PLATFORM ICONS */
.platform-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.platform-instagram { background: rgba(225, 48, 108, 0.12); color: #e1306c; }
.platform-tiktok { background: rgba(255, 0, 80, 0.12); color: #ff0050; }
.platform-twitter { background: rgba(29, 161, 242, 0.12); color: #1da1f2; }
.platform-spotify { background: rgba(30, 215, 96, 0.12); color: #1ed760; }
.platform-youtube { background: rgba(255, 0, 0, 0.12); color: #ff0000; }

/* ACCOUNT ROW */
.account-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.account-row:last-child { border-bottom: none; }

.account-info {
  flex: 1;
}

.account-info .name {
  font-size: 0.9rem;
  font-weight: 500;
}

.account-info .platform-name {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: capitalize;
}

/* POST CARD */
.post-card {
  padding: 18px;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}

.post-card:last-child { border-bottom: none; }

.post-card:hover {
  background: var(--accent-subtle);
}

.post-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.post-content {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
}

.post-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* TOAST */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 24px;
  border-radius: 10px;
  font-size: 0.9rem;
  z-index: 9999;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  background: var(--green-glow);
  border: 1px solid rgba(52, 211, 153, 0.3);
  color: var(--green);
}

.toast-error {
  background: var(--red-glow);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--red);
}

/* MODAL */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  width: 90%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 24px;
  letter-spacing: -0.3px;
}

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state .icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.5;
}

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

/* AUTH PAGES */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
}

.auth-card .logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text);
  letter-spacing: -0.5px;
  text-align: center;
  margin-bottom: 8px;
}

.auth-card .logo span { color: var(--accent); }

.auth-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 32px;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--accent);
  text-decoration: none;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.form-error {
  background: var(--red-glow);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--red);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 16px;
  display: none;
}

/* LOADING SPINNER */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* TABS */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.tab {
  padding: 10px 18px;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: 'DM Sans', sans-serif;
}

.tab:hover { color: var(--text); }
.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* GENERATE FORM */
.generate-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.generate-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.generate-row .form-group {
  flex: 1;
  margin-bottom: 0;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .section-grid {
    grid-template-columns: 1fr;
  }

  .generate-row {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-actions {
    gap: 8px;
  }

  .page-header h1 {
    font-size: 1.4rem;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .stat-card {
    padding: 14px;
  }

  .stat-value {
    font-size: 1.4rem;
  }

  .app-container {
    padding: 0 16px;
  }
}
