/* ── Global Dark Theme ── */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --color-bg: #0a0a0f;
  --color-surface: #12121a;
  --color-surface-hover: #1a1a26;
  --color-border: #1e1e2e;
  --color-text: #e8e8ed;
  --color-text-muted: #7a7a8c;
  --color-primary: #6c63ff;
  --color-primary-hover: #5a52e0;
  --color-primary-glow: rgba(108, 99, 255, 0.15);
  --color-success: #00d4aa;
  --color-success-bg: rgba(0, 212, 170, 0.08);
  --color-danger: #ff5f6d;
  --color-danger-bg: rgba(255, 95, 109, 0.08);
  --radius: 10px;
}

body.light-mode {
  --color-bg: #f5f5fa;
  --color-surface: #ffffff;
  --color-surface-hover: #ebebf5;
  --color-border: #dcdce8;
  --color-text: #1a1a2e;
  --color-text-muted: #6a6a8c;
  --color-primary-glow: rgba(108, 99, 255, 0.12);
  --color-success-bg: rgba(0, 212, 170, 0.12);
  --color-danger-bg: rgba(255, 95, 109, 0.12);
}

body.light-mode .app-header {
  background: rgba(245, 245, 250, 0.9);
}

body.light-mode.landing-body {
  --landing-bg: #f5f5fa;
  --landing-surface: #ffffff;
  --landing-border: #dcdce8;
  --landing-text: #1a1a2e;
  --landing-muted: #6a6a8c;
  --landing-glow: rgba(108, 99, 255, 0.1);
}

body.light-mode .landing-body .landing-header,
body.light-mode.landing-body .landing-header {
  background: rgba(245, 245, 250, 0.9);
}

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

body {
  font-family: 'Sora', sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
}

/* ── Buttons ── */

.btn {
  display: inline-block;
  padding: 10px 20px;
  border: 1px solid var(--color-border);
  border-radius: 100px;
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  font-size: 14px;
  font-family: 'Sora', sans-serif;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn:hover {
  border-color: var(--color-text-muted);
  background: var(--color-surface-hover);
}

.btn-primary {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  box-shadow: 0 0 20px rgba(108, 99, 255, 0.2);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  box-shadow: 0 0 30px rgba(108, 99, 255, 0.35);
}

.btn-small { padding: 7px 14px; font-size: 13px; }

.btn-large { padding: 14px 32px; font-size: 16px; }

.btn-google {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 14px 24px;
  font-size: 15px;
  width: 100%;
  border-radius: 100px;
  transition: all 0.3s ease;
}

.btn-google:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-primary);
  box-shadow: 0 0 20px var(--color-primary-glow);
}

.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-danger {
  color: var(--color-danger);
  border-color: rgba(255, 95, 109, 0.3);
}

.btn-danger:hover {
  background: var(--color-danger-bg);
  border-color: var(--color-danger);
}

