/* ===================================================================
   TUTUR.AI & TSTECH.ID — VOICE CLONING & TTS STUDIO
   Design System: Obsidian Dark & Pristine Light Mode
   =================================================================== */

:root {
  /* LIGHT MODE TOKENS */
  --bg-app: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f1f5f9;
  --bg-surface-translucent: rgba(255, 255, 255, 0.82);
  --border-subtle: #e2e8f0;
  --border-highlight: #cbd5e1;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  --accent-cyan: #0284c7;
  --accent-cyan-subtle: #e0f2fe;
  --accent-indigo: #4f46e5;
  --accent-indigo-subtle: #e0e7ff;
  --accent-purple: #7c3aed;
  --accent-emerald: #059669;
  --accent-emerald-subtle: #d1fae5;
  --accent-orange: #d97706;
  --accent-orange-subtle: #fef3c7;
  --accent-rose: #e11d48;
  --accent-rose-subtle: #ffe4e6;

  --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
  --card-shadow-hover: 0 20px 35px -8px rgba(0, 0, 0, 0.09);
  --card-glow: 0 0 25px rgba(79, 70, 229, 0.08);

  --ambient-1: rgba(56, 189, 248, 0.08);
  --ambient-2: rgba(129, 140, 248, 0.08);
  --ambient-3: rgba(244, 114, 182, 0.05);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 9999px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Plus Jakarta Sans', var(--font-sans);
  --font-mono: 'JetBrains Mono', monospace;
}

/* ===================================================================
   DARK MODE OVERRIDES (TRUE OBSIDIAN BLACK #000000 / #050508)
   =================================================================== */
[data-theme="dark"] {
  --bg-app: #000000;
  --bg-surface: #0a0b0e;
  --bg-surface-elevated: #111318;
  --bg-surface-translucent: rgba(10, 11, 14, 0.78);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(255, 255, 255, 0.16);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #000000;

  --accent-cyan: #38bdf8;
  --accent-cyan-subtle: rgba(56, 189, 248, 0.12);
  --accent-indigo: #6366f1;
  --accent-indigo-subtle: rgba(99, 102, 241, 0.14);
  --accent-purple: #a855f7;
  --accent-emerald: #10b981;
  --accent-emerald-subtle: rgba(16, 185, 129, 0.14);
  --accent-orange: #f59e0b;
  --accent-orange-subtle: rgba(245, 158, 11, 0.14);
  --accent-rose: #f43f5e;
  --accent-rose-subtle: rgba(244, 63, 94, 0.14);

  --card-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.8), 0 0 1px 1px rgba(255, 255, 255, 0.06);
  --card-shadow-hover: 0 24px 50px -10px rgba(0, 0, 0, 0.9), 0 0 20px rgba(56, 189, 248, 0.15);
  --card-glow: 0 0 35px rgba(99, 102, 241, 0.18);

  --ambient-1: rgba(14, 165, 233, 0.14);
  --ambient-2: rgba(124, 58, 237, 0.12);
  --ambient-3: rgba(16, 185, 129, 0.08);
}

/* ===================================================================
   BASE & RESET
   =================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.2s ease, box-shadow 0.25s ease;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Ambient glow blobs */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.7;
}

.glow-1 {
  top: -10%;
  left: 15%;
  width: 500px;
  height: 500px;
  background: var(--ambient-1);
  animation: floatOrb 18s ease-in-out infinite alternate;
}

.glow-2 {
  top: 30%;
  right: -5%;
  width: 600px;
  height: 600px;
  background: var(--ambient-2);
  animation: floatOrb 22s ease-in-out infinite alternate-reverse;
}

.glow-3 {
  bottom: 5%;
  left: -5%;
  width: 500px;
  height: 500px;
  background: var(--ambient-3);
  animation: floatOrb 25s ease-in-out infinite alternate;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -30px) scale(1.08); }
  100% { transform: translate(-30px, 40px) scale(0.95); }
}

/* ===================================================================
   NAVBAR
   =================================================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-surface-translucent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-subtle);
  height: 68px;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(99, 102, 241, 0.15));
  border: 1px solid var(--border-highlight);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.2);
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.brand-title .highlight {
  color: var(--accent-cyan);
}

.brand-badge {
  display: inline-block;
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--accent-indigo-subtle);
  color: var(--accent-indigo);
  margin-left: 6px;
  vertical-align: middle;
}

.nav-center-badge {
  display: flex;
  align-items: center;
}

.tstech-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.tstech-pill:hover {
  border-color: var(--accent-cyan);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.tstech-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-highlight);
  transform: translateY(-1px);
}

/* Sun/Moon Toggle */
[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }
[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: block; }

