/* ================================================
   STARTIPS — Frontend Styles
   Dark cinematic theater aesthetic
   Mobile-first | Gold accent palette
   ================================================ */

/* --- RESET & VARIABLES --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:            #0f0f0f;
  --bg-surface:    #171717;
  --bg-card:       #1e1e1e;
  --bg-card-hover: #262626;
  --gold:          #c9a84c;
  --gold-dim:      #8a7235;
  --gold-glow:     rgba(201,168,76,0.2);
  --text:          #ede9df;
  --text-sec:      #9a9590;
  --text-muted:    #55534f;
  --red:           #c0504d;
  --green:         #5a9a6f;
  --radius:        14px;
  --radius-sm:     10px;
  --font-d:        'Cormorant Garamond', Georgia, serif;
  --font-b:        'Inter', system-ui, sans-serif;
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

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

/* --- TYPOGRAPHY --- */
h1, h2, h3 { font-family: var(--font-d); font-weight: 300; line-height: 1.2; }
h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.1rem; font-weight: 400; }
p  { color: var(--text-sec); font-size: 0.88rem; font-weight: 300; }

/* --- PAGE SHELL & ANIMATION --- */
#app { min-height: 100vh; }

.page { min-height: 100vh; display: flex; flex-direction: column; animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

/* --- LOADING --- */
.loader {
  flex: 1; display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 20px;
}
.loader-ring {
  width: 36px; height: 36px;
  border: 2px solid var(--bg-card); border-top-color: var(--gold);
  border-radius: 50%; animation: spin .65s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- BUTTONS --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 24px; border: none; border-radius: var(--radius-sm);
  font-family: var(--font-b); font-size: 0.82rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer;
  transition: all .2s ease; white-space: nowrap; outline: none;
}
.btn-gold { background: var(--gold); color: #0f0f0f; }
.btn-gold:hover { background: #dbb85a; box-shadow: 0 0 24px var(--gold-glow); }
.btn-gold:active { transform: scale(.96); }
.btn-gold:disabled { background: var(--gold-dim); cursor: not-allowed; box-shadow: none; opacity: .6; }
.btn-outline { background: transparent; border: 1px solid #333; color: var(--text-sec); }
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }
.btn-ghost { background: transparent; color: var(--text-sec); padding: 8px 0; font-size: .8rem; text-transform: none; letter-spacing: 0; font-weight: 400; }
.btn-ghost:hover { color: var(--gold); }
.btn-full { width: 100%; }

/* --- INPUTS --- */
.input-group { display: flex; flex-direction: column; gap: 6px; }
.input-group label { font-size: .72rem; font-weight: 500; color: var(--text-muted); letter-spacing: .1em; text-transform: uppercase; }
.input {
  background: var(--bg-card); border: 1px solid #2e2e2e; border-radius: var(--radius-sm);
  padding: 13px 16px; color: var(--text); font-family: var(--font-b); font-size: .9rem;
  transition: border-color .2s, box-shadow .2s; outline: none; width: 100%;
}
.input::placeholder { color: var(--text-muted); }
.input:focus { border-color: var(--gold-dim); box-shadow: 0 0 0 3px var(--gold-glow); }
textarea.input { resize: vertical; min-height: 72px; }

/* --- CARDS --- */
.card {
  background: var(--bg-card); border: 1px solid #2a2a2a; border-radius: var(--radius);
  transition: border-color .2s, background .2s;
}
.card:hover { border-color: #383838; background: var(--bg-card-hover); }

/* --- BADGE --- */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: .7rem; font-weight: 500; letter-spacing: .04em; text-transform: uppercase;
}
.badge-gold  { background: rgba(201,168,76,.12); color: var(--gold); }
.badge-green { background: rgba(90,154,111,.12); color: var(--green); }
.badge-muted { background: rgba(255,255,255,.05); color: var(--text-muted); }

/* --- TOAST --- */
.toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(140%);
  background: var(--bg-card); border: 1px solid #333; border-radius: var(--radius-sm);
  padding: 13px 22px; color: var(--text); font-size: .84rem;
  z-index: 200; transition: transform .35s cubic-bezier(.34,1.56,.64,1), opacity .3s ease;
  box-shadow: 0 8px 32px rgba(0,0,0,.45); white-space: nowrap; pointer-events: none;
  opacity: 0; visibility: hidden;
}
.toast.show { 
  transform: translateX(-50%) translateY(0); 
  opacity: 1; 
  visibility: visible; 
}
.toast.err  { border-color: var(--red); }
.toast.ok   { border-color: var(--green); }

/* ================================================
   LOGO / BRAND MARK
   ================================================ */
.logo-mark {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-bottom: 8px;
}
.logo-mark svg { width: 32px; height: 32px; }
.logo-mark span { font-family: var(--font-d); font-size: 1.6rem; font-weight: 300; letter-spacing: .08em; color: var(--gold); }

/* ================================================
   PAGE: TIP FLOW (Audience)
   ================================================ */
.tip-page { align-items: center; padding: 52px 20px 60px; }
.tip-inner { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 24px; }

/* Play info banner */
.play-banner {
  text-align: center; padding: 20px 16px 18px;
  background: var(--bg-surface); border: 1px solid #262626; border-radius: var(--radius);
}
.play-banner h2 { margin-bottom: 6px; font-size: 1.4rem; }
.play-banner p { font-size: .82rem; }
.play-banner .meta { display: flex; justify-content: center; gap: 16px; margin-top: 10px; flex-wrap: wrap; }
.play-banner .meta span { font-size: .75rem; color: var(--text-muted); display: flex; align-items: center; gap: 5px; }
.play-banner .meta svg { width: 13px; height: 13px; opacity: .5; }

/* Cast grid */
.cast-label { font-size: .72rem; font-weight: 500; color: var(--text-muted); letter-spacing: .1em; text-transform: uppercase; }
.cast-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.actor-card {
  position: relative; padding: 18px 14px 16px; text-align: center; cursor: pointer;
  border: 2px solid transparent; border-radius: var(--radius);
  background: var(--bg-card); transition: all .2s ease;
}
.actor-card:hover { border-color: #383838; background: var(--bg-card-hover); }
.actor-card.selected { border-color: var(--gold); background: rgba(201,168,76,.06); box-shadow: 0 0 16px var(--gold-glow); }

.actor-card .avatar {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 10px;
  background: var(--bg-surface); border: 2px solid #2e2e2e;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  font-size: 1.4rem; color: var(--gold); font-family: var(--font-d);
}
.actor-card .avatar img { width: 100%; height: 100%; object-fit: cover; }
.actor-card .actor-name { font-size: .82rem; font-weight: 500; color: var(--text); margin-bottom: 2px; }
.actor-card .actor-role { font-size: .72rem; color: var(--text-muted); }

.actor-card .check-mark {
  position: absolute; top: 8px; right: 8px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--gold); display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: scale(.6); transition: all .2s ease;
}
.actor-card.selected .check-mark { opacity: 1; transform: scale(1); }
.actor-card .check-mark svg { width: 11px; height: 11px; }

/* Amount selection */
.amount-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.amount-btn {
  padding: 12px 4px; border: 1px solid #2e2e2e; border-radius: var(--radius-sm);
  background: var(--bg-card); color: var(--text-sec); font-family: var(--font-b);
  font-size: .82rem; font-weight: 500; cursor: pointer; transition: all .2s;
  text-align: center;
}
.amount-btn:hover { border-color: #555; color: var(--text); }
.amount-btn.active { border-color: var(--gold); background: rgba(201,168,76,.08); color: var(--gold); }

.amount-custom-row { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.amount-custom-row .currency { color: var(--text-muted); font-size: .9rem; font-weight: 500; }
.amount-custom-row .input { flex: 1; }

/* Optional fields */
.optional-fields { display: flex; flex-direction: column; gap: 14px; }

/* Thank you screen */
.thankyou-screen { text-align: center; padding: 60px 24px; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; }
.thankyou-icon { width: 80px; height: 80px; border-radius: 50%; background: rgba(90,154,111,.1); display: flex; align-items: center; justify-content: center; }
.thankyou-icon svg { width: 40px; height: 40px; }

/* ================================================
   PAGE: LOGIN
   ================================================ */
.login-page { align-items: center; justify-content: center; padding: 60px 20px; }
.login-inner { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 28px; }
.login-header { text-align: center; }
.login-header h1 { margin-bottom: 6px; }
.login-form { display: flex; flex-direction: column; gap: 18px; }
.login-footer { text-align: center; margin-top: -10px; }

/* ================================================
   PAGE: DASHBOARD
   ================================================ */
.dash-page { padding: 0; }

/* Top nav bar */
.dash-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid #222;
  position: sticky; top: 0; background: var(--bg); z-index: 10;
}
.dash-nav .nav-brand { display: flex; align-items: center; gap: 8px; }
.dash-nav .nav-brand svg { width: 22px; height: 22px; }
.dash-nav .nav-brand span { font-family: var(--font-d); font-size: 1.2rem; font-weight: 300; color: var(--gold); letter-spacing: .06em; }
.dash-nav .nav-actor { display: flex; align-items: center; gap: 10px; }
.dash-nav .nav-actor .nav-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--bg-card);
  border: 1px solid #333; display: flex; align-items: center; justify-content: center;
  font-size: .9rem; color: var(--gold); font-family: var(--font-d); overflow: hidden;
}
.dash-nav .nav-actor .nav-avatar img { width: 100%; height: 100%; object-fit: cover; }
.dash-nav .nav-actor .nav-name { font-size: .8rem; color: var(--text-sec); }
.dash-nav .btn-ghost { padding: 6px 0; }

/* Dashboard body */
.dash-body { flex: 1; padding: 24px 20px 40px; max-width: 520px; margin: 0 auto; width: 100%; display: flex; flex-direction: column; gap: 24px; }

/* Stats cards row */
.stats-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-card { padding: 18px 16px; border-radius: var(--radius); background: var(--bg-card); border: 1px solid #2a2a2a; }
.stat-card .stat-label { font-size: .68rem; font-weight: 500; color: var(--text-muted); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 6px; }
.stat-card .stat-value { font-family: var(--font-d); font-size: 1.6rem; font-weight: 300; color: var(--text); }
.stat-card .stat-value .stat-currency { font-size: .85rem; color: var(--text-muted); margin-right: 2px; }
.stat-card.stat-highlight { border-color: rgba(201,168,76,.25); background: rgba(201,168,76,.04); }
.stat-card.stat-highlight .stat-value { color: var(--gold); }

/* Section title */
.section-title { display: flex; align-items: center; justify-content: space-between; }
.section-title h3 { font-size: .72rem; font-weight: 500; color: var(--text-muted); letter-spacing: .1em; text-transform: uppercase; }

/* Tips list */
.tips-list { display: flex; flex-direction: column; gap: 8px; }
.tip-item {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--bg-card); border: 1px solid #2a2a2a; transition: background .2s;
}
.tip-item:hover { background: var(--bg-card-hover); }
.tip-item .tip-left { flex: 1; min-width: 0; }
.tip-item .tip-play { font-size: .82rem; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tip-item .tip-meta { font-size: .72rem; color: var(--text-muted); margin-top: 3px; }
.tip-item .tip-message { font-size: .78rem; color: var(--text-sec); font-style: italic; margin-top: 5px; }
.tip-item .tip-right { text-align: right; flex-shrink: 0; }
.tip-item .tip-amount { font-family: var(--font-d); font-size: 1.15rem; font-weight: 400; color: var(--text); }
.tip-item .tip-status { margin-top: 3px; }

/* Plays list */
.plays-list { display: flex; flex-direction: column; gap: 8px; }
.play-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--bg-card); border: 1px solid #2a2a2a;
}
.play-item .play-title { font-size: .84rem; font-weight: 500; color: var(--text); }
.play-item .play-meta { font-size: .72rem; color: var(--text-muted); margin-top: 2px; }

/* Empty state */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); font-size: .84rem; }

/* ================================================
   RESPONSIVE TWEAKS
   ================================================ */
@media (max-width: 360px) {
  .cast-grid { grid-template-columns: 1fr 1fr; }
  .amount-presets { grid-template-columns: repeat(2, 1fr); }
  .stats-row { grid-template-columns: 1fr 1fr; }
}