.theme-toggle {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 100px;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 16px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.theme-toggle:hover {
  border-color: var(--color-text-muted);
  background: var(--color-surface-hover);
}

/* ── Layout ── */

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 32px;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-right { display: flex; align-items: center; gap: 12px; }
.header-right span { color: var(--color-text-muted); font-size: 13px; }

.logo {
  font-weight: 700;
  font-size: 18px;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: -0.5px;
}

/* ── Auth ── */

.auth-container {
  max-width: 420px;
  margin: 120px auto;
  padding: 48px;
  background: var(--color-surface);
  border-radius: 16px;
  border: 1px solid var(--color-border);
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.auth-container h1 {
  margin-bottom: 8px;
  font-size: 24px;
  letter-spacing: -0.5px;
}

.auth-subtitle { color: var(--color-text-muted); margin-bottom: 32px; font-size: 14px; font-weight: 300; }
.auth-footer { margin-top: 28px; color: var(--color-text-muted); font-size: 14px; }
.auth-footer a { color: var(--color-primary); text-decoration: none; font-weight: 500; }
.auth-footer a:hover { text-decoration: underline; }

/* ── Forms ── */

label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  margin-top: 18px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

input[type="text"], input[type="email"], input[type="password"] {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: 'Sora', sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

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

input::placeholder { color: var(--color-text-muted); opacity: 0.6; }

/* ── Error ── */

.error-message {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  border: 1px solid rgba(255, 95, 109, 0.2);
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 14px;
}

/* ── Landing (basic structure — full styles in landing.css) ── */

.landing-header { background: transparent; }

.landing-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 32px;
  background: transparent;
  border-bottom: none;
}

.hero {
  text-align: center;
  padding: 80px 24px;
  max-width: 700px;
  margin: 0 auto;
}

.hero h1 { font-size: 36px; margin-bottom: 16px; }
.hero-subtitle { font-size: 18px; color: var(--color-text-muted); margin-bottom: 32px; line-height: 1.6; }

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.feature-card {
  background: var(--color-surface);
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}

.feature-card h3 { margin-bottom: 8px; }
.feature-card p { color: var(--color-text-muted); font-size: 14px; line-height: 1.5; }

.landing-footer {
  text-align: center;
  padding: 24px;
  color: var(--color-text-muted);
  font-size: 14px;
  border-top: 1px solid var(--color-border);
}

/* ── Dashboard ── */

.dashboard-main { max-width: 900px; margin: 0 auto; padding: 32px; }

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.dashboard-header h1 {
  font-size: 24px;
  letter-spacing: -0.5px;
}

.sessions-list { display: grid; gap: 16px; }

.session-card {
  background: var(--color-surface);
  padding: 24px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  transition: all 0.3s ease;
}

.session-card:hover {
  border-color: rgba(108, 99, 255, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.session-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.session-card-header h3 { font-size: 16px; font-weight: 600; }
.session-steps-count { color: var(--color-text-muted); font-size: 13px; margin-bottom: 14px; }
.session-card-actions { display: flex; gap: 8px; }

.status-badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.status-active {
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid rgba(0, 212, 170, 0.2);
}

.status-closed {
  background: rgba(122, 122, 140, 0.1);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

.empty-state, .loading {
  color: var(--color-text-muted);
  text-align: center;
  padding: 48px;
  font-size: 14px;
}

/* ── Modal ── */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-content {
  background: var(--color-surface);
  padding: 36px;
  border-radius: 16px;
  border: 1px solid var(--color-border);
  width: 100%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.modal-content h2 { margin-bottom: 20px; font-size: 20px; letter-spacing: -0.3px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 28px; }

.step-input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: flex-start;
}

.step-input-row input { flex: 1; }

.drag-handle {
  cursor: grab;
  color: var(--color-text-muted);
  font-size: 18px;
  padding: 10px 2px 0;
  user-select: none;
  flex-shrink: 0;
  line-height: 1;
}

.drag-handle:active { cursor: grabbing; }

.step-input-row.dragging { opacity: 0.35; }

.step-input-row.drag-over {
  outline: 2px dashed var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius);
}

.btn-remove-step {
  background: var(--color-danger-bg);
  border: 1px solid rgba(255, 95, 109, 0.2);
  color: var(--color-danger);
  cursor: pointer;
  border-radius: var(--radius);
  padding: 6px 10px;
  font-family: 'Sora', sans-serif;
  transition: all 0.2s ease;
}

.btn-remove-step:hover {
  background: rgba(255, 95, 109, 0.15);
}

/* ── Session Page ── */

.session-main { max-width: 1200px; margin: 0 auto; padding: 32px; }

.session-header { margin-bottom: 28px; }
.session-header h1 { margin-bottom: 10px; font-size: 24px; letter-spacing: -0.5px; }

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

/* ── Participant Steps ── */

.steps-list { display: grid; gap: 12px; }

.step-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--color-surface);
  padding: 18px 24px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  transition: all 0.3s ease;
}

.step-completed {
  border-color: rgba(0, 212, 170, 0.3);
  background: var(--color-success-bg);
}

.step-locked { opacity: 0.4; }

.step-info { display: flex; align-items: center; gap: 14px; }

.step-name-group { display: flex; flex-direction: column; gap: 2px; }

.step-description { font-size: 13px; color: var(--color-text-muted); line-height: 1.4; }

.step-number {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  font-size: 13px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}

.step-completed .step-number {
  background: var(--color-success);
  border-color: var(--color-success);
  color: #0a0a0f;
}

.step-check { color: var(--color-success); font-weight: 600; font-size: 14px; }
.step-lock { color: var(--color-text-muted); font-size: 14px; }

/* ── Creator Grid ── */

.participants-grid { overflow-x: auto; }

.grid-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--color-surface);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.grid-table th, .grid-table td {
  padding: 14px 18px;
  border: 1px solid var(--color-border);
  text-align: center;
}

.grid-table th {
  background: var(--color-bg);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
}

.grid-table td:first-child, .grid-table th:first-child { text-align: left; }

.participant-name { font-weight: 500; white-space: nowrap; }
.progress-count { color: var(--color-text-muted); font-weight: 400; font-size: 12px; }

.step-done { color: var(--color-success); font-size: 18px; }
.step-pending { color: var(--color-border); }

.row-complete { background: var(--color-success-bg); }

.btn-reset {
  color: var(--color-danger);
  border-color: rgba(255, 95, 109, 0.3);
}

.btn-reset:hover {
  background: var(--color-danger-bg);
}

/* ── Join View ── */

#join-view {
  max-width: 500px;
  margin: 80px auto;
  text-align: center;
  background: var(--color-surface);
  padding: 48px;
  border-radius: 16px;
  border: 1px solid var(--color-border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

#join-view h1 { margin-bottom: 8px; font-size: 22px; }
#join-view form { margin-top: 28px; text-align: left; }
#join-view .btn-primary { width: 100%; margin-top: 20px; }

/* ── Responsive ── */

@media (max-width: 640px) {
  .hero h1 { font-size: 28px; }
  .hero-subtitle { font-size: 16px; }
  .dashboard-header { flex-direction: column; gap: 12px; align-items: flex-start; }
  .session-controls { flex-wrap: wrap; }
  .app-header { padding: 14px 20px; }
  .dashboard-main, .session-main { padding: 20px; }
}
