/* ============================================================
   KYT Chat — common.css
   Dark mode default. Light via html.light class.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&family=Roboto+Mono:wght@400;500&display=swap');

/* ── Dark (default) ──────────────────────────────────────────── */
:root {
  --bg:        #121212;
  --surface:   #1e1e1e;
  --surface2:  #2a2a2a;
  --border:    #2e2e2e;
  --border2:   #3e3e3e;

  --primary:   #90caf9;
  --primary-dk:#64b5f6;
  --primary-lt:rgba(144,202,249,0.1);
  --error:     #ef9a9a;
  --warning:   #ffcc80;
  --success:   #a5d6a7;

  --text:      #e0e0e0;
  --text-sec:  #9e9e9e;
  --text-dis:  #4a4a4a;
  --appbar:    #1565c0;

  --mono:      'Roboto Mono', monospace;
  --sans:      'Roboto', sans-serif;
  --radius:    4px;
  --radius-lg: 8px;
  --radius-xl: 18px;
  --shadow-1:  0 2px 6px rgba(0,0,0,0.6);
  --shadow-2:  0 4px 12px rgba(0,0,0,0.7);
}

/* ── Light ───────────────────────────────────────────────────── */
html.light {
  --bg:        #f5f5f5;
  --surface:   #ffffff;
  --surface2:  #f0f4f9;
  --border:    #e0e0e0;
  --border2:   #bdbdbd;

  --primary:   #1976d2;
  --primary-dk:#1565c0;
  --primary-lt:#e3f2fd;
  --error:     #d32f2f;
  --warning:   #f57c00;
  --success:   #388e3c;

  --text:      #212121;
  --text-sec:  #757575;
  --text-dis:  #bdbdbd;
  --appbar:    #1976d2;

  --shadow-1:  0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08);
  --shadow-2:  0 3px 6px rgba(0,0,0,0.10), 0 2px 4px rgba(0,0,0,0.08);
}

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

body {
  background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s, color 0.2s;
}

/* ── App Bar ─────────────────────────────────────────────────── */
header {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; height: 56px;
  background: var(--appbar);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  flex-shrink: 0;
}

.logo { display: flex; align-items: center; gap: 12px; }
.logo-mark {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; color: #fff;
}
.logo-name { font-size: 18px; font-weight: 500; color: #fff; }
.logo-name span { opacity: 0.75; font-weight: 400; }

.theme-btn {
  background: rgba(255,255,255,0.15); border: none; border-radius: 50%;
  width: 34px; height: 34px; cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s; color: #fff; flex-shrink: 0;
}
.theme-btn:hover { background: rgba(255,255,255,0.25); }

/* ── Source type chips ───────────────────────────────────────── */
.card-type {
  font-size: 11px; font-weight: 500;
  padding: 2px 8px; border-radius: 12px; flex-shrink: 0;
}
.t-website  { background: rgba(144,202,249,0.15); color: #90caf9; }
.t-pdf      { background: rgba(239,154,154,0.15); color: #ef9a9a; }
.t-video    { background: rgba(165,214,167,0.15); color: #a5d6a7; }
.t-social   { background: rgba(179,157,219,0.15); color: #b39ddb; }
.t-external { background: rgba(255,204,128,0.15); color: #ffcc80; }

html.light .t-website  { background: #e3f2fd; color: #1565c0; }
html.light .t-pdf      { background: #fce4ec; color: #c62828; }
html.light .t-video    { background: #e8f5e9; color: #2e7d32; }
html.light .t-social   { background: #ede7f6; color: #4527a0; }
html.light .t-external { background: #fff8e1; color: #e65100; }

/* ── Source cards ────────────────────────────────────────────── */
.source-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-1);
}

.card-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.card-label   { font-size: 13px; font-weight: 500; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-body    { padding: 12px 14px; }
.card-summary { font-size: 12px; color: var(--text-sec); line-height: 1.6; margin-bottom: 10px; }

.card-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 500; color: var(--primary);
  text-decoration: none; transition: color 0.15s;
}
.card-link:hover { color: var(--primary-dk); text-decoration: underline; }

/* ── Scrollbars ──────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-sec); }

/* ── Animations ──────────────────────────────────────────────── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes blink  { 0%,100%{opacity:1} 50%{opacity:0.3} }
@keyframes bounce { 0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-4px)} }
