/* Lead & Project Tracker - Core Styles */
/* Daniel David Peter Nicholls */

/* ============================================================
   BASE & SCROLLBAR
   ============================================================ */
* { scrollbar-width: thin; scrollbar-color: rgba(100,116,139,0.3) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(100,116,139,0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(100,116,139,0.5); }

html { scroll-behavior: smooth; }

/* ============================================================
   LIGHT MODE
   ============================================================ */
html:not(.dark) body { background: #f8fafc; color: #1e293b; }
html:not(.dark) .bg-surface-800 { background: #ffffff; }
html:not(.dark) .bg-surface-800\/80 { background: rgba(255,255,255,0.8); }
html:not(.dark) .bg-surface-900 { background: #f1f5f9; }
html:not(.dark) .bg-surface-900\/60 { background: rgba(241,245,249,0.6); }
html:not(.dark) .border-gray-700\/50 { border-color: rgba(226,232,240,1); }
html:not(.dark) .text-gray-100 { color: #1e293b; }
html:not(.dark) .text-gray-200 { color: #334155; }
html:not(.dark) .text-gray-300 { color: #475569; }
html:not(.dark) .text-gray-400 { color: #64748b; }
html:not(.dark) .text-gray-500 { color: #94a3b8; }
html:not(.dark) .text-white { color: #0f172a; }

html:not(.dark) .stat-card { background: #ffffff; border-color: #e2e8f0; }
html:not(.dark) .table-row:hover { background: #f1f5f9; }
html:not(.dark) .kanban-col { background: #f1f5f9; }
html:not(.dark) .kanban-card { background: #ffffff; border-color: #e2e8f0; }
html:not(.dark) .nav-item { color: #475569; }
html:not(.dark) .nav-item:hover { background: #f1f5f9; color: #1e293b; }
html:not(.dark) .nav-item.active { background: #eef2ff; color: #4f46e5; }
html:not(.dark) #detail-drawer { background: #ffffff; }
html:not(.dark) #quick-add-modal > div > div { background: #ffffff; }
html:not(.dark) .activity-item { border-color: #e2e8f0; }
html:not(.dark) .form-input { background: #f8fafc; border-color: #e2e8f0; color: #1e293b; }
html:not(.dark) .dropdown-menu { background: #ffffff; border-color: #e2e8f0; }
html:not(.dark) .search-result-item:hover { background: #f1f5f9; }

/* ============================================================
   NAV ITEMS
   ============================================================ */
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #94a3b8;
  transition: all 0.15s ease;
  text-decoration: none;
  cursor: pointer;
}
.nav-item:hover { background: rgba(51,65,85,0.5); color: #e2e8f0; }
.nav-item.active { background: rgba(99,102,241,0.15); color: #a5b4fc; }

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-card {
  background: rgba(30,41,59,0.6);
  border: 1px solid rgba(51,65,85,0.5);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  transition: all 0.2s ease;
}
.stat-card:hover { border-color: rgba(99,102,241,0.3); transform: translateY(-1px); }
.stat-value { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.025em; }
.stat-label { font-size: 0.6875rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; color: #94a3b8; }

/* ============================================================
   STATUS BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.badge-new { background: rgba(99,102,241,0.15); color: #a5b4fc; }
.badge-contacted { background: rgba(59,130,246,0.15); color: #93c5fd; }
.badge-discovery_booked,.badge-discovery { background: rgba(6,182,212,0.15); color: #67e8f9; }
.badge-proposal_requested { background: rgba(245,158,11,0.15); color: #fcd34d; }
.badge-proposal_sent,.badge-sent { background: rgba(168,85,247,0.15); color: #d8b4fe; }
.badge-negotiating { background: rgba(236,72,153,0.15); color: #f9a8d4; }
.badge-won { background: rgba(34,197,94,0.15); color: #86efac; }
.badge-lost { background: rgba(239,68,68,0.15); color: #fca5a5; }
.badge-dormant { background: rgba(100,116,139,0.15); color: #cbd5e1; }
.badge-stale { background: rgba(251,146,60,0.15); color: #fdba74; }

.badge-draft { background: rgba(100,116,139,0.15); color: #cbd5e1; }
.badge-viewed { background: rgba(14,165,233,0.15); color: #7dd3fc; }

.badge-not_started,.badge-not-started { background: rgba(100,116,139,0.15); color: #cbd5e1; }
.badge-active { background: rgba(34,197,94,0.15); color: #86efac; }
.badge-awaiting_client,.badge-awaiting-client { background: rgba(245,158,11,0.15); color: #fcd34d; }
.badge-blocked { background: rgba(239,68,68,0.15); color: #fca5a5; }
.badge-completed { background: rgba(34,197,94,0.15); color: #86efac; }
.badge-archived { background: rgba(100,116,139,0.15); color: #cbd5e1; }

.badge-healthy { background: rgba(34,197,94,0.15); color: #86efac; }
.badge-watch { background: rgba(245,158,11,0.15); color: #fcd34d; }
.badge-at_risk,.badge-at-risk { background: rgba(239,68,68,0.15); color: #fca5a5; }

.badge-hot { background: rgba(239,68,68,0.15); color: #fca5a5; }
.badge-warm { background: rgba(245,158,11,0.15); color: #fcd34d; }
.badge-cold { background: rgba(59,130,246,0.15); color: #93c5fd; }

.badge-urgent { background: rgba(239,68,68,0.2); color: #fca5a5; }
.badge-high { background: rgba(251,146,60,0.15); color: #fdba74; }
.badge-medium { background: rgba(245,158,11,0.15); color: #fcd34d; }
.badge-low { background: rgba(100,116,139,0.15); color: #cbd5e1; }

.badge-pending { background: rgba(245,158,11,0.15); color: #fcd34d; }
.badge-in_progress,.badge-in-progress { background: rgba(59,130,246,0.15); color: #93c5fd; }
.badge-snoozed { background: rgba(168,85,247,0.15); color: #d8b4fe; }
.badge-cancelled { background: rgba(100,116,139,0.15); color: #cbd5e1; }

/* ============================================================
   TEMPERATURE DOTS
   ============================================================ */
.temp-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.temp-hot { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,0.5); }
.temp-warm { background: #f59e0b; box-shadow: 0 0 6px rgba(245,158,11,0.4); }
.temp-cold { background: #3b82f6; }

/* ============================================================
   TABLE STYLES
   ============================================================ */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  border-bottom: 1px solid rgba(51,65,85,0.5);
  white-space: nowrap;
}
.data-table td {
  padding: 0.625rem 0.75rem;
  font-size: 0.8125rem;
  border-bottom: 1px solid rgba(51,65,85,0.3);
  vertical-align: middle;
}
.table-row { transition: background 0.1s ease; cursor: pointer; }
.table-row:hover { background: rgba(51,65,85,0.3); }

/* ============================================================
   KANBAN
   ============================================================ */
.kanban-board { display: flex; gap: 0.75rem; overflow-x: auto; padding-bottom: 1rem; min-height: 400px; }
.kanban-col {
  min-width: 280px;
  max-width: 320px;
  flex-shrink: 0;
  background: rgba(15,23,42,0.4);
  border-radius: 0.75rem;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 220px);
}
.kanban-col-header {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  padding: 0.25rem 0.25rem 0.625rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.kanban-cards { flex: 1; overflow-y: auto; space-y: 0.5rem; display: flex; flex-direction: column; gap: 0.5rem; }
.kanban-card {
  background: rgba(30,41,59,0.8);
  border: 1px solid rgba(51,65,85,0.5);
  border-radius: 0.625rem;
  padding: 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.kanban-card:hover { border-color: rgba(99,102,241,0.4); transform: translateY(-1px); }

/* ============================================================
   FORMS
   ============================================================ */
.form-input {
  width: 100%;
  background: rgba(15,23,42,0.5);
  border: 1px solid rgba(51,65,85,0.5);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  color: #e2e8f0;
  transition: all 0.15s ease;
}
.form-input:focus {
  outline: none;
  border-color: rgba(99,102,241,0.5);
  box-shadow: 0 0 0 2px rgba(99,102,241,0.15);
}
.form-input::placeholder { color: #64748b; }
.form-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin-bottom: 0.25rem;
}
select.form-input { cursor: pointer; }
textarea.form-input { resize: vertical; min-height: 4rem; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: all 0.15s ease;
  cursor: pointer;
  border: none;
  white-space: nowrap;
}
.btn-primary { background: #4f46e5; color: white; }
.btn-primary:hover { background: #4338ca; }
.btn-secondary { background: rgba(51,65,85,0.5); color: #e2e8f0; border: 1px solid rgba(51,65,85,0.5); }
.btn-secondary:hover { background: rgba(51,65,85,0.8); }
.btn-danger { background: rgba(239,68,68,0.15); color: #fca5a5; }
.btn-danger:hover { background: rgba(239,68,68,0.3); }
.btn-ghost { background: transparent; color: #94a3b8; }
.btn-ghost:hover { background: rgba(51,65,85,0.3); color: #e2e8f0; }
.btn-success { background: rgba(34,197,94,0.15); color: #86efac; }
.btn-success:hover { background: rgba(34,197,94,0.3); }
.btn-sm { padding: 0.25rem 0.5rem; font-size: 0.75rem; }

/* ============================================================
   QUICK ADD TABS
   ============================================================ */
.qa-tab {
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #94a3b8;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}
.qa-tab:hover { color: #e2e8f0; background: rgba(51,65,85,0.3); }
.qa-tab.active { color: #a5b4fc; background: rgba(99,102,241,0.15); border-color: rgba(99,102,241,0.3); }

/* ============================================================
   ACTIVITY TIMELINE
   ============================================================ */
.activity-item {
  position: relative;
  padding: 0.75rem 0 0.75rem 2rem;
  border-bottom: 1px solid rgba(51,65,85,0.3);
}
.activity-item::before {
  content: '';
  position: absolute;
  left: 0.5rem;
  top: 1rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4f46e5;
}
.activity-item::after {
  content: '';
  position: absolute;
  left: 0.8125rem;
  top: 1.75rem;
  bottom: 0;
  width: 1px;
  background: rgba(51,65,85,0.5);
}
.activity-item:last-child::after { display: none; }

/* ============================================================
   SEARCH RESULTS
   ============================================================ */
.search-result-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: background 0.1s ease;
}
.search-result-item:hover { background: rgba(51,65,85,0.4); }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  padding: 0.625rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  animation: slideInRight 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.toast-success { background: #065f46; color: #a7f3d0; border: 1px solid #059669; }
.toast-error { background: #7f1d1d; color: #fecaca; border: 1px solid #dc2626; }
.toast-info { background: #1e3a5f; color: #bfdbfe; border: 1px solid #2563eb; }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ============================================================
   EMPTY STATES
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: #64748b;
}
.empty-state i { font-size: 2rem; margin-bottom: 0.75rem; opacity: 0.5; }
.empty-state h3 { font-size: 0.875rem; font-weight: 600; color: #94a3b8; margin-bottom: 0.25rem; }
.empty-state p { font-size: 0.75rem; }

/* ============================================================
   SECTION HEADER
   ============================================================ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #f1f5f9;
}
html:not(.dark) .section-title { color: #0f172a; }

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.filter-btn {
  padding: 0.25rem 0.625rem;
  border-radius: 0.375rem;
  font-size: 0.6875rem;
  font-weight: 500;
  color: #94a3b8;
  background: transparent;
  border: 1px solid rgba(51,65,85,0.5);
  cursor: pointer;
  transition: all 0.15s ease;
}
.filter-btn:hover { border-color: rgba(99,102,241,0.4); color: #e2e8f0; }
.filter-btn.active { background: rgba(99,102,241,0.15); border-color: rgba(99,102,241,0.4); color: #a5b4fc; }

/* ============================================================
   DRAWER
   ============================================================ */
.drawer-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 1.25rem;
  border-bottom: 1px solid rgba(51,65,85,0.5);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
html:not(.dark) .drawer-header { background: #ffffff; }
.dark .drawer-header { background: rgba(15,23,42,0.95); }
.drawer-body { padding: 1.25rem; }
.drawer-section { margin-bottom: 1.5rem; }
.drawer-section-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 0.5rem;
}

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-bar {
  height: 4px;
  background: rgba(51,65,85,0.5);
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .kanban-board { min-height: 300px; }
}
@media (max-width: 640px) {
  .stat-card { padding: 0.75rem; }
  .stat-value { font-size: 1.25rem; }
  .data-table { font-size: 0.75rem; }
  .data-table th, .data-table td { padding: 0.375rem 0.5rem; }
}
