/* =========================================================================
   Knowledge Hub — Custom Styles
   Supplements Tailwind CDN for things it can't handle inline.
   ========================================================================= */

/* ---------------------------------------------------------------------------
   Scrollbar hide utility (used by horizontal scroll containers)
   --------------------------------------------------------------------------- */
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ---------------------------------------------------------------------------
   frappe-gantt customization — purple theme to match design system
   --------------------------------------------------------------------------- */

/* Bar fills */
.gantt .bar-wrapper .bar {
  fill: #eaddff; /* primary-fixed */
  stroke: none;
}
.gantt .bar-wrapper .bar-progress {
  fill: #630ed4; /* primary */
}
.gantt .bar-wrapper:hover .bar {
  fill: #d2bbff; /* primary-fixed-dim */
}

/* High priority bars */
.gantt .bar-wrapper.gantt-bar-high .bar {
  fill: #eaddff;
}
.gantt .bar-wrapper.gantt-bar-high .bar-progress {
  fill: #7c3aed; /* primary-container */
}

/* Normal priority bars */
.gantt .bar-wrapper.gantt-bar-normal .bar {
  fill: #eceef0; /* surface-container */
}
.gantt .bar-wrapper.gantt-bar-normal .bar-progress {
  fill: #630ed4; /* primary */
}

/* Grid lines — subtle to match design system */
.gantt .grid-background {
  fill: #ffffff;
}
.gantt .grid-header {
  fill: #f2f4f6; /* surface-container-low */
  stroke: none;
}
.gantt .grid-row {
  fill: #ffffff;
}
.gantt .grid-row:nth-child(even) {
  fill: #f8f9fb; /* background */
}
.gantt .row-line {
  stroke: #ccc3d8; /* outline-variant */
  opacity: 0.2;
}
.gantt .tick {
  stroke: #ccc3d8; /* outline-variant */
  opacity: 0.15;
}

/* Today marker */
.gantt .today-highlight {
  fill: #630ed4; /* primary */
  opacity: 0.06;
}

/* Header text */
.gantt .upper-text,
.gantt .lower-text {
  fill: #4a4455; /* on-surface-variant */
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 500;
}

/* Bar labels */
.gantt .bar-label {
  fill: #ffffff;
  font-family: 'Inter', 'Noto Sans JP', sans-serif;
  font-size: 10px;
  font-weight: 600;
}
.gantt .bar-label.big {
  fill: #191c1e; /* on-surface */
  font-size: 11px;
}

/* Arrow (dependency lines) */
.gantt .arrow {
  stroke: #7b7487; /* outline */
  stroke-width: 1.5;
}

/* Popup */
.gantt-popup {
  font-family: 'Inter', 'Noto Sans JP', sans-serif;
}
.gantt .popup-wrapper {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(204, 195, 216, 0.3);
  box-shadow: 0 8px 24px rgba(25, 28, 30, 0.08);
}

/* Handle (resize grip) */
.gantt .handle {
  fill: #630ed4; /* primary */
  opacity: 0;
  transition: opacity 0.15s ease;
}
.gantt .bar-wrapper:hover .handle {
  opacity: 0.6;
}

/* ---------------------------------------------------------------------------
   Markdown rendered content (for wiki / notes)
   --------------------------------------------------------------------------- */
.prose-kh h1,
.prose-kh h2,
.prose-kh h3 {
  font-family: 'Inter', 'Noto Sans JP', sans-serif;
  color: #191c1e;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.prose-kh h1 { font-size: 1.5rem; margin-bottom: 1rem; }
.prose-kh h2 { font-size: 1.125rem; margin-top: 1.5rem; margin-bottom: 0.75rem; }
.prose-kh h3 { font-size: 0.875rem; margin-top: 1.25rem; margin-bottom: 0.5rem; }

.prose-kh p {
  font-size: 0.875rem;
  line-height: 1.6;
  color: #191c1e;
  margin-bottom: 0.75rem;
}
.prose-kh a {
  color: #630ed4;
  text-decoration: none;
  font-weight: 500;
}
.prose-kh a:hover {
  text-decoration: underline;
}
.prose-kh code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  background: #f2f4f6;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  color: #630ed4;
}
.prose-kh pre {
  background: #f2f4f6;
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 1rem;
}
.prose-kh pre code {
  background: none;
  padding: 0;
  color: #191c1e;
}
.prose-kh ul,
.prose-kh ol {
  padding-left: 1.25rem;
  margin-bottom: 0.75rem;
}
.prose-kh li {
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: 0.25rem;
}
.prose-kh blockquote {
  border-left: 3px solid #630ed4;
  padding-left: 1rem;
  color: #4a4455;
  font-style: italic;
  margin: 1rem 0;
}
.prose-kh hr {
  border: none;
  height: 1px;
  background: #ccc3d8;
  opacity: 0.3;
  margin: 1.5rem 0;
}
.prose-kh table {
  width: 100%;
  font-size: 0.8125rem;
  border-collapse: collapse;
  margin-bottom: 1rem;
}
.prose-kh th {
  text-align: left;
  font-weight: 600;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #4a4455;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(204, 195, 216, 0.3);
}
.prose-kh td {
  padding: 0.5rem 0.75rem;
  color: #191c1e;
  border-bottom: 1px solid rgba(204, 195, 216, 0.1);
}

/* ---------------------------------------------------------------------------
   Print styles
   --------------------------------------------------------------------------- */
@media print {
  /* Hide navigation and interactive elements */
  aside,
  header,
  button,
  .fixed,
  #gantt-container,
  #new-project-modal {
    display: none !important;
  }

  /* Reset the main content area */
  main {
    margin-left: 0 !important;
  }

  body {
    background: white;
    color: #191c1e;
    font-size: 12px;
  }

  /* Ensure cards print cleanly */
  .bg-primary\/5 {
    background: #f8f5ff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  a {
    color: #191c1e !important;
    text-decoration: none !important;
  }
}
