/* Hand-authored styles (not generated by Tailwind build). Loaded after style.css. */

/* Used by base notifications drawer + lightbox (was a no-op class name under CDN too). */
@keyframes nfFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.animate-fadeIn {
  animation: nfFadeIn 0.18s ease-out;
}
@media (prefers-reduced-motion: reduce) {
  .animate-fadeIn { animation: none; }
}

/*
 * CDN-removal coverage anchors: utilities referenced in templates/JSX that the
 * Tailwind extractor/safelist did not emit (arbitrary + opacity). Keep selectors
 * identical to class strings in source so DOM class names keep working.
 */
.bg-\[\#EAE8DF\]\/12 {
  background-color: hsla(49, 21%, 90%, 0.12);
}
.bg-\[\#0B0C0E\]\/92 {
  background-color: rgba(11, 12, 14, 0.92);
}

/* CPM Engine Styles */
.node-critical-path > div {
  border-color: #ef4444 !important; /* Tailwind red-500 */
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.4) !important;
}

.connection-critical-path {
  stroke: #ef4444 !important;
  stroke-width: 4px !important;
  stroke-dasharray: 10, 5 !important;
  animation: dashCritical 1s linear infinite;
  filter: drop-shadow(0 0 5px rgba(239,68,68,0.8));
}

@keyframes dashCritical {
  to {
    stroke-dashoffset: -15;
  }
}

/* Drawflow SVG Markers */
.drawflow .connection .main-path {
  marker-end: url(#arrowhead) !important;
}

.connection-critical-path {
  marker-end: url(#arrowhead-critical) !important;
}

/* Base Drawflow Node Reset */
.drawflow .drawflow-node {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  border-radius: 16px !important;
  width: auto !important;
}

.drawflow .drawflow-node.selected,
.drawflow .drawflow-node:hover,
.drawflow .drawflow-node:focus,
.drawflow .drawflow-node:active {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 16px !important;
}

/* Dedicated Waypoint Anchor & Hitbox Protection */
.drawflow .drawflow-node.node-waypoint,
.drawflow .drawflow-node.waypoint {
  pointer-events: none !important;
  touch-action: none !important;
  width: 1px !important;
  height: 1px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  z-index: 50 !important;
}

.drawflow .drawflow-node.node-waypoint .input,
.drawflow .drawflow-node.node-waypoint .output,
.drawflow .drawflow-node.waypoint .input,
.drawflow .drawflow-node.waypoint .output {
  width: 1px !important;
  height: 1px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  opacity: 0 !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  transform: none !important;
  pointer-events: none !important;
}

.drawflow .drawflow-node.node-waypoint .waypoint-handle,
.drawflow .drawflow-node.waypoint .waypoint-handle {
  pointer-events: auto !important;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.4);
  border: 2px solid #6366F1;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.8), 0 0 4px rgba(0, 0, 0, 0.5);
  cursor: grab;
  position: absolute;
  top: -9px;
  left: -9px;
  transition: transform 0.15s, background-color 0.15s;
  touch-action: none;
  z-index: 50;
}

.drawflow .drawflow-node.node-waypoint .waypoint-handle:hover,
.drawflow .drawflow-node.node-waypoint .waypoint-handle:active,
.drawflow .drawflow-node.waypoint .waypoint-handle:hover,
.drawflow .drawflow-node.waypoint .waypoint-handle:active {
  background: #6366F1;
  transform: scale(1.25);
  cursor: grabbing;
}

/* Image Card Container & Resize */
.image-card-container {
  resize: both;
  overflow: hidden;
  min-width: 120px;
  min-height: 80px;
  max-width: 900px;
  max-height: 900px;
  position: relative;
}

.drawflow .drawflow-node.image {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  box-shadow: none !important;
}

/* Status Glow Design System */
.glow-status-white {
    border: 1.5px solid rgba(255, 255, 255, 0.4) !important;
    box-shadow: 0 0 14px rgba(255, 255, 255, 0.15) !important;
}
.glow-status-yellow {
    border: 1.5px solid rgba(251, 191, 36, 0.6) !important;
    box-shadow: 0 0 16px rgba(251, 191, 36, 0.22) !important;
}
.glow-status-pink {
    border: 1.5px solid rgba(236, 72, 153, 0.6) !important;
    box-shadow: 0 0 16px rgba(236, 72, 153, 0.22) !important;
}
.glow-status-green {
    border: 1.5px solid rgba(16, 185, 129, 0.6) !important;
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.22) !important;
}
.glow-status-red {
    border: 1.5px solid rgba(225, 29, 72, 0.6) !important;
    box-shadow: 0 0 16px rgba(225, 29, 72, 0.22) !important;
}
.glow-status-blue {
    border: 1.5px solid rgba(56, 189, 248, 0.7) !important;
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.28) !important;
}

/* Hide Delete Button on Core DB Entities */
.drawflow-node.task .drawflow-delete,
.drawflow-node.initiative .drawflow-delete {
    display: none !important;
}

