/* CineMind — shared styles
 * Design tokens, base typography, components used across every page.
 */

:root {
  /* color */
  --primary: #5B3BFF;
  --primary-dark: #312767;
  --primary-gradient: linear-gradient(135deg, #5B3BFF 0%, #312767 100%);
  --accent: #EDE9FF;
  --accent-2: #F4F1FF;
  --warm: #FFD382;
  --text: #1A1A2E;
  --text-muted: #6B6B82;
  --text-soft: #9A9AAE;
  --border: #E7E7EF;
  --border-soft: #F0EFF5;
  --bg: #FFFFFF;
  --bg-soft: #FAF9FD;
  --bg-card: #FFFFFF;
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.05);
  --shadow-lift: 0 8px 24px rgba(91, 59, 255, 0.18);
  --shadow-deep: 0 12px 32px rgba(49, 39, 103, 0.28);

  /* type */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  /* spacing — 8pt scale */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;

  /* radius */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-pill: 999px;

  --transition: 250ms cubic-bezier(0.2, 0, 0.2, 1);
}

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

html, body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-soft);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  font-size: 16px;
}

/* Phone-shaped viewport on desktop; full-width on mobile */
.app {
  max-width: 420px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 80px rgba(49, 39, 103, 0.06);
}

@media (max-width: 420px) {
  .app {
    box-shadow: none;
  }
}

/* ---------- typography ---------- */

h1, h2, h3, h4 {
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.2;
  text-wrap: balance;
}

h1 { font-size: 32px; font-weight: 700; line-height: 1.25; }
h2 { font-size: 24px; font-weight: 600; line-height: 1.33; }
h3 { font-size: 18px; font-weight: 600; }
h4 { font-size: 15px; font-weight: 600; }

p { color: var(--text); line-height: 1.6; }
.muted { color: var(--text-muted); }
.soft { color: var(--text-soft); }
.caption { font-size: 14px; line-height: 1.43; color: var(--text-muted); }
.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  color: var(--primary);
}

/* ---------- top bar ---------- */

.appbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-4) var(--s-5);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.appbar-title {
  font-size: 17px;
  font-weight: 600;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--r-pill);
  border: none;
  background: transparent;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition);
}
.icon-btn:hover { background: var(--accent); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 14px 20px;
  border-radius: var(--r-lg);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), opacity var(--transition);
  text-decoration: none;
  width: 100%;
}

.btn-primary {
  background: var(--primary-gradient);
  color: white;
  box-shadow: var(--shadow-lift);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-deep);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: white;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-soft); }

.btn-ghost {
  background: var(--accent);
  color: var(--primary-dark);
}
.btn-ghost:hover { background: #E0D9FF; }

.btn-sm { padding: 10px 16px; font-size: 14px; }

/* ---------- card ---------- */

.card {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  border: 1px solid var(--border-soft);
  padding: var(--s-5);
  box-shadow: var(--shadow-card);
}

/* ---------- bottom tab bar ---------- */

.tabbar {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: var(--s-2) var(--s-2) max(var(--s-2), env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid var(--border-soft);
  margin-top: auto;
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: var(--s-2) var(--s-1);
  color: var(--text-soft);
  text-decoration: none;
  font-size: 11px;
  font-weight: 500;
  border-radius: var(--r-md);
  transition: color var(--transition);
}
.tab svg { stroke: currentColor; }
.tab.active { color: var(--primary); }
.tab:hover { color: var(--primary); }
.tab[aria-disabled="true"] { color: var(--text-soft); opacity: 0.45; pointer-events: none; }

/* ---------- form inputs ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}
.field input,
.field textarea {
  width: 100%;
  font-family: var(--font);
  font-size: 16px;
  color: var(--text);
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: var(--r-md);
  padding: 12px 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91, 59, 255, 0.12);
}
.field-help {
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.5;
}

/* ---------- logo mark ---------- */

.logo {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: var(--r-pill);
  background: var(--primary-gradient);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lift);
  flex-shrink: 0;
}
.logo-mark.lg { width: 48px; height: 48px; }
.logo-mark.xl { width: 64px; height: 64px; }

/* ---------- utility ---------- */

.stack { display: flex; flex-direction: column; }
.stack-2 > * + * { margin-top: var(--s-2); }
.stack-3 > * + * { margin-top: var(--s-3); }
.stack-4 > * + * { margin-top: var(--s-4); }
.stack-5 > * + * { margin-top: var(--s-5); }
.stack-6 > * + * { margin-top: var(--s-6); }
.stack-8 > * + * { margin-top: var(--s-8); }
.flex { display: flex; }
.flex-row { display: flex; flex-direction: row; align-items: center; gap: var(--s-3); }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-1 { flex: 1; }
.text-center { text-align: center; }
.full-width { width: 100%; }

.p-5 { padding: var(--s-5); }
.p-6 { padding: var(--s-6); }
.px-5 { padding-left: var(--s-5); padding-right: var(--s-5); }
.py-5 { padding-top: var(--s-5); padding-bottom: var(--s-5); }
.scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }

/* ---------- animation ---------- */

@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fade-up 400ms cubic-bezier(0.2, 0, 0.2, 1) both; }
.fade-up-2 { animation: fade-up 500ms cubic-bezier(0.2, 0, 0.2, 1) 100ms both; }
.fade-up-3 { animation: fade-up 600ms cubic-bezier(0.2, 0, 0.2, 1) 200ms both; }

/* placeholder imagery — soft striped lavender, used wherever a real cinematic photo will eventually live */
.placeholder-img {
  background:
    repeating-linear-gradient(
      135deg,
      rgba(91, 59, 255, 0.06) 0,
      rgba(91, 59, 255, 0.06) 6px,
      rgba(91, 59, 255, 0.12) 6px,
      rgba(91, 59, 255, 0.12) 12px
    ),
    linear-gradient(160deg, #EDE9FF 0%, #D9D0FF 100%);
  position: relative;
  overflow: hidden;
}
.placeholder-img::after {
  content: attr(data-label);
  position: absolute;
  bottom: 8px;
  left: 10px;
  font-family: "SF Mono", "Menlo", monospace;
  font-size: 10px;
  color: var(--primary-dark);
  opacity: 0.55;
  letter-spacing: 0.04em;
}

/* ---------- settings menu (gear dropdown) ---------- */

.settings-menu {
  position: fixed;
  top: 68px;
  right: var(--s-4);
  min-width: 220px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-deep);
  padding: var(--s-2);
  z-index: 100;
  display: none;
}
.settings-menu.open { display: block; }

.settings-menu .menu-user {
  padding: var(--s-2) var(--s-3);
  font-size: 13px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: var(--s-2);
  word-break: break-all;
}

.settings-menu .menu-item {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  width: 100%;
  padding: var(--s-2) var(--s-3);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  background: none;
  border: none;
  border-radius: var(--r-sm);
  cursor: pointer;
  text-align: left;
  transition: background var(--transition);
}
.settings-menu .menu-item:hover { background: var(--accent-2); }
.settings-menu .menu-item svg { color: var(--text-muted); flex: none; }