/* Claudes AI — Design System & Global Styles */

/* ─── CSS Variables ──────────────────────────────────────────────────────────── */
:root {
  /* Brand */
  --brand:        #6366f1;
  --brand-hover:  #4f46e5;
  --brand-light:  #e0e7ff;

  /* Light theme */
  --bg:           #ffffff;
  --bg-2:         #f9fafb;
  --bg-3:         #f3f4f6;
  --border:       #e5e7eb;
  --text:         #111827;
  --text-2:       #6b7280;
  --text-3:       #9ca3af;

  /* Sidebar */
  --sidebar-bg:   #111827;
  --sidebar-text: #d1d5db;
  --sidebar-hover:#1f2937;
  --sidebar-active:#374151;

  /* Message */
  --user-bubble:  #6366f1;
  --user-text:    #ffffff;
  --ai-bubble:    #f9fafb;
  --ai-border:    #e5e7eb;

  /* Status */
  --success:      #10b981;
  --error:        #ef4444;
  --warning:      #f59e0b;

  /* Spacing */
  --radius:       12px;
  --radius-sm:    8px;
  --radius-lg:    16px;

  /* Shadows */
  --shadow-sm:    0 1px 3px rgba(0,0,0,.08);
  --shadow:       0 4px 12px rgba(0,0,0,.1);
  --shadow-lg:    0 8px 24px rgba(0,0,0,.12);

  /* Transitions */
  --transition:   0.2s ease;

  /* Sidebar width */
  --sidebar-w:    260px;
}

/* Dark theme */
[data-theme="dark"] {
  --bg:           #0f172a;
  --bg-2:         #1e293b;
  --bg-3:         #334155;
  --border:       #334155;
  --text:         #f1f5f9;
  --text-2:       #94a3b8;
  --text-3:       #64748b;

  --sidebar-bg:   #020617;
  --sidebar-hover:#0f172a;
  --sidebar-active:#1e293b;

  --user-bubble:  #1e293b;
  --user-text:    #e2e8f0;

  --ai-bubble:    #1e293b;
  --ai-border:    #334155;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }

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

/* ─── Typography ─────────────────────────────────────────────────────────────── */
h1 { font-size: 2.25rem; font-weight: 700; line-height: 1.2; }
h2 { font-size: 1.75rem; font-weight: 700; line-height: 1.3; }
h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.4; }
p  { color: var(--text-2); line-height: 1.7; }

/* ─── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}
.btn-primary:hover { background: var(--brand-hover); transform: translateY(-1px); box-shadow: var(--shadow); }

.btn-secondary {
  background: var(--bg-3);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  padding: 8px 12px;
}
.btn-ghost:hover { background: var(--bg-3); color: var(--text); }

/* ─── Modal ──────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity var(--transition);
  padding: 16px;
}
.modal-overlay.show { opacity: 1; }

.modal-box {
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: transform var(--transition);
}
.modal-overlay.show .modal-box { transform: scale(1); }

.modal-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}
.modal-logo span {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
}
.modal-box h2 { font-size: 1.4rem; color: var(--text); margin-bottom: 8px; }
.modal-box p  { font-size: 0.9rem; margin-bottom: 24px; }

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  transition: all var(--transition);
  margin-bottom: 12px;
}
.btn-google:hover { background: var(--bg-3); box-shadow: var(--shadow-sm); }
.btn-google:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-close-modal {
  color: var(--text-3);
  font-size: 0.85rem;
  padding: 8px;
  width: 100%;
  transition: color var(--transition);
}
.btn-close-modal:hover { color: var(--text); }

.modal-confirm p { color: var(--text); margin-bottom: 20px; font-size: 1rem; }
.modal-actions { display: flex; gap: 10px; justify-content: center; }
.btn-cancel { padding: 10px 20px; border-radius: var(--radius-sm); background: var(--bg-3); color: var(--text); font-size: 0.9rem; }
.btn-cancel:hover { background: var(--border); }
.btn-confirm-ok { padding: 10px 20px; border-radius: var(--radius-sm); background: var(--error); color: #fff; font-size: 0.9rem; }
.btn-confirm-ok:hover { background: #dc2626; }

/* ─── Toast ──────────────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2000;
}

.toast {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  background: var(--sidebar-bg);
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateX(20px);
  transition: all var(--transition);
  max-width: 320px;
}
.toast.show { opacity: 1; transform: translateX(0); }
.toast-error   { background: var(--error); }
.toast-success { background: var(--success); }
.toast-warning { background: var(--warning); }

/* ─── Utility ────────────────────────────────────────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

/* Spinner */
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Focus outline */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}
