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

:root {
  --font-family: 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bg-primary: #FFFFFF;
  --bg-subtle: #F8FAFC;
  --bg-light: #F1F5F9;
  --bg-border: #E2E8F0;
  --text-main: #0F172A;
  --text-muted: #64748B;
  --text-dim: #94A3B8;
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --primary-subtle: #EFF6FF;
  --success: #16A34A;
  --warning: #F59E0B;
  --danger: #DC2626;
  --sidebar-width: 260px;
  --topbar-height: 64px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
}

body, button, input, optgroup, select, textarea, .form-control, .form-select, .btn, .modal, .dropdown-menu {
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-subtle);
  color: var(--text-main);
  min-height: 100vh;
  margin: 0;
  display: flex;
}

/* Sidebar */
#app-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-primary);
  border-right: 1px solid var(--bg-border);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: width 0.2s ease, transform 0.2s ease;
}

.sidebar-header {
  height: var(--topbar-height);
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--bg-border);
}

.sidebar-nav {
  padding: 1rem 0.75rem;
  overflow-y: auto;
  flex: 1;
}

.nav-section-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: var(--text-dim);
  padding: 0.5rem 0.75rem 0.25rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9375rem;
  transition: all 0.15s ease;
  margin-bottom: 0.125rem;
}

.sidebar-link:hover {
  background-color: var(--bg-light);
  color: var(--text-main);
}

.sidebar-link.active {
  background-color: var(--primary-subtle);
  color: var(--primary);
  font-weight: 600;
}

.sidebar-link i {
  font-size: 1.15rem;
}

/* Main Content Area */
#app-main {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: margin-left 0.2s ease;
}

/* Topbar */
#app-topbar {
  height: var(--topbar-height);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--bg-border);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 900;
}

.content-container {
  padding: 1.75rem;
  flex: 1;
}

/* Kanban Board Styling */
.kanban-board {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  align-items: flex-start;
  min-height: calc(100vh - 160px);
}

.kanban-col {
  background: var(--bg-light);
  border-radius: var(--radius-md);
  width: 320px;
  min-width: 320px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 160px);
}

.kanban-col-header {
  padding: 1rem 1.25rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 0.95rem;
}

.kanban-col-cards {
  padding: 0.5rem 0.75rem 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  flex: 1;
}

.task-card {
  background: var(--bg-primary);
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-sm);
  padding: 0.875rem;
  cursor: grab;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.task-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #CBD5E1;
}

.task-card.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

/* Badges & Indicators */
.badge-priority {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.badge-tag {
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-weight: 500;
  background: var(--bg-light);
  color: var(--text-muted);
}

/* Mindmap Canvas */
#mindmap-container {
  width: 100%;
  height: calc(100vh - 180px);
  background: #FAFAFA;
  border: 1px solid var(--bg-border);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  user-select: none;
}

.mindmap-node {
  position: absolute;
  padding: 0.75rem 1.25rem;
  background: #FFF;
  border: 2px solid var(--primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  cursor: move;
  font-weight: 500;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 120px;
  max-width: 260px;
}

.mindmap-node.selected {
  outline: 3px solid #93C5FD;
}

/* Responsive adjustments */
@media (max-width: 991px) {
  #app-sidebar {
    transform: translateX(-100%);
  }
  #app-sidebar.show {
    transform: translateX(0);
  }
  #app-main {
    margin-left: 0;
  }
}

/* Custom Scrollbar for Modal and scrollable containers */
.modal-dialog-scrollable .modal-body::-webkit-scrollbar,
.custom-scrollbar::-webkit-scrollbar,
.kanban-col-cards::-webkit-scrollbar,
.kanban-board::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

.modal-dialog-scrollable .modal-body::-webkit-scrollbar-track,
.custom-scrollbar::-webkit-scrollbar-track,
.kanban-col-cards::-webkit-scrollbar-track,
.kanban-board::-webkit-scrollbar-track {
  background: #F1F5F9;
  border-radius: 9999px;
}

.modal-dialog-scrollable .modal-body::-webkit-scrollbar-thumb,
.custom-scrollbar::-webkit-scrollbar-thumb,
.kanban-col-cards::-webkit-scrollbar-thumb,
.kanban-board::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 9999px;
}

.modal-dialog-scrollable .modal-body::-webkit-scrollbar-thumb:hover,
.custom-scrollbar::-webkit-scrollbar-thumb:hover,
.kanban-col-cards::-webkit-scrollbar-thumb:hover,
.kanban-board::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

/* Modal Dialog Scrollable & Card Styling */
#task-detail-modal .modal-dialog {
  max-width: 720px;
}

#task-detail-modal .modal-content {
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.05);
}

#task-detail-modal .modal-header {
  border-bottom: 1px solid var(--bg-border);
}

#task-detail-modal .modal-footer {
  border-top: 1px solid var(--bg-border);
  position: sticky;
  bottom: 0;
  z-index: 10;
}

#task-detail-modal .form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1E293B;
  margin-bottom: 0.35rem;
}

#task-detail-modal .form-control,
#task-detail-modal .form-select {
  border-color: #CBD5E1;
  border-radius: 8px;
  font-size: 0.9375rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#task-detail-modal .form-control:focus,
#task-detail-modal .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

#task-detail-modal .card {
  border-radius: 8px;
  border-color: var(--bg-border);
}

.shadow-xs {
  box-shadow: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
}

