
/* HoldOff Design System — Romantic Dark */
:root {
  --bg-deep: #0d0a1a;
  --bg-card: #1a1432;
  --bg-card-hover: #231b42;
  --bg-input: #15112a;
  --primary: #7c5cbf;
  --primary-glow: rgba(124, 92, 191, 0.3);
  --accent: #5b8def;
  --accent-glow: rgba(91, 141, 239, 0.2);
  --rose: #e879a8;
  --rose-glow: rgba(232, 121, 168, 0.2);
  --text: #e8e4f0;
  --text-muted: #9b8fb8;
  --text-dim: #6b5f8a;
  --border: #2d2450;
  --border-light: #3a2d66;
  --success: #6dcea8;
  --warning: #e8a95b;
  --danger: #e87979;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-full: 50px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 20px var(--primary-glow);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition: all 0.25s ease;
}

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

body {
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Background gradient overlay */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: 
    radial-gradient(ellipse at 20% 20%, rgba(124, 92, 191, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(91, 141, 239, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(232, 121, 168, 0.04) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ─── TYPOGRAPHY ─────────────────────────────────── */
h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 1.35rem; font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 1.1rem; font-weight: 600; }
p { line-height: 1.6; }
a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary); }

/* ─── LAYOUT ─────────────────────────────────────── */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: 90px;
}

.screen-header {
  padding: 20px 20px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.screen-header h1 {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.screen-content {
  padding: 0 20px 20px;
}

/* ─── CARDS ──────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--rose));
  opacity: 0;
  transition: var(--transition);
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.card:hover::before { opacity: 1; }

.card-glow {
  box-shadow: var(--shadow-glow);
  border-color: var(--primary);
}

/* ─── BUTTONS ────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-full);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #6948b0);
  color: white;
  box-shadow: 0 4px 16px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px var(--primary-glow);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), #4a7ae0);
  color: white;
  box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-rose {
  background: linear-gradient(135deg, var(--rose), #d35d90);
  color: white;
  box-shadow: 0 4px 16px var(--rose-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--border-light);
}

.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-lg { padding: 14px 32px; font-size: 1.05rem; }
.btn-block { width: 100%; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

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

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

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  transition: var(--transition);
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

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

/* ─── BOTTOM NAV ─────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: rgba(13, 10, 26, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  text-decoration: none;
  color: var(--text-dim);
  font-size: 0.7rem;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

.nav-item.active {
  color: var(--primary);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  top: -8px;
  width: 20px;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 4px 4px;
}

.nav-item:hover { color: var(--text); }

.nav-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── BADGES & PILLS ────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-primary { background: var(--primary-glow); color: var(--primary); }
.badge-accent { background: var(--accent-glow); color: var(--accent); }
.badge-rose { background: var(--rose-glow); color: var(--rose); }
.badge-success { background: rgba(109,206,168,0.15); color: var(--success); }
.badge-warning { background: rgba(232,169,91,0.15); color: var(--warning); }
.badge-danger { background: rgba(232,121,121,0.15); color: var(--danger); }

/* ─── STATS ──────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ─── CONTACT LIST ───────────────────────────────── */
.contact-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  cursor: pointer;
  transition: var(--transition);
}

.contact-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
}

.contact-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--rose));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: white;
  flex-shrink: 0;
}

.contact-info { flex: 1; min-width: 0; }
.contact-name { font-weight: 600; font-size: 1rem; }
.contact-preview { font-size: 0.85rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.contact-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.contact-time { font-size: 0.75rem; color: var(--text-dim); }

/* ─── MOOD SELECTOR ──────────────────────────────── */
.mood-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0;
  -webkit-overflow-scrolling: touch;
}

.mood-pill {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.mood-pill.active, .mood-pill:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ─── TOGGLE ─────────────────────────────────────── */
.toggle-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}

.toggle {
  position: relative;
  width: 48px;
  height: 26px;
  background: var(--border);
  border-radius: 13px;
  cursor: pointer;
  transition: var(--transition);
}

.toggle.active { background: var(--primary); }

.toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
}

.toggle.active::after { transform: translateX(22px); }

/* ─── TABS ───────────────────────────────────────── */
.tab-bar {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 20px;
}

.tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.tab.active {
  background: var(--primary);
  color: white;
}

/* ─── EMPTY STATE ────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.6;
}

.empty-text {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ─── AFFIRMATION BANNER ─────────────────────────── */
.affirmation-card {
  background: linear-gradient(135deg, rgba(124,92,191,0.15), rgba(91,141,239,0.1));
  border: 1px solid rgba(124,92,191,0.3);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  text-align: center;
}

.affirmation-card .affirmation-text {
  font-style: italic;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.6;
}

.affirmation-card .affirmation-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ─── SPIRAL LOCK BUTTON ─────────────────────────── */
.spiral-lock-btn {
  position: fixed;
  bottom: 90px;
  right: calc(50% - 220px);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rose), var(--primary));
  border: none;
  color: white;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(232,121,168,0.4);
  transition: var(--transition);
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spiral-lock-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(232,121,168,0.5);
}

/* ─── PROGRESS BAR ───────────────────────────────── */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.5s ease;
}

/* ─── HEALTH SCORE ───────────────────────────────── */
.health-ring {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 700;
  position: relative;
}

/* ─── CHART PLACEHOLDER ──────────────────────────── */
.chart-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  min-height: 200px;
}

/* ─── GOOGLE SIGN IN ─────────────────────────────── */
.btn-google {
  background: white;
  color: #333;
  border: 1px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
}

.btn-google:hover { background: #f5f5f5; }

.btn-google img { width: 20px; height: 20px; }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ─── ANIMATIONS ─────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 10px var(--primary-glow); }
  50% { box-shadow: 0 0 25px var(--primary-glow); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.fade-in { animation: fadeIn 0.4s ease forwards; }
.pulse { animation: pulse-glow 2s ease-in-out infinite; }

/* ─── RESPONSIVE ─────────────────────────────────── */
@media (min-width: 481px) {
  .bottom-nav {
    border-radius: 20px 20px 0 0;
  }
}

/* ─── SCROLLBAR ──────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ─── ACCESSIBILITY ──────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Focus visible for accessibility */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
