/* Transcript CR - CLS Digital - Light professional blue theme */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", Calibri, -apple-system, sans-serif;
  background: #f1f5f9;
  color: #1e293b;
  min-height: 100vh;
}

/* --- Header --- */
.header {
  background: linear-gradient(135deg, #1e3a5f, #2563eb);
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
}
.header-left { display: flex; align-items: center; gap: 16px; }
.header-left img { height: 36px; }
.header-left h1 { font-size: 20px; font-weight: 600; }
.header-right { display: flex; align-items: center; gap: 16px; font-size: 13px; }
.header-right a {
  color: rgba(255,255,255,.85);
  text-decoration: none;
  font-size: 13px;
  transition: color .15s;
}
.header-right a:hover { color: #fff; }
.user-name { opacity: .85; }

/* --- Card container --- */
.card {
  background: #fff;
  max-width: 640px;
  width: 100%;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
  overflow: hidden;
  margin: 32px auto;
}

.card-head {
  background: linear-gradient(135deg, #1e3a5f, #2563eb);
  padding: 28px 32px;
  color: #fff;
}
.card-head h2 { font-size: 22px; font-weight: 600; }
.card-head p { opacity: .8; font-size: 14px; margin-top: 6px; }

.card-body { padding: 24px 32px; }

/* --- Form fields --- */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 4px;
}
.field label.req::after { content: " *"; color: #ef4444; }
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color .15s;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.field textarea { min-height: 80px; resize: vertical; }
.field input[type="file"] { padding: 8px; background: #f8fafc; }

.row { display: flex; gap: 12px; }
.row .field { flex: 1; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.btn:active { transform: scale(.98); }
.btn-primary {
  width: 100%;
  background: #2563eb;
  color: #fff;
  margin-top: 8px;
}
.btn-primary:hover { background: #1d4ed8; }
.btn-primary:disabled { background: #94a3b8; cursor: wait; }
.btn-send { background: #2563eb; color: #fff; }
.btn-send:hover { background: #1d4ed8; }
.btn-send:disabled { background: #94a3b8; cursor: wait; }

/* --- Spinner --- */
.spinner {
  display: none;
  text-align: center;
  padding: 40px 20px;
}
.spinner.active { display: block; }
.spinner-dots { display: flex; justify-content: center; gap: 8px; }
.spinner-dots .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2563eb;
  animation: bounce .6s ease-in-out infinite;
}
.spinner-dots .dot:nth-child(2) { animation-delay: .15s; }
.spinner-dots .dot:nth-child(3) { animation-delay: .3s; }
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
.spinner p { margin-top: 16px; color: #475569; font-size: 15px; }
.spinner .sub { color: #94a3b8; font-size: 13px; margin-top: 4px; }

/* --- Note --- */
.note {
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
  padding: 12px 0 20px;
}

/* --- Audio Recorder --- */
.recorder {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  margin-top: 8px;
}
.recorder-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rec-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: background .15s;
}
.rec-btn-start { background: #ef4444; color: #fff; }
.rec-btn-start:hover { background: #dc2626; }
.rec-btn-stop { background: #6b7280; color: #fff; }
.rec-btn-stop:hover { background: #4b5563; }
.rec-timer { font-size: 15px; font-weight: 600; color: #374151; font-variant-numeric: tabular-nums; }
.rec-status { font-size: 13px; color: #94a3b8; }
.rec-preview { margin-top: 12px; }
.rec-preview audio { width: 100%; border-radius: 8px; }
.separator {
  text-align: center;
  font-size: 13px;
  color: #94a3b8;
  margin: 12px 0;
  position: relative;
}
.separator::before,
.separator::after {
  content: "";
  position: absolute;
  top: 50%;
  width: calc(50% - 30px);
  height: 1px;
  background: #e2e8f0;
}
.separator::before { left: 0; }
.separator::after { right: 0; }

/* ======= Preview Page ======= */
.preview-container {
  max-width: 900px;
  margin: 20px auto 40px;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
}
.preview-head {
  background: linear-gradient(135deg, #1e3a5f, #2563eb);
  padding: 24px 32px;
  color: #fff;
}
.preview-head h1 { font-size: 22px; }
.preview-head p { opacity: .85; font-size: 14px; margin-top: 4px; }

.stats-bar {
  background: #eff6ff;
  border-left: 4px solid #3b82f6;
  padding: 10px 16px;
  margin: 16px 24px;
  border-radius: 0 8px 8px 0;
  font-size: 13px;
  color: #475569;
}

.tabs { display: flex; border-bottom: 2px solid #e2e8f0; margin: 0 24px; }
.tab {
  padding: 10px 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: inherit;
}
.tab.active { color: #2563eb; border-bottom-color: #2563eb; }

.panel { display: none; padding: 20px 24px; }
.panel.active { display: block; }

#preview-content { line-height: 1.6; font-size: 14px; }
#preview-content h2 {
  color: #0f172a;
  font-size: 17px;
  border-bottom: 2px solid #3b82f6;
  padding-bottom: 4px;
  margin: 20px 0 10px;
}
#preview-content h3 {
  color: #1e40af;
  font-size: 15px;
  margin: 16px 0 8px;
}
#preview-content ul { padding-left: 20px; margin: 8px 0; }
#preview-content li { margin: 3px 0; font-size: 14px; }
#preview-content table { width: 100%; border-collapse: collapse; margin: 12px 0; }
#preview-content td, #preview-content th {
  border: 1px solid #d1d5db;
  padding: 6px 10px;
  font-size: 13px;
}
#preview-content strong { font-weight: 600; }

#editor-area {
  width: 100%;
  min-height: 500px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  padding: 16px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  line-height: 1.6;
  resize: vertical;
}
.editor-hint {
  margin-top: 8px;
  font-size: 12px;
  color: #94a3b8;
}

/* --- Send bar --- */
.send-bar {
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  padding: 16px 24px;
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}
.send-bar label {
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  display: block;
  margin-bottom: 4px;
}
.send-bar input {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  width: 100%;
  font-family: inherit;
}
.send-bar input:focus {
  outline: none;
  border-color: #2563eb;
}
.send-bar .fld { flex: 1; min-width: 200px; }

/* --- Success message --- */
.success-msg {
  display: none;
  text-align: center;
  padding: 40px;
}
.success-msg.active { display: block; }
.success-msg .check { font-size: 48px; margin-bottom: 12px; }
.success-msg .msg { color: #16a34a; font-size: 18px; font-weight: 600; }
.success-msg .details { font-size: 14px; color: #64748b; margin-top: 8px; }

/* --- Responsive --- */
@media (max-width: 640px) {
  .header { padding: 14px 16px; }
  .header-left h1 { font-size: 16px; }
  .card-body, .preview-head, .send-bar, .panel { padding-left: 16px; padding-right: 16px; }
  .row { flex-direction: column; gap: 0; }
  .send-bar { flex-direction: column; }
  .send-bar .fld { min-width: 100%; }
}
