/* ─────────────────────────────────────────────────────────────────────────────
   dashboard.css — styles for /dashboard page
   Inherits CSS variables from theme.css
───────────────────────────────────────────────────────────────────────────── */

/* Auth Gate */
.auth-gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 36px;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text);
  margin-bottom: 32px;
}

.auth-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 28px;
  background: var(--bg);
  border-radius: 8px;
  padding: 4px;
}

.auth-tab {
  flex: 1;
  padding: 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-tab.active {
  background: var(--surface-2);
  color: var(--text);
}

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

.form-group label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 500;
}

.form-group input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font-body);
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: rgba(0,229,192,0.4);
}

.auth-error {
  background: rgba(255,80,80,0.1);
  border: 1px solid rgba(255,80,80,0.25);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.85rem;
  color: #ff8080;
  margin-bottom: 16px;
}

.auth-back {
  display: block;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  margin-top: 16px;
  transition: color 0.2s;
}
.auth-back:hover { color: var(--text); }

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 11px 20px;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: opacity 0.2s;
  text-decoration: none;
  margin-top: 8px;
}
.btn-primary:hover { opacity: 0.85; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-ghost {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-ghost:hover { border-color: rgba(255,255,255,0.15); color: var(--text); }

.btn-sm { padding: 6px 12px; font-size: 0.78rem; }

.hidden { display: none !important; }

/* Dashboard layout */
.dashboard {
  min-height: 100vh;
  background: var(--bg);
}

.dash-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 48px;
  background: rgba(12,18,32,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.dash-nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-email {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.dash-main {
  max-width: 860px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.dash-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 8px;
}

.dash-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--text);
}

.upload-limit-note {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Upload zone */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 48px 32px;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
  background: rgba(255,255,255,0.01);
  margin-bottom: 36px;
}

.upload-zone.drag-over {
  border-color: rgba(0,229,192,0.5);
  background: rgba(0,229,192,0.04);
}

.upload-icon { margin-bottom: 16px; }

.upload-label {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 6px;
  font-weight: 500;
}

.upload-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.upload-btn-label {
  display: inline-flex;
  width: auto;
  cursor: pointer;
  margin-top: 0;
}

.upload-progress {
  margin-top: 20px;
}

.upload-progress-bar {
  height: 4px;
  background: var(--surface-2);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}

.upload-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s ease;
}

#upload-progress-label {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.upload-error {
  margin-top: 16px;
  background: rgba(255,80,80,0.1);
  border: 1px solid rgba(255,80,80,0.25);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.85rem;
  color: #ff8080;
}

/* Recordings list */
.recordings-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.recordings-empty {
  background: var(--surface);
  padding: 40px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.recording-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--surface);
  gap: 16px;
  flex-wrap: wrap;
}

.recording-row:hover { background: var(--surface-2); }

.rec-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.rec-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: var(--accent-dim);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rec-info { min-width: 0; }

.rec-name {
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 340px;
}

.rec-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.rec-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.rec-status {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 100px;
  letter-spacing: 0.02em;
}

.status-ready {
  background: rgba(0,229,192,0.12);
  color: var(--accent);
}

.status-uploading, .status-transcribing {
  background: rgba(255,200,50,0.1);
  color: #ffc832;
  animation: pulse-status 1.8s ease-in-out infinite;
}

.status-failed {
  background: rgba(255,80,80,0.1);
  color: #ff8080;
}

@keyframes pulse-status {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

/* Transcript modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 680px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-header h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80%;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.2s;
  flex-shrink: 0;
}
.modal-close:hover { color: var(--text); }

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.transcript-text {
  white-space: pre-wrap;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.loading-text, .error-text {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 20px 0;
}
.error-text { color: #ff8080; }

/* Search bar */
.search-bar-wrap {
  position: relative;
  margin-bottom: 24px;
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
  flex-shrink: 0;
}

.search-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 40px 10px 40px;
  color: var(--text);
  font-size: 0.9rem;
  font-family: var(--font-body);
  transition: border-color 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: rgba(0,229,192,0.3);
}

.search-input::placeholder { color: var(--text-muted); }

.search-clear {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 4px;
  line-height: 1;
}

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  z-index: 100;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  overflow: hidden;
  max-height: 380px;
  overflow-y: auto;
}

.search-result-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  text-decoration: none;
  display: block;
}

.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--surface-2); }

.sr-name {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 3px;
}

.sr-preview {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.search-no-results {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Highlighted search term inside snippet (from ts_headline <b> tags) */
.sr-preview b {
  color: var(--accent);
  font-weight: 600;
  background: rgba(0,229,192,0.08);
  border-radius: 3px;
  padding: 0 2px;
}

/* "See all results" footer in dropdown */
.sr-see-all {
  display: block;
  padding: 10px 16px;
  font-size: 0.78rem;
  color: var(--accent);
  text-decoration: none;
  border-top: 1px solid var(--border);
  text-align: center;
  font-weight: 500;
  transition: background 0.15s;
}
.sr-see-all:hover { background: var(--surface-2); }

.sr-full-link {
  color: var(--accent);
  text-decoration: none;
}
.sr-full-link:hover { text-decoration: underline; }

/* Recording row — View Notes button */
.view-notes-btn {
  background: var(--accent-dim);
  border: 1px solid rgba(0,229,192,0.25);
  color: var(--accent);
  font-size: 0.78rem;
  padding: 6px 12px;
  border-radius: 8px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.view-notes-btn:hover {
  background: rgba(0,229,192,0.18);
}

/* Plan badge in nav */
.plan-badge-nav {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(0,229,192,0.15);
  color: #00e5c0;
  border: 1px solid rgba(0,229,192,0.3);
}

/* Upgrade modal */
.upgrade-modal-card {
  text-align: center;
  max-width: 440px;
  padding: 48px 40px 40px;
  position: relative;
}
.upgrade-modal-icon { margin-bottom: 20px; }
.upgrade-modal-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 12px;
}
.upgrade-modal-msg {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}
.upgrade-benefits {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}
.upgrade-benefits li {
  font-size: 0.88rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(232,232,240,0.75);
}
.upgrade-modal-cta {
  display: block;
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  margin-bottom: 12px;
}
.upgrade-modal-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0;
}

/* Upgraded success banner */
.upgraded-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #00e5c0;
  color: #0a0a0f;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 1000;
  box-shadow: 0 4px 24px rgba(0,229,192,0.35);
  white-space: nowrap;
}
.upgraded-banner button {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  font-size: 1rem;
  line-height: 1;
  opacity: 0.7;
  padding: 0 0 0 4px;
}
.upgraded-banner button:hover { opacity: 1; }

/* Responsive */
@media (max-width: 640px) {
  .dash-nav { padding: 14px 20px; }
  .dash-main { padding: 32px 16px 60px; }
  .upload-zone { padding: 32px 20px; }
  .rec-name { max-width: 180px; }
  .user-email { display: none; }
}
