/* ============================================================
   VAJRATRAINER — styles.css
   Brand: VajraMoves Trainer
   Theme: Dark warrior, gold accents
   ============================================================ */

/* ── DESIGN TOKENS ───────────────────────────────────────── */
:root {
  --brand-dark:        #0a0a0f;
  --brand-surface:     #12121a;
  --brand-card:        #1a1a26;
  --brand-border:      rgba(255, 255, 255, 0.08);
  --brand-border-strong: rgba(255, 255, 255, 0.16);
  --brand-gold:        #c9a84c;
  --brand-gold-dim:    rgba(201, 168, 76, 0.15);
  --brand-gold-glow:   rgba(201, 168, 76, 0.08);
  --brand-text:        #e8e6e0;
  --brand-muted:       rgba(232, 230, 224, 0.50);
  --brand-dim:         rgba(232, 230, 224, 0.25);
  --brand-red:         #e05c5c;
  --brand-green:       #5cbe8a;
  --brand-blue:        #5c8fe0;

  --radius:    12px;
  --radius-sm:  8px;
  --radius-lg: 18px;
}

/* ── RESET ───────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

/* ── BASE ────────────────────────────────────────────────── */
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--brand-dark);
  color: var(--brand-text);
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  padding-bottom: 80px;
  overflow-x: hidden;
}

/* ── AUTH SCREEN ─────────────────────────────────────────── */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  position: relative;
  overflow: hidden;
}

.auth-bg-pattern {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(201, 168, 76, 0.06) 0%, transparent 70%),
    radial-gradient(ellipse 80% 60% at 50% 100%, rgba(201, 168, 76, 0.03) 0%, transparent 70%);
  pointer-events: none;
}

.auth-inner {
  width: 100%;
  max-width: 380px;
  position: relative;
  z-index: 1;
}

.auth-logo-wrap {
  text-align: center;
  margin-bottom: 36px;
}

.auth-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  margin-bottom: 12px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.auth-wordmark {
  font-family: 'Cinzel', serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--brand-gold);
  text-transform: uppercase;
}

.auth-tagline {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--brand-muted);
  text-transform: uppercase;
  margin-top: 4px;
}

.auth-panel {
  background: var(--brand-card);
  border: 0.5px solid var(--brand-border-strong);
  border-radius: var(--radius-lg);
  padding: 28px 24px 32px;
}

.auth-panel-title {
  font-family: 'Cinzel', serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--brand-text);
  margin-bottom: 24px;
  letter-spacing: 0.04em;
}

.auth-error {
  background: rgba(224, 92, 92, 0.10);
  border: 0.5px solid rgba(224, 92, 92, 0.25);
  border-radius: var(--radius-sm);
  color: var(--brand-red);
  font-size: 13px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.auth-switch {
  text-align: center;
  font-size: 13px;
  color: var(--brand-muted);
  margin-top: 18px;
}

.auth-link {
  color: var(--brand-gold);
  cursor: pointer;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── APP HEADER ──────────────────────────────────────────── */
.app-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px 12px;
  border-bottom: 0.5px solid var(--brand-border);
  position: sticky;
  top: 0;
  background: var(--brand-dark);
  z-index: 100;
}

.header-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.wordmark {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--brand-gold);
  text-transform: uppercase;
}

.wordmark-sub {
  font-size: 10px;
  color: var(--brand-muted);
  letter-spacing: 0.08em;
}

.header-right {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

/* ── NAV TABS ────────────────────────────────────────────── */
.nav-tabs {
  display: flex;
  border-bottom: 0.5px solid var(--brand-border);
  background: var(--brand-dark);
  position: sticky;
  top: 61px;
  z-index: 99;
}

.nav-tab {
  flex: 1;
  padding: 12px 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--brand-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  text-transform: uppercase;
}

.nav-tab.active {
  color: var(--brand-gold);
  border-bottom-color: var(--brand-gold);
}

/* ── SCREENS ─────────────────────────────────────────────── */
.screen {
  display: none;
  padding: 20px;
}

.screen.active {
  display: block;
}

/* ── SECTION TITLE ───────────────────────────────────────── */
.section-title {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--brand-gold);
  text-transform: uppercase;
  margin-bottom: 14px;
}

