/* ============================================================
   LUMOS — Theme Variables
   Dark theme (default) + Light theme
   ============================================================ */

:root,
[data-theme="dark"] {
  /* Backgrounds */
  --bg-primary:    #1e1e1e;   /* área de conteúdo */
  --bg-secondary:  #000000;   /* sidebar + header (mais escuro) */
  --surface:       #3b3b3bcc;   /* cards */
  --surface-2:     #333333;
  --surface-hover: #3b3b3b;

  /* Borders */
  --border:        #3a3a3a;
  --border-light:  #484848;

  /* Brand / Accent */
  --primary:       #c8cdd5;
  --primary-dark:  #9ba4b0;
  --primary-dim:   #717a86;
  --primary-glow:  rgba(200, 205, 213, 0.18);
  --primary-soft:  rgba(200, 205, 213, 0.09);

  /* Text */
  --text-primary:   #f0f0f0;
  --text-secondary: #a0a0a0;
  --text-muted:     #6a6a6a;
  --text-inverse:   #0f172a;

  /* Status */
  --danger:        #ef4444;
  --danger-soft:   rgba(239, 68, 68, 0.12);
  --warning:       #f59e0b;
  --warning-soft:  rgba(245, 158, 11, 0.12);
  --success:       #4ade80;
  --success-soft:  rgba(74, 222, 128, 0.12);
  --info:          #38bdf8;
  --info-soft:     rgba(56, 189, 248, 0.12);

  /* Shadows */
  --shadow-sm:  0 2px 8px rgba(0,0,0,.4);
  --shadow-md:  0 4px 20px rgba(0,0,0,.5);
  --shadow-lg:  0 12px 40px rgba(0,0,0,.6);
  --shadow-xl:  0 24px 64px rgba(0,0,0,.65);
  --shadow-glow: 0 0 24px rgba(200, 205, 213, 0.12);

  /* Layout */
  --sidebar-w:  65px;
  --header-h:   64px;
  --radius-sm:  10px;
  --radius-md:  14px;
  --radius-lg:  18px;
  --radius-xl:  24px;

  /* Animation */
  --ease-out:    cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --transition: .2s var(--ease-out);
  --transition-slow: .4s var(--ease-out);

  /* Brand (lâmpada) + refinamentos */
  --brand-gold:      #f5d56a;
  --brand-gold-soft: rgba(245, 213, 106, 0.12);
  --border-subtle:   rgba(255, 255, 255, 0.07);
  --highlight:       inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --ring:            0 0 0 3px rgba(200, 205, 213, 0.30);
  --glass:           rgba(38, 38, 42, 0.72);
  --btn-primary-bg:  linear-gradient(180deg, #e3e6eb 0%, #c3c9d2 100%);
  --btn-primary-bg-hover: linear-gradient(180deg, #eef0f3 0%, #ced3db 100%);

  /* Subject colors */
  --c1: #60a5fa; --c2: #38bdf8; --c3: #fb923c;
  --c4: #f472b6; --c5: #a78bfa; --c6: #facc15; --c7: #34d399;
}

[data-theme="light"] {
  color-scheme: light;
  --bg-primary:    #e9ecf1;
  --bg-secondary:  #d3d8e0;   /* sidebar + header (prata, um tom abaixo do conteúdo) */
  --surface:       #f8f9fb;
  --surface-2:     #eef1f5;
  --surface-hover: #e4e8ee;

  --border:        #d6dbe3;
  --border-light:  #c3cad5;

  --primary:       #64748b;
  --primary-dark:  #475569;
  --primary-dim:   #334155;
  --primary-glow:  rgba(100, 116, 139, 0.14);
  --primary-soft:  rgba(100, 116, 139, 0.07);

  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-muted:     #6b7789;
  --text-inverse:   #f8fafc;

  --danger:       #dc2626;
  --danger-soft:  rgba(220, 38, 38, 0.09);
  --warning:      #b45309;
  --warning-soft: rgba(217, 119, 6, 0.10);
  --success:      #16a34a;
  --success-soft: rgba(34, 197, 94, 0.10);
  --info:         #0284c7;
  --info-soft:    rgba(2, 132, 199, 0.09);

  --shadow-sm:  0 1px 2px rgba(15,23,42,.06), 0 1px 4px rgba(15,23,42,.05);
  --shadow-md:  0 2px 6px rgba(15,23,42,.05), 0 8px 24px rgba(15,23,42,.08);
  --shadow-lg:  0 4px 12px rgba(15,23,42,.06), 0 16px 40px rgba(15,23,42,.12);
  --shadow-xl:  0 8px 20px rgba(15,23,42,.08), 0 28px 64px rgba(15,23,42,.16);
  --shadow-glow: 0 0 24px rgba(100, 116, 139, 0.10);

  --brand-gold:      #d4a72c;
  --brand-gold-soft: rgba(212, 167, 44, 0.12);
  --border-subtle:   rgba(15, 23, 42, 0.08);
  --highlight:       inset 0 1px 0 rgba(255, 255, 255, 0.7);
  --ring:            0 0 0 3px rgba(100, 116, 139, 0.28);
  --glass:           rgba(250, 251, 252, 0.82);
  --btn-primary-bg:  linear-gradient(180deg, #73839a 0%, #56657a 100%);
  --btn-primary-bg-hover: linear-gradient(180deg, #7f8ea4 0%, #5f6e84 100%);
}

[data-theme="light"] .card-title {
  color: #0f172a;
}

html[data-theme="dark"] .card-title,
html:not([data-theme="light"]) .card-title {
  color: #ffffff;
}

/* ---- Background gradient (dark theme) ---- */
html[data-theme="dark"] body {
  background: radial-gradient(ellipse at 25% 0%, #181c2c 0%, #1e1e1e 60%) fixed;
}

/* ============================================================
   Light theme — ajustes de componentes com cores fixas do tema escuro
   ============================================================ */
html[data-theme="light"] body {
  background: radial-gradient(ellipse at 25% 0%, #f3efe2 0%, var(--bg-primary) 55%) fixed;
}

/* Logotipo: dourado → grafite (dourado → branco some no fundo claro) */
[data-theme="light"] .header-brand-name,
[data-theme="light"] .auth-brand-text {
  background-image: linear-gradient(135deg, #b8860b 0%, #8a6d1f 30%, #334155 75%);
}

[data-theme="light"] .modal-backdrop,
[data-theme="light"] .sidebar-overlay {
  background: rgba(15, 23, 42, .32);
}
[data-theme="light"] .modal { background: var(--surface); }
[data-theme="light"] .skeleton::after {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent);
}
[data-theme="light"] .auth-card { box-shadow: var(--shadow-lg), var(--highlight), 0 0 80px rgba(212, 167, 44, 0.10); }
[data-theme="light"] .auth-demo-btn { color: var(--text-secondary); }

/* Cores das matérias (escolhidas para fundo escuro) escurecidas quando viram texto */
[data-theme="light"] :is(
  .today-class-name, .last-note-subject, .note-card-subject, .note-list-subj,
  .subject-pill, .wcs-name, .deadline-subject
) {
  color: color-mix(in srgb, var(--subject-color, var(--primary)) 62%, #0f172a);
}

/* ---- Chat ---- */
[data-theme="light"] .chat-messages {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.04), transparent 18%), var(--surface);
}
[data-theme="light"] :is(.chat-search-input, .chat-input, .chat-edit-input, .chat-search-item) {
  background: #ffffff;
  border-color: var(--border);
}
[data-theme="light"] .chat-item.active { color: var(--text-primary); }
[data-theme="light"] .chat-msg-meta { color: var(--text-muted); }
[data-theme="light"] .chat-msg-bubble {
  background: var(--surface-2);
  border-color: var(--border);
}
[data-theme="light"] .chat-message-group.self .chat-msg-bubble {
  background: linear-gradient(180deg, #e6eaf0, #dde2ea);
  border-color: var(--border-light);
}
[data-theme="light"] .chat-msg-menu-toggle {
  background: rgba(255, 255, 255, .8);
  border-color: var(--border);
  color: var(--text-secondary);
}
[data-theme="light"] .chat-msg-menu { background: var(--surface); border-color: var(--border); }
[data-theme="light"] .chat-msg-menu-item { color: var(--text-primary); }
[data-theme="light"] .chat-msg-menu-item.danger { color: var(--danger); }
[data-theme="light"] :is(.chat-search-btn, .chat-draft-chip, .chat-attach-btn) {
  color: var(--text-secondary);
}
[data-theme="light"] :is(.chat-search-btn, .chat-attach-btn):hover {
  color: var(--text-primary);
  border-color: var(--primary);
}
[data-theme="light"] .chat-avatar-public {
  background: linear-gradient(135deg, #94a3b8, #64748b);
  color: #ffffff;
}