/* User Auth in Navbar */
.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 4px 6px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-indigo));
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

.user-name {
  font-weight: 600;
  color: var(--text-primary);
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-logout-mini {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
  transition: color 0.2s;
}

.btn-logout-mini:hover {
  color: var(--accent-rose);
}

/* ===================================================================
   LAYOUT & CONTAINERS
   =================================================================== */
.container {
  max-width: 1160px;
  width: 100%;
  margin: 0 auto;
  padding: 36px 20px 60px;
  position: relative;
  z-index: 1;
  flex: 1;
}

/* Hero */
.hero-header {
  text-align: center;
  margin-bottom: 36px;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-cyan);
  margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.pulse-beacon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
  animation: beaconPulse 2s infinite;
}

@keyframes beaconPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.7); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 8px rgba(56, 189, 248, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); }
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.gradient-text {
  background: linear-gradient(135deg, #00f2fe 0%, #4facfe 50%, #7000ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  max-width: 680px;
  margin: 0 auto 20px;
  font-size: 1.02rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.hero-meta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.meta-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
}

/* Gate Banner */
.gate-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(225, 29, 72, 0.08));
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  margin-bottom: 28px;
  animation: fadeIn 0.3s ease;
}

.gate-banner-icon {
  color: var(--accent-orange);
  display: flex;
  align-items: center;
}

.gate-banner-text {
  flex: 1;
  font-size: 0.92rem;
  color: var(--text-primary);
}

/* Grid Layout */
.workspace-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 24px;
  margin-bottom: 28px;
}

/* ===================================================================
   CARDS & SECTIONS
   =================================================================== */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--card-shadow);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.glass-card {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.card:hover {
  border-color: var(--border-highlight);
}

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}

.card-header-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.blue-glow {
  background: var(--accent-cyan-subtle);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.purple-glow {
  background: var(--accent-indigo-subtle);
  color: var(--accent-indigo);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.orange-glow {
  background: var(--accent-orange-subtle);
  color: var(--accent-orange);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.card-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Textarea & Presets */
.textarea-wrapper {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 12px;
  margin-bottom: 16px;
  transition: all 0.2s ease;
}

.textarea-wrapper:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

textarea#tts-text {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 0.98rem;
  color: var(--text-primary);
  resize: vertical;
  min-height: 95px;
  line-height: 1.55;
}

textarea#tts-text::placeholder {
  color: var(--text-muted);
}

.textarea-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.stats-pills {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dot-sep {
  opacity: 0.4;
}

.btn-text-action {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.btn-text-action:hover {
  color: var(--accent-rose);
}

/* Preset Chips */
.preset-section {
  margin-bottom: 22px;
}

.preset-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip:hover {
  border-color: var(--accent-cyan);
  color: var(--text-primary);
  transform: translateY(-1px);
}

/* Emotion Section */
.emotion-section {
  margin-top: 16px;
}

.input-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.info-badge {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  background: var(--accent-cyan-subtle);
  color: var(--accent-cyan);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.emotion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.emotion-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.emotion-card:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
}

.emotion-card.active {
  background: linear-gradient(135deg, var(--accent-cyan-subtle), var(--accent-indigo-subtle));
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.25);
}

.emotion-emoji {
  font-size: 1.6rem;
  margin-bottom: 6px;
}

.emotion-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.emotion-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ===================================================================
   AUDIO REFERENCE TABS
   =================================================================== */
.tab-pill-group {
  display: flex;
  gap: 8px;
  background: var(--bg-surface-elevated);
  padding: 5px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  margin-bottom: 20px;
}

.tab-pill {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-pill:hover {
  color: var(--text-primary);
}

.tab-pill.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-highlight);
}

/* Tab 1: Mic Recorder */
.recorder-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.canvas-wrapper {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px;
  position: relative;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#mic-visualizer {
  width: 100%;
  height: 100%;
}

.recording-badge {
  position: absolute;
  top: 10px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(225, 29, 72, 0.2);
  border: 1px solid rgba(225, 29, 72, 0.4);
  color: var(--accent-rose);
  font-size: 0.78rem;
  font-weight: 700;
}

.recording-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-rose);
  animation: pulse 1s infinite;
}

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

.recorder-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-record {
  background: var(--accent-rose);
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.3);
  transition: all 0.2s ease;
}

.btn-record:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-record.recording {
  background: #475569;
  box-shadow: none;
}