/* ── CARDS ───────────────────────────────────────────────── */
.card {
  background: var(--brand-card);
  border: 0.5px solid var(--brand-border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

/* ── BADGE ───────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  background: var(--brand-gold-dim);
  color: var(--brand-gold);
  white-space: nowrap;
}

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background 0.18s, transform 0.12s;
  letter-spacing: 0.02em;
}

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

.btn-gold {
  background: var(--brand-gold);
  color: #0a0a0f;
  font-weight: 600;
}
.btn-gold:hover { background: #d4b460; }

.btn-outline {
  background: transparent;
  color: var(--brand-text);
  border: 0.5px solid var(--brand-border-strong);
}
.btn-outline:hover { background: rgba(255, 255, 255, 0.05); }

.btn-danger {
  background: rgba(224, 92, 92, 0.12);
  color: var(--brand-red);
  border: 0.5px solid rgba(224, 92, 92, 0.20);
}

.btn-sm   { padding: 7px 12px; font-size: 12px; }
.btn-block { width: 100%; }

/* ── FORM ELEMENTS ───────────────────────────────────────── */
label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--brand-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="number"],
textarea,
select {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 0.5px solid var(--brand-border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--brand-text);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  -webkit-appearance: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="url"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  border-color: var(--brand-gold);
  background: rgba(201, 168, 76, 0.04);
}

input::placeholder,
textarea::placeholder {
  color: var(--brand-dim);
}

select option { background: #1a1a26; color: #e8e6e0; }
textarea { resize: vertical; min-height: 70px; }

.form-group { margin-bottom: 16px; }

/* ── DURATION PILLS ──────────────────────────────────────── */
.duration-pills { display: flex; gap: 10px; }

.duration-pill {
  flex: 1;
  padding: 10px;
  border: 0.5px solid var(--brand-border-strong);
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--brand-muted);
  cursor: pointer;
  transition: all 0.18s;
}

.duration-pill.selected {
  border-color: var(--brand-gold);
  color: var(--brand-gold);
  background: var(--brand-gold-glow);
}

/* ── CHAPTER ITEM ────────────────────────────────────────── */
.chapter-item {
  background: rgba(255, 255, 255, 0.03);
  border: 0.5px solid var(--brand-border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 10px;
}

.chapter-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.chapter-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--brand-gold-dim);
  color: var(--brand-gold);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.chapter-info    { flex: 1; min-width: 0; }
.chapter-name    { font-weight: 600; font-size: 14px; color: var(--brand-text); }
.chapter-desc    { font-size: 12px; color: var(--brand-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chapter-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 0.5px solid var(--brand-border);
}

.music-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--brand-muted);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-green);
  flex-shrink: 0;
  animation: pulse 1.5s ease-in-out infinite;
}

.music-dot.none {
  background: var(--brand-dim);
  animation: none;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

/* ── DRAG HANDLE ─────────────────────────────────────────── */
.drag-handle {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 4px;
  cursor: grab;
  opacity: 0.4;
}

.drag-handle span {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--brand-text);
  border-radius: 1px;
}

/* ── SESSION CARDS ───────────────────────────────────────── */
.session-card {
  background: var(--brand-card);
  border: 0.5px solid var(--brand-border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: border-color 0.18s;
}

.session-card:hover  { border-color: var(--brand-border-strong); }
.session-card.active { border-color: var(--brand-gold); }

.session-row    { display: flex; align-items: center; gap: 12px; }

.session-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--brand-gold-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.session-details { flex: 1; min-width: 0; }
.session-name    { font-weight: 600; font-size: 14px; color: var(--brand-text); margin-bottom: 3px; }
.session-meta-row { display: flex; gap: 10px; }
.session-meta    { font-size: 11px; color: var(--brand-muted); }

/* ── TIMELINE ────────────────────────────────────────────── */
.timeline { display: flex; flex-direction: column; }

.timeline-item { display: flex; gap: 12px; align-items: stretch; }

.timeline-line-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 24px;
  flex-shrink: 0;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand-border-strong);
  border: 2px solid var(--brand-card);
  flex-shrink: 0;
  margin-top: 4px;
}

.timeline-dot.active { background: var(--brand-gold); }
.timeline-dot.done   { background: var(--brand-green); }

.timeline-connector {
  width: 1px;
  flex: 1;
  background: var(--brand-border);
  margin: 4px 0;
}

.timeline-content { flex: 1; padding-bottom: 16px; }