/* Magnetic Connection Active State */
.port-magnetic-active {
    transform: translateY(-50%) scale(1.8) !important;
    background: #ec4899 !important; /* Pink glow for snap */
    border-color: #fbcfe8 !important;
    box-shadow: 0 0 12px rgba(236, 72, 153, 0.8) !important;
}

/* Drawflow Node Transparent Wrapper */
.drawflow .drawflow-node {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    border-radius: 16px !important;
}

/* Ports with Active Connections (Ready to Detach) */
.drawflow .drawflow-node .input.has-connection {
    cursor: grab !important;
    border-color: #818CF8 !important;
}
.drawflow .drawflow-node .input.has-connection:hover {
    transform: translateY(-50%) scale(1.5) !important;
    background: #6366F1 !important;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.6) !important;
}

/* ==========================================================================
   TipTap WYSIWYG Slash-Editor Dark Glassmorphism Styling
   ========================================================================== */

.neurofy-editor-wrapper {
  width: 100%;
  position: relative;
}

.neurofy-editor-wrapper.has-toolbar {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.75rem;
  overflow: hidden;
  background: #090D14;
}

.neurofy-editor-wrapper.neurofy-editor-collapsible {
  position: relative;
}

.neurofy-editor-wrapper.neurofy-editor-collapsible .toolbar-toggle-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 20;
}

.neurofy-editor-wrapper.neurofy-editor-collapsible:not(.has-toolbar-expanded) .tiptap.ProseMirror {
  padding-right: 2.75rem;
}

.neurofy-editor-toolbar {
  user-select: none;
  transition: max-height 0.2s ease, opacity 0.2s ease;
}

.neurofy-editor-toolbar.is-expanded {
  display: flex;
}

.neurofy-editor-toolbar .neurofy-toolbar-btn.is-active,
.neurofy-editor-toolbar .neurofy-toolbar-btn:active {
  color: #E0E7FF;
  background: rgba(79, 70, 229, 0.25);
}

.tiptap.ProseMirror {
  outline: none !important;
  color: #E2E8F0;
  font-size: 0.875rem;
  line-height: 1.65;
  min-height: 120px;
  background-color: #090D14;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.75rem;
  padding: 0.875rem 1rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.neurofy-editor-wrapper.has-toolbar .tiptap.ProseMirror {
  border: none;
  border-radius: 0 0 0.75rem 0.75rem;
  min-height: 100px;
}

.tiptap.ProseMirror:focus {
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.3), 0 0 15px rgba(99, 102, 241, 0.1);
}

.tiptap p.is-editor-empty:first-child::before {
  color: #64748B;
  content: attr(data-placeholder);
  float: left;
  height: 0;
  pointer-events: none;
}

/* Headings */
.tiptap h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.tiptap h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #F8FAFC;
  margin-top: 0.875rem;
  margin-bottom: 0.375rem;
  line-height: 1.35;
}

.tiptap h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #E2E8F0;
  margin-top: 0.75rem;
  margin-bottom: 0.25rem;
  line-height: 1.4;
}

/* Paragraphs and Text */
.tiptap p {
  margin: 0.35rem 0;
}

/* Lists */
.tiptap ul:not([data-type="taskList"]) {
  list-style-type: disc;
  padding-left: 1.25rem;
  margin: 0.5rem 0;
}

.tiptap ol {
  list-style-type: decimal;
  padding-left: 1.25rem;
  margin: 0.5rem 0;
}

.tiptap li {
  margin: 0.15rem 0;
}

/* Interactive Checklist (Task List) */
.tiptap ul[data-type="taskList"] {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
}

.tiptap ul[data-type="taskList"] li[data-type="taskItem"] {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin: 0.35rem 0;
}

.tiptap ul[data-type="taskList"] li[data-type="taskItem"] > label {
  user-select: none;
  margin-top: 0.15rem;
}

.tiptap ul[data-type="taskList"] li[data-type="taskItem"] > label input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1rem;
  height: 1rem;
  border-radius: 0.25rem;
  background-color: #0B0F17;
  border: 1.5px solid #4B5563;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  margin: 0;
}

.tiptap ul[data-type="taskList"] li[data-type="taskItem"] > label input[type="checkbox"]:checked {
  background-color: #6366F1;
  border-color: #6366F1;
  background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
}

.tiptap ul[data-type="taskList"] li[data-type="taskItem"][data-checked="true"] > div {
  text-decoration: line-through;
  color: #64748B;
}

.tiptap ul[data-type="taskList"] li[data-type="taskItem"] > div {
  flex: 1 1 auto;
  min-width: 0;
}

/* Callout Box Node */
.callout-box {
  border-radius: 1rem;
  padding: 0.875rem 1rem;
  margin: 0.75rem 0;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  border: 1px solid rgba(99, 102, 241, 0.3);
  background: rgba(15, 23, 42, 0.85);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
}

.callout-box.callout-warning {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(26, 20, 8, 0.85);
}

.callout-box.callout-success {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(6, 26, 20, 0.85);
}

