/* MCTS WORKSPACE — Custom styles */

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
}

* { -webkit-font-smoothing: antialiased; }

html { scroll-behavior: smooth; }
body { min-height: 100vh; overflow-x: hidden; }
#app-root { width: 100%; }

/* Custom scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.4); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.7); }
.dark ::-webkit-scrollbar-thumb { background: rgba(71, 85, 105, 0.5); }
.dark ::-webkit-scrollbar-thumb:hover { background: rgba(100, 116, 139, 0.8); }

/* Board backgrounds */
.bg-gradient-1 { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.bg-gradient-2 { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.bg-gradient-3 { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.bg-gradient-4 { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.bg-gradient-5 { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.bg-gradient-6 { background: linear-gradient(135deg, #30cfd0 0%, #330867 100%); }
.bg-gradient-7 { background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); }
.bg-gradient-8 { background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); }

/* Card */
.kanban-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
  transition: all .2s cubic-bezier(.4,0,.2,1);
  border: 1px solid rgba(148, 163, 184, 0.1);
}
.kanban-card:hover {
  box-shadow: 0 8px 20px rgba(0,0,0,0.08), 0 3px 6px rgba(0,0,0,0.04);
  transform: translateY(-2px);
}
.dark .kanban-card {
  background: #1e293b;
  border-color: rgba(71, 85, 105, 0.5);
}
.dark .kanban-card:hover {
  background: #273549;
}

/* Drag states */
.sortable-ghost {
  opacity: .3;
  background: rgba(99, 102, 241, 0.08) !important;
  border: 2px dashed rgba(99, 102, 241, 0.5) !important;
}
.sortable-chosen { cursor: grabbing !important; }
.sortable-drag {
  transform: rotate(2deg);
  box-shadow: 0 25px 50px -12px rgba(0,0,0,.25);
}

/* List (occupies full width of its parent column in the 2D layout) */
.kanban-list {
  background: rgba(241, 245, 249, 0.7);
  backdrop-filter: blur(8px);
  border-radius: 14px;
  width: 100%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  max-height: 70vh;
}
.dark .kanban-list {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(51, 65, 85, 0.6);
}
/* Empty column (drop zone for new column creation) */
.kanban-column-empty .lists-stack {
  min-height: 80px;
  border: 2px dashed rgba(255,255,255,0.15);
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  transition: background .2s, border-color .2s;
}
.kanban-column-empty .lists-stack.sortable-hover-target,
.lists-stack.sortable-hover-target {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.4);
}

/* Priority dots */
.prio-low    { background: #94a3b8; }
.prio-medium { background: #06b6d4; }
.prio-high   { background: #f59e0b; }
.prio-urgent { background: #ef4444; }

/* Animations */
.animate-fade-in { animation: fadeIn .25s ease-out; }
.animate-slide-up { animation: slideUp .3s ease-out; }
.animate-pop { animation: pop .2s ease-out; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pop { from { transform: scale(.96); } to { transform: scale(1); } }
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
.dark .skeleton {
  background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
  background-size: 200% 100%;
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  padding: .55rem 1.1rem;
  border-radius: 10px;
  font-weight: 500;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(99,102,241,.4); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }

.btn-ghost {
  padding: .55rem 1.1rem;
  border-radius: 10px;
  color: #475569;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}
.btn-ghost:hover { background: rgba(148, 163, 184, .15); }
.dark .btn-ghost { color: #cbd5e1; }
.dark .btn-ghost:hover { background: rgba(51, 65, 85, .5); }

/* Input */
.input {
  width: 100%;
  padding: .65rem .9rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: white;
  transition: all .15s;
  color: #0f172a;
}
.input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .15);
}
.dark .input {
  background: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}

/* Modal backdrop */
.modal-backdrop {
  background: rgba(15, 23, 42, .6);
  backdrop-filter: blur(8px);
}

/* Sidebar */
.sidebar-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .55rem .9rem;
  border-radius: 8px;
  color: #475569;
  transition: all .15s;
  cursor: pointer;
  font-size: .9rem;
}
.sidebar-item:hover { background: rgba(99, 102, 241, .08); color: #6366f1; }
.sidebar-item.active { background: rgba(99, 102, 241, .12); color: #6366f1; font-weight: 500; }
.dark .sidebar-item { color: #cbd5e1; }
.dark .sidebar-item:hover { background: rgba(99, 102, 241, .15); }
.dark .sidebar-item.active { background: rgba(99, 102, 241, .2); color: #a5b4fc; }

/* Avatar */
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: .8rem;
  flex-shrink: 0;
  border: 2px solid white;
}
.dark .avatar { border-color: #1e293b; }

/* Calendar */
.calendar-day {
  min-height: 110px;
  padding: 6px;
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 8px;
  background: white;
  transition: all .15s;
}
.dark .calendar-day {
  background: #1e293b;
  border-color: rgba(51, 65, 85, 0.5);
}
.calendar-day:hover { background: #f8fafc; }
.dark .calendar-day:hover { background: #273549; }
.calendar-day.today { border-color: #6366f1; background: rgba(99, 102, 241, .04); }
.calendar-day.other-month { opacity: .35; }

/* Timeline */
.timeline-bar {
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  color: white;
  font-size: .75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.timeline-bar:hover { transform: scaleY(1.1); box-shadow: 0 4px 8px rgba(0,0,0,.15); }

/* Toast notifications */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  padding: 12px 16px;
  border-radius: 10px;
  background: white;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  max-width: 400px;
  pointer-events: auto;
  border-left: 4px solid #6366f1;
  animation: slideInRight .3s ease-out;
}
.toast.success { border-left-color: #10b981; }
.toast.error   { border-left-color: #ef4444; }
.toast.warning { border-left-color: #f59e0b; }
.dark .toast { background: #1e293b; color: #f1f5f9; }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Responsive helpers */
@media (max-width: 768px) {
  .kanban-column { width: 85vw; max-width: 320px; }
}

/* Theme transition smoothing */
body, .kanban-card, .kanban-list, .calendar-day, .input, .sidebar-item, .toast {
  transition: background-color .2s, color .2s, border-color .2s, box-shadow .2s;
}

/* ===== Documents (Notion-style) editor ===== */
.doc-editor {
  font-size: 16px;
  line-height: 1.7;
  color: #1e293b;
  padding: 4px 0;
}
.dark .doc-editor { color: #e2e8f0; }
.doc-editor:focus { outline: none; }
.doc-editor h1 { font-size: 2em; font-weight: 700; margin: 0.8em 0 0.3em; }
.doc-editor h2 { font-size: 1.5em; font-weight: 700; margin: 0.7em 0 0.3em; }
.doc-editor h3 { font-size: 1.25em; font-weight: 600; margin: 0.6em 0 0.2em; }
.doc-editor p { margin: 0.3em 0; }
.doc-editor ul { list-style: disc; padding-left: 1.4em; margin: 0.4em 0; }
.doc-editor ol { list-style: decimal; padding-left: 1.4em; margin: 0.4em 0; }
.doc-editor blockquote {
  border-left: 3px solid #6366f1;
  padding: 0.4em 0.8em;
  margin: 0.6em 0;
  color: #64748b;
  background: #f8fafc;
  border-radius: 0 8px 8px 0;
}
.dark .doc-editor blockquote { background: rgba(99,102,241,.06); color: #94a3b8; }
.doc-editor pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 0.9em 1em;
  border-radius: 10px;
  overflow-x: auto;
  font-family: ui-monospace, monospace;
  font-size: 13px;
  margin: 0.6em 0;
}
.doc-editor code {
  background: #f1f5f9;
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: ui-monospace, monospace;
}
.dark .doc-editor code { background: rgba(99,102,241,.15); }
.doc-editor a { color: #6366f1; text-decoration: underline; }
.doc-editor img { max-width: 100%; border-radius: 8px; }

.fmt-btn {
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 13px;
  color: #475569;
  transition: background-color .15s;
}
.fmt-btn:hover { background: rgba(99,102,241,.1); color: #6366f1; }
.dark .fmt-btn { color: #94a3b8; }

/* Priority dot - reused across views */
.prio-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #64748b;
}
.prio-dot.prio-low     { background: #94a3b8; }
.prio-dot.prio-medium  { background: #3b82f6; }
.prio-dot.prio-high    { background: #f59e0b; }
.prio-dot.prio-urgent  { background: #ef4444; }

/* Doc tree hover */
.doc-tree-item a:hover {
  transition: background .15s;
}

/* Line clamp utility for cards */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