.record-icon-circle {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
}

.recorder-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  text-align: center;
}

/* Audio Preview Card */
.audio-preview-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-top: 10px;
}

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

.preview-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-emerald);
}

.btn-text-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  cursor: pointer;
}

.btn-text-delete:hover {
  color: var(--accent-rose);
}

.native-player {
  width: 100%;
  height: 38px;
  border-radius: var(--radius-sm);
}

/* Tab 2: Upload Dropzone */
.dropzone {
  border: 2px dashed var(--border-highlight);
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-lg);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent-cyan);
  background: var(--accent-cyan-subtle);
}

.dropzone-icon {
  color: var(--accent-cyan);
  margin-bottom: 12px;
}

.dropzone-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

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

/* Tab 3: Sample Cloud */
.sample-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sample-info {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.sample-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--accent-cyan-subtle);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sample-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.sample-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ===================================================================
   ACTION DOCK & SYNTHESIS BUTTON
   =================================================================== */
.action-dock {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 30px;
}

.btn-cta {
  width: 100%;
  max-width: 600px;
  padding: 16px 28px;
  font-size: 1.08rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(56, 189, 248, 0.35);
}

.btn-cta::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    60deg,
    transparent 20%,
    rgba(255, 255, 255, 0.25) 50%,
    transparent 80%
  );
  transform: rotate(30deg);
  animation: shine 4s infinite linear;
}

@keyframes shine {
  0% { transform: translateX(-150%) rotate(30deg); }
  100% { transform: translateX(150%) rotate(30deg); }
}

.btn-shortcut {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.2);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  margin-left: 6px;
}

/* Loader Card */
.loader-card {
  width: 100%;
  max-width: 600px;
  background: var(--bg-surface);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  display: flex;
  gap: 16px;
  align-items: center;
  box-shadow: var(--card-shadow);
  animation: fadeIn 0.3s ease;
}

.loader-spinner-wrapper {
  flex-shrink: 0;
}

.loader-spinner {
  width: 38px;
  height: 38px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--accent-cyan);
  border-right-color: var(--accent-indigo);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loader-content {
  flex: 1;
}

.loader-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
}

.loader-timer {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent-cyan);
}

.loader-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: 6px;
}

.progress-fill {
  width: 25%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-indigo));
  border-radius: var(--radius-pill);
  transition: width 0.3s ease;
  animation: progressIndeterminate 2s infinite ease-in-out;
}

@keyframes progressIndeterminate {
  0% { width: 10%; margin-left: 0; }
  50% { width: 60%; margin-left: 20%; }
  100% { width: 90%; margin-left: 10%; }
}

.loader-detail {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ===================================================================
   RESULT CARD & CUSTOM PLAYER
   =================================================================== */
.result-card {
  border-color: rgba(56, 189, 248, 0.4);
  margin-bottom: 30px;
  background: linear-gradient(180deg, var(--bg-surface), var(--bg-surface-elevated));
  animation: slideUp 0.4s ease;
}

.result-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.result-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--accent-emerald-subtle);
  color: var(--accent-emerald);
  font-size: 0.82rem;
  font-weight: 700;
}

.result-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Custom Player */
.custom-player-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
}

.player-main-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.player-circle-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-indigo));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.35);
  transition: all 0.2s ease;
}

.player-circle-btn:hover {
  transform: scale(1.05);
}

.player-time-track {
  flex: 1;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.player-timestamps {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.player-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface-elevated);
  outline: none;
}

.player-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-cyan);
  cursor: pointer;
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.6);
}

.player-extra-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn-sm {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-family: var(--font-mono);
  font-weight: 600;
  cursor: pointer;
}

.icon-btn-sm:hover {
  border-color: var(--accent-cyan);
  color: var(--text-primary);
}

#result-visualizer {
  width: 100%;
  height: 40px;
  margin-top: 14px;
  border-radius: var(--radius-sm);
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.metric-value-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 4px;
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.accent-cyan { color: var(--accent-cyan); }
.accent-indigo { color: var(--accent-indigo); }
.accent-emerald { color: var(--accent-emerald); }

