/* ===================================
   MeetingMind — Dark Editorial Style
   =================================== */

:root {
  --bg: #0a0a0b;
  --bg-2: #111113;
  --bg-3: #1a1a1e;
  --surface: #16161a;
  --surface-2: #1e1e24;
  --border: #2a2a32;
  --border-2: #3a3a45;
  --text: #f0f0f5;
  --text-2: #9090a0;
  --text-3: #606070;
  --accent: #e8ff5a;
  --accent-dim: rgba(232, 255, 90, 0.12);
  --accent-glow: rgba(232, 255, 90, 0.25);
  --red: #ff4d6d;
  --red-dim: rgba(255, 77, 109, 0.15);
  --blue: #5a9fff;
  --green: #4dffb4;
  --font-sans: 'Noto Sans KR', sans-serif;
  --font-mono: 'DM Mono', monospace;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.6);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Noise texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

#app { position: relative; z-index: 1; }

/* ===== NAV ===== */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,10,11,0.85);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.8); }
}

.nav-actions { display: flex; gap: 8px; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-2);
  padding: 8px 16px;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-ghost:hover {
  border-color: var(--border-2);
  color: var(--text);
  background: var(--surface);
}

/* ===== VIEWS ===== */
.view { display: none; animation: fadeIn 0.3s ease; }
.view.active { display: block; }

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

/* ===== HERO ===== */
.hero {
  text-align: center;
  padding: 72px 40px 40px;
  max-width: 720px;
  margin: 0 auto;
}

.hero-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 20px;
  display: inline-block;
  padding: 4px 12px;
  border: 1px solid var(--accent-dim);
  border-radius: 100px;
  background: var(--accent-dim);
}

.hero-title {
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.hero-title em {
  font-style: normal;
  color: var(--accent);
  position: relative;
}

.hero-sub {
  color: var(--text-2);
  font-size: 16px;
  max-width: 480px;
  margin: 0 auto;
}

/* ===== RECORDER SECTION ===== */
.recorder-section {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.recorder-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

/* Meta row */
.recorder-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 24px 28px 0;
  gap: 16px;
}

.meta-left { flex: 1; display: flex; flex-direction: column; gap: 8px; }

.title-input, .attendees-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-sans);
  padding: 6px 0;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.title-input {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.title-input::placeholder, .attendees-input::placeholder { color: var(--text-3); }
.title-input:focus, .attendees-input:focus { border-bottom-color: var(--accent); }

.date-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
  padding-top: 4px;
}

/* Waveform */
.recorder-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 36px 28px;
}

.waveform-container {
  width: 100%;
  height: 100px;
  border-radius: 12px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}

.waveform {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.waveform-idle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.idle-icon { font-size: 28px; opacity: 0.4; }
.idle-text { font-size: 12px; color: var(--text-3); font-family: var(--font-mono); }

/* Canvas waveform bars */
#waveform-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.timer-display {
  font-family: var(--font-mono);
  font-size: 48px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--text);
  line-height: 1;
}

.timer-display.recording { color: var(--red); }

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

.btn-record {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: #0a0a0b;
  border: none;
  padding: 14px 32px;
  border-radius: 100px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 0 24px var(--accent-glow);
}

.btn-record:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 32px var(--accent-glow);
}

.btn-record.recording {
  background: var(--red);
  box-shadow: 0 0 24px rgba(255,77,109,0.3);
  animation: recording-pulse 1.5s ease-in-out infinite;
}

@keyframes recording-pulse {
  0%, 100% { box-shadow: 0 0 24px rgba(255,77,109,0.3); }
  50% { box-shadow: 0 0 40px rgba(255,77,109,0.6); }
}

.record-icon {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #0a0a0b;
  transition: all 0.3s;
}

.btn-record.recording .record-icon {
  background: white;
  border-radius: 2px;
}

.btn-stop {
  background: transparent;
  border: 1px solid var(--border-2);
  color: var(--text-2);
  padding: 14px 24px;
  border-radius: 100px;
  font-family: var(--font-sans);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-stop:hover { border-color: var(--red); color: var(--red); }

.hidden { display: none !important; }

/* Live transcript */
.live-transcript {
  border-top: 1px solid var(--border);
  padding: 20px 28px;
  background: var(--bg-2);
  max-height: 200px;
  overflow-y: auto;
}

.transcript-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-3);
  font-family: var(--font-mono);
  margin-bottom: 12px;
}

.live-badge {
  color: var(--red);
  animation: blink 1s ease-in-out infinite;
}

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

.transcript-body {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.7;
  font-style: italic;
}

/* Processing overlay */
.processing-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,10,11,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(8px);
}

.processing-card {
  text-align: center;
  padding: 48px;
}

.processing-spinner {
  width: 56px; height: 56px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto 24px;
  animation: spin 0.8s linear infinite;
}

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

.processing-title {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 24px;
}

.processing-steps { display: flex; flex-direction: column; gap: 10px; }