/* ── PLAYER ──────────────────────────────────────────────── */
.player-outer {
  background: var(--brand-card);
  border: 0.5px solid var(--brand-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
}

.player-chapter-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-muted);
  margin-bottom: 4px;
}

.player-chapter-name {
  font-family: 'Cinzel', serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--brand-gold);
  margin-bottom: 6px;
}

.player-chapter-desc {
  font-size: 13px;
  color: var(--brand-muted);
  margin-bottom: 18px;
  line-height: 1.5;
}

.time-bar-wrap   { margin-bottom: 16px; }

.time-bar-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 6px;
}

.time-bar-fill {
  height: 100%;
  background: var(--brand-gold);
  border-radius: 2px;
  transition: width 1s linear;
}

.time-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--brand-muted);
}

.player-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 16px;
}

.ctrl-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--brand-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 50%;
  transition: color 0.18s, background 0.18s;
}

.ctrl-btn:hover  { color: var(--brand-text); background: rgba(255, 255, 255, 0.06); }
.ctrl-btn:active { transform: scale(0.9); }

.ctrl-play {
  width: 56px;
  height: 56px;
  background: var(--brand-gold);
  color: #0a0a0f;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s, transform 0.12s;
}

.ctrl-play:active { transform: scale(0.94); }

/* ── BLUETOOTH ───────────────────────────────────────────── */
.bt-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 0.5px solid var(--brand-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.bt-icon   { color: var(--brand-blue); }
.bt-label  { flex: 1; font-size: 13px; color: var(--brand-text); }
.bt-status { font-size: 11px; color: var(--brand-muted); }

.bt-device-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }

.bt-device {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 0.5px solid var(--brand-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.18s;
}

.bt-device:hover      { border-color: var(--brand-border-strong); }
.bt-device.connected  { border-color: var(--brand-blue); }
.bt-signal { margin-left: auto; font-size: 11px; color: var(--brand-muted); }

/* ── MODALS ──────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 200;
  align-items: flex-end;
  justify-content: center;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--brand-surface);
  border: 0.5px solid var(--brand-border-strong);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 24px 20px 32px;
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  animation: slideUp 0.25s ease;
}

@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-handle {
  width: 36px;
  height: 4px;
  background: var(--brand-border-strong);
  border-radius: 2px;
  margin: 0 auto 20px;
}

.modal-title {
  font-family: 'Cinzel', serif;
  font-size: 15px;
  color: var(--brand-gold);
  margin-bottom: 20px;
  letter-spacing: 0.06em;
}

/* ── CHAPTER DURATION ROW ────────────────────────────────── */
.chapter-duration-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

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

.empty-icon  { font-size: 40px; margin-bottom: 16px; opacity: 0.4; }
.empty-title { font-weight: 600; font-size: 15px; color: var(--brand-text); margin-bottom: 6px; }
.empty-sub   { font-size: 13px; color: var(--brand-muted); margin-bottom: 20px; }

/* ── SESSION COMPLETE ────────────────────────────────────── */
.complete-panel {
  text-align: center;
  padding: 32px 20px;
}

.complete-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(92, 190, 138, 0.15);
  border: 1px solid rgba(92, 190, 138, 0.30);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.complete-title {
  font-family: 'Cinzel', serif;
  font-size: 20px;
  color: var(--brand-gold);
  margin-bottom: 8px;
}

/* ── TOAST ───────────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--brand-card);
  border: 0.5px solid var(--brand-border-strong);
  color: var(--brand-text);
  padding: 10px 18px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 500;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  white-space: nowrap;
}

#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── SVG ICONS ───────────────────────────────────────────── */
.icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }

/* ── UTILITIES ───────────────────────────────────────────── */
.flex             { display: flex; }
.items-center     { align-items: center; }
.justify-between  { justify-content: space-between; }
.gap-8            { gap: 8px; }
.gap-10           { gap: 10px; }
.mb-4             { margin-bottom: 4px; }
.mb-8             { margin-bottom: 8px; }
.mb-12            { margin-bottom: 12px; }
.mb-16            { margin-bottom: 16px; }
.mb-20            { margin-bottom: 20px; }
.text-gold        { color: var(--brand-gold); }
.text-muted       { color: var(--brand-muted); font-size: 12px; }
.text-sm          { font-size: 13px; }
.font-bold        { font-weight: 600; }
.divider          { height: 0.5px; background: var(--brand-border); margin: 16px 0; }
