/* ============================================
   AUDIOMIND — STYLE SYSTEM
   Colors: White · Graphite · Blue
   Font: Inter (200 / 500)
   ============================================ */

/* ---------- TOKENS ---------- */
:root {
  --white:        #FFFFFF;
  --bg:           #FAFBFC;
  --bg-card:      #FFFFFF;
  --border:       #E5E7EB;
  --border-hover: #D1D5DB;

  --graphite-50:  #F9FAFB;
  --graphite-100: #F3F4F6;
  --graphite-200: #E5E7EB;
  --graphite-300: #D1D5DB;
  --graphite-400: #9CA3AF;
  --graphite-500: #6B7280;
  --graphite-600: #4B5563;
  --graphite-700: #374151;
  --graphite-800: #1F2937;
  --graphite-900: #111827;
  --graphite-950: #030712;

  /* Replaced blue with slate/teal accents from the original, but main action is black */
  --accent-light: #F1F5F9;
  --accent-main:  #0F172A; /* Almost black */
  --accent-hover: #000000;
  
  --red:   #EF4444;
  --green: #10B981;

  --fw-light:  300;
  --fw-normal: 400;
  --fw-medium: 500;
  --fw-bold:   600;

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

  --shadow-sm:  0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md:  0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg:  0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-xl:  0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --shadow-btn: 0 4px 14px 0 rgba(0, 0, 0, 0.15);

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;

  --transition: 200ms cubic-bezier(.4,0,.2,1);
}

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

html {
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-weight: var(--fw-normal);
  font-size: 15px;
  line-height: 1.65;
  color: var(--graphite-700);
  background: linear-gradient(180deg, #F8FAFC 0%, #F1F5F9 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- UTILITIES ---------- */
.hidden { display: none !important; }
.w-full { width: 100%; }
.accent { color: var(--accent-main); }

/* ---------- HEADER ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(248, 250, 252, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 16px;
}
.logo-mark { line-height: 0; }
.logo-mark img {
  height: 60px;
  width: auto;
}
.logo-text {
  font-family: var(--font-sans);
  font-size: 32px;
  font-weight: 600;
  color: #1a6f66; /* Match Closer green/teal */
  letter-spacing: -0.5px;
}

.nav {
  display: flex;
  gap: 8px;
}
.nav-btn {
  font-family: var(--font-sans);
  font-weight: var(--fw-medium);
  font-size: 14px;
  color: var(--graphite-600);
  background: none;
  border: 1px solid var(--border);
  cursor: pointer;
  padding: 8px 20px;
  border-radius: var(--radius-pill);
  transition: all var(--transition);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}
.nav-btn:hover {
  border-color: var(--graphite-300);
  color: var(--accent-main);
  background: var(--graphite-50);
}
.nav-btn.active {
  background: var(--accent-main);
  color: var(--white);
  border-color: var(--accent-main);
  box-shadow: var(--shadow-md);
}

/* ---------- MAIN ---------- */
.main {
  flex: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 64px 24px 100px;
  width: 100%;
}

/* ---------- HERO ---------- */
.hero {
  text-align: left;
  margin-bottom: 48px;
}
.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(40px, 6vw, 56px);
  font-weight: 400;
  color: var(--graphite-900);
  letter-spacing: -0.5px;
  line-height: 1.15;
  margin-bottom: 18px;
}
.hero-sub {
  font-size: 18px;
  font-weight: 300;
  color: var(--graphite-500);
  max-width: 600px;
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: 'Inter', sans-serif;
  font-weight: var(--fw-medium);
  font-size: 14px;
  border-radius: var(--radius-md);
  padding: 10px 20px;
  cursor: pointer;
  transition: all var(--transition);
  border: 1.5px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent-main);
  color: var(--white);
  border-color: var(--accent-main);
  box-shadow: var(--shadow-btn);
  border-radius: var(--radius-pill);
  padding: 12px 28px;
  font-size: 15px;
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,.2);
}
.btn-primary:active { transform: translateY(0); }

.btn-outline {
  background: var(--white);
  color: var(--graphite-600);
  border-color: var(--border);
}
.btn-outline:hover {
  border-color: var(--graphite-400);
  color: var(--graphite-900);
  background: var(--graphite-50);
}
.btn-ghost {
  background: none;
  color: var(--graphite-500);
  border-color: transparent;
  padding: 6px 12px;
}
.btn-ghost:hover { background: var(--graphite-100); color: var(--graphite-900); }
.btn-sm { font-size: 13px; padding: 8px 16px; border-radius: var(--radius-pill); }
.btn-icon { font-size: 16px; }

/* ---------- API NOTICE ---------- */
.api-notice {
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue-400);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px 14px;
  align-items: start;
  margin-bottom: 24px;
  animation: fadeSlideIn .4s ease;
}
.api-notice-icon { font-size: 22px; line-height: 1; }
.api-notice-title {
  font-weight: var(--fw-medium);
  color: var(--graphite-700);
  font-size: 14px;
  margin-bottom: 3px;
}
.api-notice-desc {
  font-size: 13px;
  color: var(--graphite-400);
  font-weight: var(--fw-normal);
}
.api-key-row {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  align-items: center;
}
.api-key-field {
  flex: 1;
  font-family: 'Inter', monospace;
  font-size: 13px;
  font-weight: var(--fw-normal);
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--graphite-50);
  color: var(--graphite-700);
  outline: none;
  transition: border-color var(--transition);
}
.api-key-field:focus { border-color: var(--blue-400); background: var(--white); }

