/* ============================================================
   Interview & Speech Transcriber — transcriber.css
   Golden Standard CSS — Teljes összhang a Secure PDF Mergerrel
   ============================================================ */

/* Local Fonts (Zero Tracking) */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('../../fonts/inter-regular.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('../../fonts/inter-500.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('../../fonts/inter-600.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('../../fonts/inter-700.woff2') format('woff2'); }

@font-face { font-family: 'Lora'; font-style: normal; font-weight: 400; font-display: swap; src: url('../../fonts/lora-regular.woff2') format('woff2'); }
@font-face { font-family: 'Lora'; font-style: normal; font-weight: 500; font-display: swap; src: url('../../fonts/lora-500.woff2') format('woff2'); }
@font-face { font-family: 'Lora'; font-style: normal; font-weight: 600; font-display: swap; src: url('../../fonts/lora-600.woff2') format('woff2'); }

/* Theme Variables (Golden Standard) */
:root {
  --font-display: 'Lora', Georgia, serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --color-bg: #f4f6f9;
  --color-surface: #ffffff;
  --color-border: rgba(16,42,67,0.10);
  --color-text: #243b53;
  --color-accent: #2563eb;
  --radius: 0.625rem;
  --tr: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-card: 0 1px 3px rgba(16,42,67,0.06), 0 4px 16px rgba(16,42,67,0.04);
  --shadow-hover: 0 4px 20px rgba(16,42,67,0.10);

  --toast-bg: #243b53;
  --toast-text: #ffffff;
}

[data-theme="dark"] {
  --color-bg: #0f1923;
  --color-surface: #172130;
  --color-border: rgba(255,255,255,0.08);
  --color-text: #a8c4e0;
  --color-accent: #60a5fa;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.20), 0 4px 16px rgba(0,0,0,0.15);
  --shadow-hover: 0 4px 20px rgba(0,0,0,0.25);

  --toast-bg: #a8c4e0;
  --toast-text: #0f1923;
}

/* ── Toolbar / Shared Components ─────────────────────────── */
.toolbar-btn { width: 36px; height: 36px; border-radius: 0.5rem; border: 1px solid var(--color-border); background: var(--color-surface); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background var(--tr), border-color var(--tr); color: var(--color-text); flex-shrink: 0; }
.toolbar-btn:hover { border-color: var(--color-accent); background: rgba(37, 99, 235, 0.06); }
[data-theme="dark"] .toolbar-btn:hover { background: rgba(96, 165, 250, 0.08); }

.select-wrap { position: relative; display: inline-flex; align-items: center; }
.toolbar-select { height: 36px; border-radius: 0.5rem; border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text); padding: 0 2.1rem 0 2.2rem; font-size: 0.8125rem; font-weight: 500; font-family: var(--font-body); appearance: none; cursor: pointer; transition: border-color var(--tr), background var(--tr); width: 130px; }
.toolbar-select:hover, .toolbar-select:focus { border-color: var(--color-accent); outline: none; }
.sel-icon-l, .sel-icon-r { position: absolute; pointer-events: none; opacity: 0.65; color: var(--color-text); }
.sel-icon-l { left: 0.65rem; } .sel-icon-r { right: 0.65rem; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn-primary { background: #243b53; color: #fff; border-radius: var(--radius); font-family: var(--font-body); font-weight: 600; font-size: 0.9375rem; padding: 0.75rem 2rem; border: none; cursor: pointer; transition: background var(--tr), transform var(--tr), box-shadow var(--tr); display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; }
.btn-primary:hover:not(:disabled) { background: #102a43; box-shadow: 0 4px 16px rgba(16,42,67,0.20); }
.btn-primary:active:not(:disabled) { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; background: var(--color-text); }
[data-theme="dark"] .btn-primary { background: #3b6ea5; }
[data-theme="dark"] .btn-primary:hover:not(:disabled) { background: #2d5a8e; }

.btn-secondary { background: transparent; color: var(--color-text); border: 1px solid var(--color-border); border-radius: var(--radius); font-family: var(--font-body); font-weight: 500; font-size: 0.875rem; padding: 0.625rem 1.25rem; cursor: pointer; transition: background var(--tr), border-color var(--tr); display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; }
.btn-secondary:hover:not(:disabled) { background: rgba(37, 99, 235, 0.05); border-color: var(--color-accent); }
.btn-secondary:disabled { opacity: 0.45; cursor: not-allowed; }
[data-theme="dark"] .btn-secondary:hover:not(:disabled) { background: rgba(255,255,255,0.05); }

/* Sárga/figyelmeztető gomb (Új átírás indítása) */
.btn-warning { background: #f59e0b; color: #111827; border-radius: var(--radius); font-family: var(--font-body); font-weight: 700; font-size: 0.9375rem; padding: 0.75rem 2rem; border: none; cursor: pointer; transition: background var(--tr), transform var(--tr), box-shadow var(--tr); display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; }
.btn-warning:hover:not(:disabled) { background: #d97706; box-shadow: 0 4px 16px rgba(245, 158, 11, 0.25); }
.btn-warning:active:not(:disabled) { transform: scale(0.98); }
.btn-warning:disabled { opacity: 0.45; cursor: not-allowed; background: var(--color-text); }
[data-theme="dark"] .btn-warning { background: #fbbf24; color: #111827; }
[data-theme="dark"] .btn-warning:hover:not(:disabled) { background: #f59e0b; }

/* ── Drop Zone ───────────────────────────────────────────── */
.drop-zone { border: 3px dashed #2563eb; border-radius: var(--radius); cursor: pointer; transition: border-color var(--tr), background var(--tr); padding: 4rem 2rem; display: flex; flex-direction: column; align-items: center; gap: 1rem; text-align: center; position: relative; background: var(--color-surface); }
.drop-zone.drag-active { border-color: var(--color-accent); background: rgba(37, 99, 235, 0.08); }
[data-theme="dark"] .drop-zone { border-color: rgba(96, 165, 250, 0.45); border-width: 2px; }
[data-theme="dark"] .drop-zone.drag-active { background: rgba(96, 165, 250, 0.08); border-color: var(--color-accent); }

/* ── Workspace Card ──────────────────────────────────────── */
.workspace { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: var(--shadow-card); display: flex; flex-direction: column; overflow: hidden; }
.workspace-header { padding: 1rem 1.5rem; border-bottom: 1px solid var(--color-border); background: rgba(37, 99, 235, 0.02); }
.workspace-body { padding: 1.5rem; background: var(--color-bg); display: flex; flex-direction: column; }
.workspace-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--color-border); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; background: var(--color-surface); }

/* ── Audio File Info Card ────────────────────────────────── */
.audio-info-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 1.25rem 1.5rem; display: flex; align-items: center; gap: 1rem; box-shadow: 0 2px 8px rgba(0,0,0,0.02); }
.audio-info-icon { width: 44px; height: 44px; border-radius: 50%; background: rgba(37, 99, 235, 0.1); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--color-accent); }
.audio-info-details { flex: 1; min-width: 0; }
.audio-info-name { font-weight: 700; font-size: 0.9375rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--color-text); }
.audio-info-meta { font-size: 0.8125rem; opacity: 0.65; margin-top: 0.2rem; }

/* ── Speaker Config Panel ────────────────────────────────── */
.config-panel { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 1.25rem 1.5rem; box-shadow: 0 2px 8px rgba(0,0,0,0.02); }
.config-panel-title { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; margin-bottom: 1.25rem; color: var(--color-text); display: flex; align-items: center; gap: 0.5rem; }

.speaker-count-control { display: flex; align-items: center; gap: 0.75rem; }
.count-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--color-border); background: var(--color-bg); color: var(--color-text); font-size: 1.1rem; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all var(--tr); flex-shrink: 0; }
.count-btn:hover:not(:disabled) { border-color: var(--color-accent); background: rgba(37, 99, 235, 0.08); color: var(--color-accent); }
.count-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.count-display { font-family: var(--font-mono); font-size: 1.25rem; font-weight: 700; min-width: 2rem; text-align: center; color: var(--color-accent); }
.count-label { font-size: 0.8125rem; opacity: 0.65; }

/* ── Transcript Output Area ──────────────────────────────── */
.transcript-area { 
  background: var(--color-surface); 
  border: 1px solid var(--color-border); 
  border-radius: var(--radius); 
  padding: 1.5rem 2rem; 
  font-size: 0.95rem; 
  line-height: 1.75; 
  max-height: 520px; 
  overflow-y: auto; 
  font-family: var(--font-body); 
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.02);
  scroll-behavior: smooth;
}
[data-theme="dark"] .transcript-area { box-shadow: inset 0 2px 10px rgba(0,0,0,0.2); }

.transcript-segment { margin-bottom: 1.5rem; }
.transcript-segment:last-child { margin-bottom: 0; }

.transcript-speaker-label { 
  font-size: 0.75rem; 
  font-weight: 700; 
  letter-spacing: 0.05em; 
  text-transform: uppercase; 
  margin-bottom: 0.3rem; 
  display: flex; 
  align-items: center; 
  gap: 0.5rem; 
}
.transcript-timestamp { 
  font-family: var(--font-mono); 
  font-size: 0.7rem; 
  font-weight: 600; 
  color: var(--color-text); 
  opacity: 0.45; 
  background: var(--color-bg);
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
}
.transcript-text { color: var(--color-text); opacity: 0.9; }

/* Dynamic Speaker Color Coding */
.speaker-0 .transcript-speaker-label { color: var(--color-accent); }
.speaker-1 .transcript-speaker-label { color: #16a34a; } /* Green */
.speaker-2 .transcript-speaker-label { color: #9333ea; } /* Purple */
.speaker-3 .transcript-speaker-label { color: #ea580c; } /* Orange */
.speaker-4 .transcript-speaker-label { color: #0891b2; } /* Teal */
.speaker-5 .transcript-speaker-label { color: #be123c; } /* Rose */
.speaker-6 .transcript-speaker-label { color: #4d7c0f; } /* Lime */
.speaker-7 .transcript-speaker-label { color: #c2410c; } /* Rust */

[data-theme="dark"] .speaker-1 .transcript-speaker-label { color: #4ade80; } /* Green */
[data-theme="dark"] .speaker-2 .transcript-speaker-label { color: #c084fc; }
[data-theme="dark"] .speaker-3 .transcript-speaker-label { color: #fb923c; }
[data-theme="dark"] .speaker-4 .transcript-speaker-label { color: #22d3ee; }
[data-theme="dark"] .speaker-5 .transcript-speaker-label { color: #fb7185; }
[data-theme="dark"] .speaker-6 .transcript-speaker-label { color: #a3e635; }
[data-theme="dark"] .speaker-7 .transcript-speaker-label { color: #fb923c; }

/* ── Export Buttons Row ──────────────────────────────────── */
.export-btn { background: transparent; color: var(--color-text); border: 1px solid var(--color-border); border-radius: var(--radius); font-family: var(--font-body); font-weight: 600; font-size: 0.875rem; padding: 0.5rem 1.2rem; cursor: pointer; transition: all var(--tr); display: inline-flex; align-items: center; gap: 0.4rem; }
.export-btn:hover { border-color: var(--color-accent); background: rgba(37, 99, 235, 0.06); color: var(--color-accent); }
[data-theme="dark"] .export-btn:hover { background: rgba(96, 165, 250, 0.08); }

/* ── Modals ──────────────────────────────────────────────── */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15,25,35,0.7); backdrop-filter: blur(4px); z-index: 100; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.3s ease, visibility 0.3s ease; }
.modal-overlay.active { opacity: 1; visibility: visible; pointer-events: auto; }
.modal-box { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: var(--shadow-hover); display: flex; flex-direction: column; transform: translateY(20px); transition: transform 0.3s ease; }
.modal-overlay.active .modal-box { transform: translateY(0); }
.modal-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--color-border); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-family: var(--font-display); font-size: 1.125rem; font-weight: 700; display: flex; align-items: center; gap: 0.5rem; color: var(--color-accent); }
.modal-close { background: transparent; border: none; color: var(--color-text); opacity: 0.5; cursor: pointer; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 0.375rem; transition: background 0.2s; }
.modal-close:hover { background: rgba(16, 42, 67, 0.05); opacity: 1; }
[data-theme="dark"] .modal-close:hover { background: rgba(255,255,255,0.05); }
.modal-body { padding: 1.5rem; overflow-y: auto; font-size: 0.9375rem; line-height: 1.6; opacity: 0.9; }

/* ── Credit / Token Input ────────────────────────────────── */
.credit-input { width: 100%; padding: 0.75rem 1rem; border-radius: 0.5rem; border: 1px solid var(--color-border); background: var(--color-bg); color: var(--color-text); font-family: var(--font-mono); font-size: 0.875rem; outline: none; transition: border-color 0.2s; letter-spacing: 0.5px; font-weight: 600; }
.credit-input:focus { border-color: var(--color-accent); box-shadow: 0 0 0 2px rgba(37,99,235,0.1); }

/* ── Toast ───────────────────────────────────────────────── */
.toast-hidden { position: fixed; bottom: 2rem; right: 2rem; transform: translateY(100px); background: var(--toast-bg); color: var(--toast-text); padding: 0.75rem 1.5rem; border-radius: 0.5rem; font-size: 0.875rem; font-weight: 600; box-shadow: 0 10px 25px rgba(0,0,0,0.2); opacity: 0; transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); z-index: 9999; display: flex; align-items: center; gap: 0.5rem; pointer-events: none; }
.toast-hidden.show { transform: translateY(0); opacity: 1; }

/* ── Progress bar ────────────────────────────────────────── */
.progress-fill { width: 0%; transition: width 0.6s ease; }

/* ── Animations ──────────────────────────────────────────── */
.fade-up { animation: fadeUp 0.4s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.animate-spin { animation: spin 1s linear infinite; }
@keyframes spin { 100% { transform: rotate(360deg); } }

/* ── Waveform animation (upload state visual) ────────────── */
.waveform { display: flex; align-items: center; justify-content: center; gap: 4px; height: 36px; }
.waveform-bar { width: 4px; border-radius: 2px; background: var(--color-accent); animation: wave 1.2s ease-in-out infinite; }
.waveform-bar:nth-child(1) { animation-delay: 0.0s; height: 60%; }
.waveform-bar:nth-child(2) { animation-delay: 0.1s; height: 100%; }
.waveform-bar:nth-child(3) { animation-delay: 0.2s; height: 75%; }
.waveform-bar:nth-child(4) { animation-delay: 0.3s; height: 50%; }
.waveform-bar:nth-child(5) { animation-delay: 0.4s; height: 85%; }
.waveform-bar:nth-child(6) { animation-delay: 0.2s; height: 65%; }
.waveform-bar:nth-child(7) { animation-delay: 0.1s; height: 40%; }
@keyframes wave { 0%, 100% { transform: scaleY(0.5); opacity: 0.6; } 50% { transform: scaleY(1); opacity: 1; } }

/* ── Polling / Status Indicator ─────────────────────────── */
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-accent); animation: pulse-dot 1.6s ease-in-out infinite; display: inline-block; flex-shrink: 0; }
@keyframes pulse-dot { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.75); } }

/* ── Deletion confirmation badge ─────────────────────────── */
.deletion-badge { display: inline-flex; align-items: center; gap: 0.5rem; background: rgba(37, 99, 235, 0.1); border: 1px solid rgba(37, 99, 235, 0.3); border-radius: 99px; padding: 0.35rem 1rem; font-size: 0.75rem; font-weight: 700; color: var(--color-accent); }
.deletion-badge.error { background: rgba(220, 38, 38, 0.08); border-color: rgba(220, 38, 38, 0.25); color: #dc2626; }
[data-theme="dark"] .deletion-badge.error { color: #f87171; }
