/* ================================================================
   Meeting Summarizer – TH Lübeck Theme
   Colors:  Primary Red  #c1002a
            Dark Red      #9a0022
            White         #ffffff
            Light Gray    #f5f5f5
   ================================================================ */

/* ── Reset & Base ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #f5f5f5;
  color: #222;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ──────────────────────────────────────────────────── */
header {
  background: #c1002a;
  color: #fff;
  padding: 0 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  position: sticky;
  top: 0;
  z-index: 200;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
  height: 64px;
}
.logo {
  height: 38px;
  width: auto;
  flex-shrink: 0;
}
header h1 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: .02em;
}

/* ── Sidebar Toggle (Hamburger) ──────────────────────────────── */
.sidebar-toggle {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background .2s;
  line-height: 1;
  flex-shrink: 0;
}
.sidebar-toggle:hover { background: rgba(255,255,255,.15); }

/* ── App Layout ──────────────────────────────────────────────── */
.app-layout {
  display: flex;
  flex: 1;
  position: relative;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 64px;
  left: 0;
  bottom: 0;
  width: 360px;
  background: #fff;
  box-shadow: 3px 0 12px rgba(0,0,0,.1);
  z-index: 150;
  transform: translateX(-100%);
  transition: transform .3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sidebar.open {
  transform: translateX(0);
}
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e8e8e8;
  flex-shrink: 0;
}
.sidebar-header h2 {
  font-size: 1.05rem;
  color: #c1002a;
  margin: 0;
}
.sidebar-close {
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: #888;
  padding: 0 4px;
  line-height: 1;
  transition: color .2s;
}
.sidebar-close:hover { color: #c1002a; }

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.sidebar-divider {
  border: none;
  border-top: 1px solid #e8e8e8;
  margin: 4px 0;
}

/* Sidebar overlay (dims main area when sidebar is open on mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  top: 64px;
  background: rgba(0,0,0,.35);
  z-index: 140;
  cursor: pointer;
}
.sidebar-overlay.active { display: block; }

/* ── Field Hint ──────────────────────────────────────────────── */
.field-hint {
  font-size: .8rem;
  color: #888;
  margin-bottom: 4px;
  line-height: 1.4;
}

/* ── Small Button ────────────────────────────────────────────── */
.btn-sm {
  padding: 6px 12px;
  font-size: .8rem;
  margin-top: 6px;
}

/* ── Main ────────────────────────────────────────────────────── */
main {
  max-width: 960px;
  width: 100%;
  margin: 24px auto;
  padding: 0 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Card ────────────────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.card h2 {
  font-size: 1.1rem;
  margin-bottom: 16px;
  color: #c1002a;
}

/* ── Form Fields ─────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 4px; }
.field.field-row { flex-direction: row; align-items: center; gap: 8px; }
.field.field-row input[type="checkbox"] { width: auto; accent-color: #c1002a; }
.field label { font-size: .85rem; font-weight: 600; color: #555; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: .95rem;
  font-family: inherit;
  transition: border-color .2s;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #c1002a;
  box-shadow: 0 0 0 3px rgba(193,0,42,.12);
}
textarea { resize: vertical; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  font-size: .9rem;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background .2s, transform .1s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary { background: #c1002a; color: #fff; }
.btn-primary:hover:not(:disabled) { background: #9a0022; }

.btn-danger { background: #555; color: #fff; }
.btn-danger:hover:not(:disabled) { background: #333; }

.btn-secondary { background: #e8e8e8; color: #333; }
.btn-secondary:hover:not(:disabled) { background: #d5d5d5; }

/* ── Controls Row ────────────────────────────────────────────── */
.controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.timer {
  font-variant-numeric: tabular-nums;
  font-size: 1.3rem;
  font-weight: 700;
  color: #c1002a;
  min-width: 60px;
}
.badge {
  font-size: .8rem;
  padding: 4px 12px;
  border-radius: 999px;
  background: #e8e8e8;
  color: #555;
  font-weight: 600;
}
.badge.recording { background: #c1002a; color: #fff; animation: pulse 1.2s infinite; }
.badge.processing { background: #f0ad4e; color: #fff; }
.badge.done { background: #5cb85c; color: #fff; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .6; }
}

/* ── Progress Bar ────────────────────────────────────────────── */
.progress-row {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.progress-bar {
  flex: 1;
  height: 6px;
  background: #e8e8e8;
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: #c1002a;
  border-radius: 3px;
  transition: width .3s linear;
}
.small-label { font-size: .8rem; color: #888; white-space: nowrap; }

/* ── Fact-Check Panel ─────────────────────────────────────────── */
.fact-panel {
  display: none;
  position: fixed;
  top: 64px;
  right: 0;
  bottom: 0;
  width: 340px;
  background: #fff;
  box-shadow: -3px 0 12px rgba(0,0,0,.1);
  z-index: 150;
  flex-direction: column;
  overflow: hidden;
}
.fact-panel.visible { display: flex; }
.fact-panel-header {
  padding: 14px 16px 10px;
  border-bottom: 2px solid #e8e8e8;
  background: #fafafa;
  flex-shrink: 0;
}
.fact-panel-title {
  display: block;
  font-weight: 700;
  font-size: .95rem;
  color: #333;
  margin-bottom: 4px;
}
.fact-panel-hint {
  display: block;
  font-size: .72rem;
  color: #e07000;
}
.fact-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* Accordion card */
.fact-card {
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  overflow: hidden;
}
.fact-card-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #f5f5f5;
  border: none;
  cursor: pointer;
  font-size: .8rem;
  font-weight: 600;
  color: #444;
  text-align: left;
}
.fact-card-toggle:hover { background: #ececec; }
.fact-card-chevron { font-size: .7rem; color: #888; }
.fact-card-body {
  display: none;
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 8px;
}
.fact-card.expanded .fact-card-body { display: flex; }
/* Individual fact items */
.fact-item {
  border-radius: 5px;
  padding: 8px 10px;
  font-size: .82rem;
  border-left: 4px solid #ccc;
  background: #fafafa;
}
.fact-confirmed { border-left-color: #4caf50; background: #f6fff6; }
.fact-doubtful  { border-left-color: #e53935; background: #fff6f6; }
.fact-uncertain { border-left-color: #f5a623; background: #fffbf2; }
.fact-item-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.fact-verdict-label { font-weight: 700; font-size: .78rem; }
.fact-confirmed .fact-verdict-label { color: #2e7d32; }
.fact-doubtful  .fact-verdict-label { color: #c62828; }
.fact-uncertain .fact-verdict-label { color: #c17000; }
.fact-confidence {
  margin-left: auto;
  font-size: .75rem;
  color: #888;
  font-variant-numeric: tabular-nums;
}
.fact-claim {
  font-style: italic;
  color: #444;
  margin-bottom: 3px;
  line-height: 1.4;
}
.fact-explanation {
  color: #666;
  line-height: 1.4;
}
.fact-sources {
  margin-top: 6px;
  font-size: .75rem;
}
.fact-sources a {
  color: #0b5cad;
  text-decoration: none;
}
.fact-sources a:hover { text-decoration: underline; }

/* ── Internet warning overlay ─────────────────────────────────── */
.warning-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.warning-overlay.visible { display: flex; }
.warning-modal {
  width: min(560px, 96vw);
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  padding: 18px 18px 14px;
}
.warning-modal h3 {
  margin-bottom: 10px;
  color: #b00020;
}
.warning-modal p {
  color: #444;
  line-height: 1.5;
  margin-bottom: 8px;
}
.warning-small {
  font-size: .85rem;
  color: #777;
}
.warning-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

/* ── Current Topic Banner ────────────────────────────────────── */
.current-topic-card {
  border-left: 5px solid #f5a623;
  background: #fffbf2;
}
.current-topic-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.current-topic-icon {
  font-size: 1.4rem;
  line-height: 1;
}
.current-topic-label {
  font-size: 1rem;
  font-weight: 700;
  color: #c17000;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.current-topic-display {
  font-size: 1.05rem;
  color: #333;
  line-height: 1.6;
}
.current-topic-display p { margin: 0; }

/* ── Summary ─────────────────────────────────────────────────── */
.summary-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.summary-display {
  background: #fafafa;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  padding: 16px;
  min-height: 120px;
  line-height: 1.6;
}
.summary-display h2, .summary-display h3 { color: #c1002a; margin-top: 12px; }
.summary-display ul, .summary-display ol { padding-left: 24px; }
.summary-display li { margin-bottom: 4px; }
.summary-edit {
  width: 100%;
  min-height: 200px;
  font-family: 'Consolas', 'Fira Code', monospace;
  font-size: .9rem;
}
.placeholder-text { color: #aaa; font-style: italic; }

/* ── Recipients ──────────────────────────────────────────────── */
.recipient-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.recipient-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f0e0e3;
  color: #9a0022;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 500;
}
.recipient-chip button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: #9a0022;
  line-height: 1;
}
.recipient-add {
  display: flex;
  gap: 8px;
}
.recipient-add input { flex: 1; }
.email-status {
  margin-top: 10px;
  font-size: .9rem;
}
.email-status.success { color: #5cb85c; }
.email-status.error { color: #c1002a; }

/* ── Disclaimer Bar ─────────────────────────────────────────── */
.disclaimer-bar {
  background: #fff8e1;
  border-top: 2px solid #ffe082;
  padding: 14px 24px;
  width: 100%;
}
.disclaimer-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: .85rem;
  color: #555;
  line-height: 1.5;
}
.disclaimer-inner p { margin: 0; }
.disclaimer-inner strong { color: #333; }

/* ── Footer ──────────────────────────────────────────────────── */
.btn-link {
  background: none;
  border: none;
  color: #aaa;
  cursor: pointer;
  font-size: inherit;
  padding: 0;
  text-decoration: underline;
}
.btn-link:hover {
  color: #fff;
}

footer {
  text-align: center;
  padding: 16px;
  font-size: .8rem;
  color: #999;
  border-top: 1px solid #e8e8e8;
  background: #fff;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 600px) {
  .header-inner { height: 56px; }
  .logo { height: 30px; }
  header h1 { font-size: 1rem; }
  main { padding: 0 8px; }
  .card { padding: 16px; }
  .sidebar { width: 100%; }
}