/* ---------- DROP ZONE ---------- */
.drop-zone {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--white);
  transition: all var(--transition);
  cursor: pointer;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--graphite-300);
  box-shadow: var(--shadow-md);
}
.drop-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 72px 24px;
  text-align: center;
}
.drop-icon {
  width: 80px;
  height: 80px;
  background: var(--blue-50);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--blue-100);
  transition: all var(--transition);
}
.drop-zone:hover .drop-icon {
  background: var(--blue-100);
  transform: scale(1.06);
}
.drop-title {
  font-family: var(--font-serif);
  font-size: 24px;
  color: var(--graphite-900);
  margin-bottom: -4px;
}
.drop-sub {
  font-size: 14px;
  font-weight: 300;
  color: var(--graphite-500);
}

/* ---------- AUDIO PREVIEW ---------- */
.audio-preview {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  animation: fadeSlideIn .35s ease;
}
.audio-preview-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.audio-icon {
  width: 48px; height: 48px;
  background: var(--graphite-50);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.file-name {
  font-weight: var(--fw-medium);
  color: var(--graphite-700);
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}
.file-size {
  font-size: 12px;
  color: var(--graphite-300);
  font-weight: var(--fw-normal);
}
audio {
  width: 100%;
  height: 40px;
  border-radius: var(--radius-sm);
  accent-color: var(--blue-500);
}

/* ---------- RECORDER ---------- */
.recorder-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  box-shadow: var(--shadow-md);
}
.recorder-visual {
  width: 100%;
  background: var(--graphite-50);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  height: 120px;
}
#visualizer-canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.recorder-status {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(255,255,255,.9);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: var(--fw-medium);
  color: var(--graphite-500);
  backdrop-filter: blur(8px);
}
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--graphite-300);
}
.status-dot.recording {
  background: var(--red);
  animation: blink 1s ease-in-out infinite;
}
.status-dot.paused { background: #F59E0B; }
.status-dot.done { background: var(--green); }

.recorder-timer {
  font-size: 42px;
  font-weight: var(--fw-medium);
  color: var(--graphite-800);
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}

.recorder-controls {
  display: flex;
  gap: 16px;
  align-items: center;
}
.rec-btn {
  width: 60px; height: 60px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--white);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}
.rec-btn:hover {
  border-color: var(--graphite-300);
  transform: scale(1.06);
  box-shadow: var(--shadow-md);
}
.rec-btn:active { transform: scale(.97); }

.recorder-options {
  width: 100%;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}
.toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: var(--fw-normal);
  color: var(--graphite-500);
  user-select: none;
}
.toggle-input { display: none; }
.toggle-track {
  width: 38px; height: 22px;
  background: var(--graphite-200);
  border-radius: 11px;
  position: relative;
  transition: background var(--transition);
  flex-shrink: 0;
}
.toggle-track::after {
  content: '';
  position: absolute;
  width: 17px; height: 17px;
  background: var(--white);
  border-radius: 50%;
  top: 2.5px; left: 2.5px;
  transition: transform var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
}
.toggle-input:checked + .toggle-track {
  background: var(--blue-500);
}
.toggle-input:checked + .toggle-track::after {
  transform: translateX(16px);
}

.live-transcript {
  width: 100%;
  background: var(--graphite-50);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}
.live-label {
  font-size: 11px;
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--blue-500);
  margin-bottom: 8px;
}
.live-text {
  font-size: 14px;
  font-weight: var(--fw-normal);
  color: var(--graphite-600);
  line-height: 1.7;
  min-height: 48px;
}
.live-text .interim { color: var(--graphite-300); font-style: italic; }

/* ---------- PROGRESS ---------- */
.progress-section {
  margin-top: 36px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  animation: fadeSlideIn .4s ease;
}
.progress-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 28px;
}
.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: .35;
  transition: opacity .4s, transform .4s;
  font-size: 12px;
  font-weight: var(--fw-normal);
  color: var(--graphite-500);
}
.step.active { opacity: 1; }
.step.done { opacity: 1; }
.step-icon {
  width: 40px; height: 40px;
  background: var(--graphite-100);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  transition: all .4s;
}
.step.active .step-icon {
  background: var(--blue-50);
  box-shadow: 0 0 0 4px rgba(59,130,246,.12);
}
.step.done .step-icon {
  background: #ECFDF5;
  box-shadow: 0 0 0 4px rgba(16,185,129,.1);
}
.step-line {
  width: 60px; height: 1.5px;
  background: var(--graphite-200);
  flex-shrink: 0;
}
.progress-bar-wrap {
  height: 6px;
  background: var(--graphite-100);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 12px;
}
.progress-bar {
  height: 100%;
  background: var(--accent-main);
  border-radius: 3px;
  width: 0%;
  transition: width .4s cubic-bezier(.4,0,.2,1);
}
.progress-label {
  text-align: center;
  font-size: 13px;
  color: var(--graphite-400);
  font-weight: var(--fw-normal);
}
.progress-chunk {
  text-align: center;
  font-size: 12px;
  color: var(--graphite-500);
  font-weight: var(--fw-normal);
  margin-top: 4px;
  min-height: 18px;
  letter-spacing: .2px;
}