.step {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-3);
  transition: color 0.4s;
}
.step.active { color: var(--accent); }
.step.done { color: var(--green); }

/* ===== HISTORY VIEW ===== */
.history-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 24px;
}

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

.section-header h2 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.search-bar input {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
  width: 260px;
  transition: border-color 0.2s;
}
.search-bar input:focus { border-color: var(--accent); }

.meetings-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.meeting-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  cursor: pointer;
  transition: all 0.2s;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
}

.meeting-item:hover {
  border-color: var(--border-2);
  background: var(--surface-2);
  transform: translateX(4px);
}

.meeting-item-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.meeting-item-meta {
  font-size: 13px;
  color: var(--text-3);
  font-family: var(--font-mono);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.meeting-item-preview {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.meeting-item-date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
  text-align: right;
}

.meeting-item-duration {
  font-size: 12px;
  color: var(--accent);
  font-family: var(--font-mono);
}

.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-3);
}

.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-text { font-size: 18px; font-weight: 500; margin-bottom: 8px; color: var(--text-2); }
.empty-sub { font-size: 14px; }

/* Date group */
.date-group-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--text-3);
  text-transform: uppercase;
  padding: 8px 0 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

/* ===== DETAIL VIEW ===== */
.detail-section {
  max-width: 820px;
  margin: 0 auto;
  padding: 48px 24px;
}

.btn-back {
  background: transparent;
  border: none;
  color: var(--text-2);
  font-family: var(--font-sans);
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 24px;
  padding: 0;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}
.btn-back:hover { color: var(--accent); }

.detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.detail-header {
  padding: 32px 36px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
}

.detail-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.detail-meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
}

.detail-meta span { display: flex; align-items: center; gap: 4px; }

.detail-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.btn-action {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-2);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-sans);
}
.btn-action:hover { border-color: var(--accent); color: var(--accent); }

.detail-body { padding: 32px 36px; }

.detail-section-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 16px;
  margin-top: 32px;
}

.detail-section-title:first-child { margin-top: 0; }

.summary-block {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 20px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-2);
}

.action-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.action-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-3);
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-2);
}

.action-item::before {
  content: '→';
  color: var(--green);
  font-family: var(--font-mono);
  flex-shrink: 0;
  margin-top: 1px;
}

.transcript-full {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  font-size: 13px;
  line-height: 1.9;
  color: var(--text-2);
  max-height: 400px;
  overflow-y: auto;
  font-family: var(--font-mono);
  white-space: pre-wrap;
}

/* ===== SETTINGS ===== */
.settings-section {
  max-width: 600px;
  margin: 0 auto;
  padding: 48px 24px;
}

.settings-section h2 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 28px;
}

.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.setting-group { display: flex; flex-direction: column; gap: 8px; }

.setting-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.02em;
}

.setting-input {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}
.setting-input:focus { border-color: var(--accent); }

.setting-hint {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.5;
}

.share-code-wrapper { display: flex; gap: 8px; }

.btn-generate {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-2);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  font-family: var(--font-sans);
}
.btn-generate:hover { border-color: var(--accent); color: var(--accent); }

.btn-save-settings {
  background: var(--accent);
  border: none;
  color: #0a0a0b;
  padding: 14px 24px;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-save-settings:hover { opacity: 0.9; transform: translateY(-1px); }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  color: var(--text);
  padding: 12px 24px;
  border-radius: 100px;
  font-size: 14px;
  z-index: 9999;
  box-shadow: var(--shadow);
  animation: toastIn 0.3s ease;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .nav { padding: 16px 20px; }
  .hero { padding: 48px 20px 28px; }
  .recorder-section { padding: 0 16px 60px; }
  .recorder-meta { flex-direction: column; padding: 20px 20px 0; }
  .recorder-center { padding: 28px 20px; }
  .detail-header, .detail-body { padding: 24px 20px; }
  .detail-title { font-size: 22px; }
  .section-header { flex-direction: column; align-items: flex-start; }
  .search-bar input { width: 100%; }
}

/* ===== V2 ADDITIONS ===== */
.auth-warning {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--red-dim);
  border: 1px solid var(--red);
  border-radius: 10px;
  padding: 14px 20px;
  margin-top: 16px;
  font-size: 14px;
  color: var(--red);
  gap: 12px;
}
.auth-warning button {
  background: transparent;
  border: 1px solid var(--red);
  color: var(--red);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.auth-warning button:hover { background: var(--red); color: white; }

.required {
  color: var(--red);
  font-size: 11px;
  font-weight: 400;
  margin-left: 4px;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 4px 0;
}

.info-box {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
}
.info-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-2);
}
.info-box ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.info-box li {
  font-size: 13px;
  color: var(--text-3);
  padding-left: 16px;
  position: relative;
}
.info-box li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--green);
  font-size: 11px;
}

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px;
  color: var(--text-3);
  font-size: 14px;
}

.loading-spinner-sm {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.btn-new {
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  color: var(--accent);
}