.callout-box.callout-tip {
  border-color: rgba(168, 85, 247, 0.4);
  background: rgba(22, 11, 36, 0.85);
}

/* Tables */
.tiptap table {
  border-collapse: collapse;
  margin: 1rem 0;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  overflow: hidden;
}

.tiptap th, .tiptap td {
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.6rem 0.8rem;
  background-color: rgba(15, 23, 42, 0.4);
}

.tiptap th {
  background-color: rgba(15, 23, 42, 0.8);
  font-weight: 700;
  color: #FFFFFF;
}

.tiptap td.selectedCell, .tiptap th.selectedCell {
  background: rgba(99, 102, 241, 0.2);
}

/* Code and Monospace */
.tiptap code {
  background-color: #1F2937;
  padding: 0.15rem 0.35rem;
  border-radius: 0.35rem;
  color: #A5B4FC;
  font-family: var(--font-mono);
  font-size: 0.85em;
}

.tiptap pre {
  background-color: #070A12;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: #C7D2FE;
  margin: 0.75rem 0;
  overflow-x: auto;
}

.tiptap pre code {
  background: transparent;
  padding: 0;
  border-radius: 0;
  color: inherit;
}

/* Blockquote */
.tiptap blockquote {
  border-left: 2px solid #6366F1;
  padding-left: 0.875rem;
  margin: 0.75rem 0;
  color: #94A3B8;
  font-style: italic;
  background: rgba(99, 102, 241, 0.04);
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  border-radius: 0 0.5rem 0.5rem 0;
}

/* Mention Chips */
.tiptap .mention-chip,
.mention-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.04);
  color: #C4C3BE;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.tiptap .mention-chip:hover,
.mention-chip:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.14);
  color: #EDECE8;
}

/* Slash Command and Bubble Menus */
#slash-command-menu {
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 25px rgba(99, 102, 241, 0.15);
}

#neurofy-bubble-menu .bubble-btn.is-active {
  background-color: rgba(99, 102, 241, 0.3);
  color: #FFFFFF;
  border: 1px solid rgba(99, 102, 241, 0.4);
}

/* ==========================================================================
   Flatpickr Linear Dark Theme
   ========================================================================== */

.flatpickr-calendar {
  background: #0B0F19 !important;
  border: 1px solid #1F2937 !important;
  border-radius: 1rem !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.04) !important;
  padding: 0.35rem !important;
}

.flatpickr-months {
  background: transparent !important;
}

.flatpickr-current-month {
  color: #F9FAFB !important;
  font-weight: 600 !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year {
  color: #F9FAFB !important;
  background: transparent !important;
  font-weight: 600 !important;
}

.flatpickr-weekdays {
  background: transparent !important;
}

span.flatpickr-weekday {
  color: #9CA3AF !important;
  font-weight: 600 !important;
}

.flatpickr-day {
  color: #D1D5DB !important;
  border-radius: 0.75rem !important;
  border: none !important;
}

.flatpickr-day:hover,
.flatpickr-day:focus {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #FFFFFF !important;
}

.flatpickr-day.today {
  border: 1px solid rgba(99, 102, 241, 0.45) !important;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
  background: #4F46E5 !important;
  color: #FFFFFF !important;
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.35) !important;
}

.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
  color: #6B7280 !important;
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
  color: #9CA3AF !important;
  fill: #9CA3AF !important;
}

.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
  color: #FFFFFF !important;
  fill: #FFFFFF !important;
}

.neurofy-date-field input.flatpickr-input,
.neurofy-date-field input[type="date"],
.neurofy-date-field input.datepicker-input {
  padding-right: 2.25rem;
}

.neurofy-date-field [data-date-picker-trigger] {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  color: #6B7280;
  padding: 0.25rem;
  border-radius: 0.5rem;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.neurofy-date-field [data-date-picker-trigger]:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.08);
}

/* Quick Access Companion Bar and Launcher Rail */
@keyframes companionEntrance {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.companion-bar-track {
  animation: companionEntrance 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.companion-btn {
  transform: translateZ(0);
  backface-visibility: hidden;
  will-change: transform, box-shadow;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

@media (prefers-reduced-motion: reduce) {
  .companion-bar-track,
  .companion-btn,
  .companion-btn i {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}

/* Tippy.js Executive Obsidian Theme */
.tippy-box[data-theme~='obsidian'] {
  background-color: #101114;
  color: #EDECE8;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 0.875rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7), 0 2px 8px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  font-size: 0.75rem;
  line-height: 1.4;
  max-width: 440px !important;
  padding: 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.tippy-box[data-theme~='obsidian'] .tippy-content {
  padding: 0.875rem 1rem;
}

.tippy-box[data-theme~='obsidian'] .tippy-arrow {
  color: #101114;
}

.tippy-box[data-theme~='obsidian'] .tippy-arrow::before {
  border-color: rgba(255, 255, 255, 0.09);
}

@media (prefers-reduced-motion: reduce) {
  .tippy-box[data-theme~='obsidian'] {
    transition: none !important;
    animation: none !important;
  }
}