/* ---------- HISTORY VIEW ---------- */
.history-header {
  margin-bottom: 24px;
}
.history-header h2 {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 400;
  color: var(--graphite-900);
}
.history-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.history-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all var(--transition);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.history-item:hover {
  border-color: var(--graphite-300);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.history-item-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.history-item-title {
  font-weight: 500;
  color: var(--graphite-900);
  font-size: 16px;
}
.history-item-meta {
  font-size: 13px;
  color: var(--graphite-500);
}
.history-item-actions {
  display: flex;
  gap: 8px;
}
.empty-history {
  text-align: center;
  padding: 40px;
  color: var(--graphite-500);
  font-size: 15px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-xl);
}

/* ---------- RESULTS ---------- */
.results {
  margin-top: 36px;
  animation: fadeSlideIn .5s ease;
}
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.results-title {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 400;
  color: var(--graphite-900);
  letter-spacing: -0.5px;
}
.results-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 0;
  gap: 0;
}
.tab {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: var(--fw-normal);
  color: var(--graphite-400);
  background: none;
  border: none;
  cursor: pointer;
  padding: 12px 22px;
  position: relative;
  transition: color var(--transition);
}
.tab::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0; right: 0;
  height: 2px;
  background: var(--accent-main);
  transform: scaleX(0);
  transition: transform var(--transition);
  border-radius: 2px 2px 0 0;
}
.tab.active { color: var(--graphite-900); font-weight: 500; }
.tab.active::after { transform: scaleX(1); }
.tab:hover:not(.active) { color: var(--graphite-600); }

.tab-panel {
  display: none;
  background: var(--white);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  padding: 36px;
  box-shadow: var(--shadow-sm);
}
.tab-panel.active { display: block; animation: fadeIn .3s ease; }

.panel-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.word-count {
  font-size: 12px;
  font-weight: var(--fw-normal);
  color: var(--graphite-300);
  letter-spacing: .3px;
}

.transcription-text {
  font-size: 15px;
  font-weight: var(--fw-normal);
  color: var(--graphite-600);
  line-height: 1.85;
  white-space: pre-wrap;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}
.transcription-text::-webkit-scrollbar { width: 4px; }
.transcription-text::-webkit-scrollbar-track { background: transparent; }
.transcription-text::-webkit-scrollbar-thumb { background: var(--graphite-200); border-radius: 2px; }

/* SUMMARY */
.summary-content {
  font-size: 15px;
  font-weight: var(--fw-normal);
  color: var(--graphite-600);
  line-height: 1.85;
}
.summary-section {
  margin-bottom: 24px;
}
.summary-section-title {
  font-size: 12px;
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--blue-500);
  margin-bottom: 8px;
}
.summary-block {
  background: var(--graphite-50);
  border-radius: var(--radius-md);
  padding: 16px;
  font-size: 14.5px;
  color: var(--graphite-600);
  border: 1px solid var(--border);
}

/* INSIGHTS */
.insights-list { display: flex; flex-direction: column; gap: 12px; }
.insight-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--transition);
  animation: fadeSlideIn .4s ease both;
}
.insight-card:hover {
  border-color: var(--blue-200);
  box-shadow: 0 2px 12px rgba(59,130,246,.08);
  transform: translateY(-1px);
}
.insight-number {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--graphite-100);
  color: var(--graphite-800);
  font-size: 13px;
  font-weight: 500;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.insight-text {
  font-size: 14.5px;
  font-weight: var(--fw-normal);
  color: var(--graphite-600);
  line-height: 1.65;
}

/* ---------- FOOTER ---------- */
.footer {
  text-align: center;
  padding: 24px;
  font-size: 12px;
  font-weight: var(--fw-normal);
  color: var(--graphite-300);
  border-top: 1px solid var(--border);
  background: var(--white);
}

/* ---------- VIEWS ---------- */
.view { display: none; }
.view.active { display: block; animation: fadeSlideIn .3s ease; }

/* ---------- ANIMATIONS ---------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: .3; }
}
@keyframes pulse-ring {
  0%   { transform: scale(1); opacity: .6; }
  100% { transform: scale(1.9); opacity: 0; }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 600px) {
  .main { padding: 32px 16px 60px; }
  .header-inner { padding: 0 16px; }
  .results-header { flex-direction: column; align-items: flex-start; }
  .progress-steps { gap: 4px; }
  .step-line { width: 30px; }
  .tabs { overflow-x: auto; }
  .tab { padding: 12px 16px; font-size: 13px; }
  .recorder-card { padding: 20px 16px; }
  .recorder-timer { font-size: 32px; }
}
