/* ============================================
   Personagram.ai — Global Styles
   ============================================ */

:root {
  --navy: #0a0e1a;
  --navy-light: #131829;
  --navy-mid: #1a2035;
  --cream: #f5f0e8;
  --cream-dim: #c8c3bb;
  --coral: #ff4d6d;
  --coral-dark: #e6435f;
  --gold: #ffd166;
  --gold-dim: #c9a94e;
  --gradient-coral: linear-gradient(135deg, #ff4d6d 0%, #ffd166 100%);
  --gradient-bg: linear-gradient(135deg, #0a0e1a 0%, #1a1030 50%, #0a0e1a 100%);
  --glass: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-hover: rgba(255, 255, 255, 0.1);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.4);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--navy);
  color: var(--cream);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Noise texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 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;
}

#app {
  position: relative;
  z-index: 1;
}

/* ============================================
   Typography
   ============================================ */

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
}

h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); }
h2 { font-size: clamp(1.8rem, 4vw, 3rem); }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.8rem); }

p { font-size: 1rem; line-height: 1.7; }

a {
  color: var(--coral);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--gold); }

/* ============================================
   Buttons
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  border: none;
  border-radius: var(--radius-lg);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--gradient-coral);
  color: #fff;
  box-shadow: 0 4px 20px rgba(255, 77, 109, 0.3);
}
.btn-primary:hover {
  box-shadow: 0 6px 30px rgba(255, 77, 109, 0.5);
  transform: translateY(-1px);
  color: #fff;
}

.btn-secondary {
  background: transparent;
  color: var(--cream);
  border: 2px solid var(--glass-border);
  backdrop-filter: blur(8px);
}
.btn-secondary:hover {
  background: var(--glass-hover);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--cream);
}

.btn-ghost {
  background: transparent;
  color: var(--cream-dim);
  padding: 10px 20px;
}
.btn-ghost:hover { color: var(--cream); }

.btn-danger {
  background: #dc2626;
  color: #fff;
}
.btn-danger:hover { background: #b91c1c; }

.btn-sm { padding: 8px 18px; font-size: 0.875rem; border-radius: var(--radius-md); }
.btn-lg { padding: 18px 40px; font-size: 1.1rem; }
.btn-full { width: 100%; }

.btn:disabled, .btn.loading {
  opacity: 0.6;
  pointer-events: none;
}

.btn.loading::after {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: 8px;
}

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

/* ============================================
   Cards & Glass
   ============================================ */

.card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(12px);
  transition: all var(--transition);
}

.card:hover {
  background: var(--glass-hover);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-md);
}

.card-interactive {
  cursor: pointer;
}
.card-interactive:hover {
  transform: translateY(-2px);
}

/* ============================================
   Forms
   ============================================ */

.input, .textarea, select {
  width: 100%;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: all var(--transition);
  outline: none;
}

.input:focus, .textarea:focus, select:focus {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(255, 77, 109, 0.15);
}

.textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

.input::placeholder, .textarea::placeholder {
  color: rgba(245, 240, 232, 0.3);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23f5f0e8' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--cream-dim);
  margin-bottom: 6px;
}

.field { margin-bottom: 20px; }

/* ============================================
   Layout
   ============================================ */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-sm { max-width: 640px; margin: 0 auto; padding: 0 24px; }
.container-md { max-width: 800px; margin: 0 auto; padding: 0 24px; }

/* ============================================
   Navigation
   ============================================ */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(20px);
  background: rgba(10, 14, 26, 0.8);
  border-bottom: 1px solid var(--glass-border);
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--cream);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-logo-icon {
  width: 32px;
  height: 32px;
  background: var(--gradient-coral);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--glass-border);
  transition: border-color var(--transition);
}
.nav-avatar:hover { border-color: var(--coral); }

.nav-menu {
  position: absolute;
  top: 60px;
  right: 24px;
  background: var(--navy-light);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 8px;
  min-width: 200px;
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 200;
}

.nav-menu.open { display: block; }