.metric-unit {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.metric-footnote {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ===================================================================
   BENCHMARK PANEL
   =================================================================== */
.benchmark-card {
  border-color: rgba(245, 158, 11, 0.3);
  background: linear-gradient(180deg, var(--bg-surface), var(--bg-surface-elevated));
}

.benchmark-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.benchmark-info {
  display: flex;
  gap: 14px;
  max-width: 650px;
}

.badge-accent-orange {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--accent-orange);
  background: var(--accent-orange-subtle);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  margin-bottom: 4px;
}

.benchmark-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.benchmark-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.btn-orange {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.btn-orange:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-orange:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Benchmark Progress */
.benchmark-progress-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 18px;
}

.benchmark-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.loop-badge {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: var(--accent-orange-subtle);
  color: var(--accent-orange);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #ef4444);
  border-radius: var(--radius-pill);
  transition: width 0.3s ease;
}

/* Benchmark Table */
.benchmark-results-container {
  margin-top: 18px;
}

.table-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  margin-bottom: 16px;
}

.styled-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  text-align: left;
}

.styled-table th {
  background: var(--bg-surface-elevated);
  padding: 10px 14px;
  font-weight: 700;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
}

.styled-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.styled-table tr:last-child td {
  border-bottom: none;
}

.styled-table tr:hover td {
  background: var(--bg-surface-elevated);
}

.benchmark-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.benchmark-summary-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-primary);
  flex: 1;
}

/* ===================================================================
   BUTTONS & COMMON UI
   =================================================================== */
.btn {
  font-family: inherit;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7 0%, #4f46e5 100%);
  color: #ffffff;
}

[data-theme="dark"] .btn-primary {
  background: linear-gradient(135deg, #00f2fe 0%, #4facfe 50%, #6366f1 100%);
  color: #000000;
  font-weight: 700;
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-highlight);
  color: var(--text-primary);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  gap: 8px;
}

.btn-outline:hover {
  border-color: var(--accent-cyan);
  background: var(--bg-surface-elevated);
}

.btn-outline-cyan {
  background: transparent;
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-outline-cyan:hover {
  background: var(--accent-cyan-subtle);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.82rem;
  border-radius: var(--radius-md);
}

.alert-box {
  width: 100%;
  max-width: 600px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 500;
}

.alert-box.error {
  background: var(--accent-rose-subtle);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: var(--accent-rose);
}

/* ===================================================================
   MODAL: LOGIN TSTECH.ID SSO
   =================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 440px;
  padding: 32px 28px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8);
  position: relative;
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  0% { opacity: 0; transform: scale(0.94); }
  100% { opacity: 1; transform: scale(1); }
}

.modal-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close-btn:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
}

.modal-header {
  text-align: center;
  margin-bottom: 24px;
}

.modal-brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.modal-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.btn-sso {
  width: 100%;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-highlight);
  color: var(--text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 18px;
  transition: all 0.2s ease;
}

.btn-sso:hover {
  border-color: var(--accent-cyan);
  background: var(--accent-cyan-subtle);
  transform: translateY(-1px);
}

.sso-logo-icon {
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
}

.modal-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 18px 0;
}

.modal-divider::before, .modal-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-divider span {
  padding: 0 10px;
}

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

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.input-with-icon {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-muted);
}

.input-with-icon:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
}

.input-with-icon input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
}

.modal-quick-login {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.btn-text-link {
  background: none;
  border: none;
  color: var(--accent-cyan);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 4px;
}

.btn-text-link:hover {
  text-decoration: underline;
}

/* ===================================================================
   TOAST NOTIFICATION
   =================================================================== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  background: var(--bg-surface);
  border: 1px solid var(--border-highlight);
  color: var(--text-primary);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* ===================================================================
   FOOTER
   =================================================================== */
.footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  padding: 24px 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
  position: relative;
  z-index: 10;
}

.footer-container {
  max-width: 1160px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.footer-link {
  color: var(--accent-cyan);
  text-decoration: none;
  font-weight: 600;
}

.footer-link:hover {
  text-decoration: underline;
}

/* ===================================================================
   KEYFRAME ANIMATIONS
   =================================================================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

.active-sample-pill {
  background: var(--accent-cyan-subtle) !important;
  color: var(--accent-cyan) !important;
  border-color: var(--accent-cyan) !important;
  font-weight: 700;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

[data-theme="dark"] .active-sample-pill {
  background: rgba(56, 189, 248, 0.15) !important;
  color: #38bdf8 !important;
  border-color: #38bdf8 !important;
}

/* ===================================================================
   RESPONSIVE QUERIES
   =================================================================== */
@media (max-width: 768px) {
  .nav-center-badge {
    display: none;
  }
  .workspace-grid {
    grid-template-columns: 1fr;
  }
  .hero-title {
    font-size: 1.85rem;
  }
  .footer-container {
    flex-direction: column;
    text-align: center;
  }
}