.nav-menu-item {
  display: block;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  text-decoration: none;
}

.nav-menu-item:hover {
  background: var(--glass-hover);
  color: var(--cream);
}

/* ============================================
   Badge / Status
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-draft { background: rgba(255,255,255,0.1); color: var(--cream-dim); }
.badge-generating { background: rgba(59,130,246,0.2); color: #60a5fa; animation: pulse-badge 2s infinite; }
.badge-ready { background: rgba(34,197,94,0.2); color: #4ade80; }
.badge-published { background: rgba(255,77,109,0.2); color: var(--coral); }

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ============================================
   Toast
   ============================================ */

#toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  backdrop-filter: blur(12px);
  animation: toast-in 0.3s ease forwards;
  max-width: 360px;
  box-shadow: var(--shadow-md);
}

.toast-success { background: rgba(34,197,94,0.9); color: #fff; }
.toast-error { background: rgba(220,38,38,0.9); color: #fff; }
.toast-info { background: rgba(59,130,246,0.9); color: #fff; }

.toast.removing { animation: toast-out 0.3s ease forwards; }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(40px); }
}

/* ============================================
   Modal
   ============================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fade-in 0.2s ease;
}

.modal {
  background: var(--navy-light);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 500px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.3s ease;
}

.modal h3 { margin-bottom: 12px; }
.modal p { color: var(--cream-dim); margin-bottom: 24px; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; }

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ============================================
   Progress Bar
   ============================================ */

.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 99px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--gradient-coral);
  border-radius: 99px;
  transition: width 0.5s ease;
}

.progress-bar-fill.complete {
  background: #4ade80;
}

/* ============================================
   Step Indicator
   ============================================ */

.steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 40px;
}

.step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--cream-dim);
  opacity: 0.5;
  transition: all var(--transition);
  cursor: default;
}

.step.active { opacity: 1; color: var(--cream); }
.step.completed { opacity: 0.8; color: #4ade80; cursor: pointer; }

.step-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.step.active .step-number {
  background: var(--gradient-coral);
  border-color: transparent;
  color: #fff;
}

.step.completed .step-number {
  background: rgba(34, 197, 94, 0.2);
  border-color: #4ade80;
  color: #4ade80;
}

.step-connector {
  width: 40px;
  height: 1px;
  background: var(--glass-border);
}

/* ============================================
   Pill / Chip buttons
   ============================================ */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 99px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--cream);
  cursor: pointer;
  transition: all var(--transition);
}

.pill:hover { background: var(--glass-hover); }

.pill.selected {
  border-color: var(--coral);
  background: rgba(255, 77, 109, 0.15);
}

.pill-play {
  width: 24px;
  height: 24px;
  background: var(--glass);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  border: none;
  color: var(--cream);
  cursor: pointer;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
  .nav { padding: 12px 16px; }
  .container, .container-sm, .container-md { padding: 0 16px; }
  .btn-lg { padding: 16px 28px; font-size: 1rem; }
  .steps { gap: 0; flex-wrap: wrap; }
  .step { padding: 8px 12px; font-size: 0.8rem; }
  .step-connector { width: 20px; }
  .step-label { display: none; }
  .modal { padding: 24px; margin: 16px; }
}

/* ============================================
   Utility
   ============================================ */

.text-center { text-align: center; }
.text-dim { color: var(--cream-dim); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mt-5 { margin-top: 48px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.gap-2 { gap: 16px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.hidden { display: none !important; }

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in { animation: fade-in 0.5s ease forwards; }
.animate-fade-in-up { animation: fade-in-up 0.6s ease forwards; }

/* Stagger children */
.stagger > *:nth-child(1) { animation-delay: 0ms; }
.stagger > *:nth-child(2) { animation-delay: 100ms; }
.stagger > *:nth-child(3) { animation-delay: 200ms; }
.stagger > *:nth-child(4) { animation-delay: 300ms; }
.stagger > *:nth-child(5) { animation-delay: 400ms; }
.stagger > *:nth-child(6) { animation-delay: 500ms; }
