/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* TipTap Editor Styles */
.tiptap {
  outline: none;
}
.tiptap p.is-editor-empty:first-child::before {
  color: #adb5bd;
  content: attr(data-placeholder);
  float: left;
  height: 0;
  pointer-events: none;
}
.tiptap table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
}
.tiptap table td,
.tiptap table th {
  border: 1px solid #d1d5db;
  padding: 0.5rem;
  min-width: 80px;
  vertical-align: top;
}
.tiptap table th {
  background-color: #f3f4f6;
  font-weight: 600;
}
.tiptap img,
.ProseMirror img {
  display: block;
  max-width: 100%;
  height: auto;
  min-height: 1.5rem;
  margin: 0.5rem 0;
}

/* TipTap Maximize */
.tiptap-maximized {
  position: fixed !important;
  inset: 0 !important;
  z-index: 90 !important;
  background: white;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  gap: 0;
  overflow: hidden;
}
.tiptap-maximized > label { display: none; }
.tiptap-maximized [data-tiptap-editor-target="toolbar"] {
  flex-shrink: 0;
  border-radius: 0.375rem 0.375rem 0 0;
}
.tiptap-maximized [data-tiptap-editor-target="editor"],
.tiptap-maximized [data-tiptap-editor-target="source"] {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  border-radius: 0 0 0.375rem 0.375rem;
}
.tiptap-maximized .tiptap-expand-icon { display: none; }
.tiptap-maximized .tiptap-compress-icon { display: block !important; }

/* Clearfix after floated images in TipTap */
.ProseMirror p:has(+ [data-resize-container][style*="float"])::after,
.ProseMirror > [data-resize-container][style*="float"] + * {
  clear: both;
}
.ProseMirror::after {
  content: "";
  display: table;
  clear: both;
}

/* Image Resize NodeView */
[data-resize-container] {
  position: relative;
  max-width: 100%;
  margin: 0.5rem 0;
  line-height: 0;
}

/* Hover edit button */
.tiptap-image-edit-btn {
  display: none;
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 30;
  width: 28px;
  height: 28px;
  background: rgba(0, 0, 0, 0.55);
  border: none;
  border-radius: 6px;
  color: white;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}
.tiptap-image-edit-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}
[data-resize-container]:hover .tiptap-image-edit-btn {
  display: flex;
}
/* Hide edit button when image is still loading */
[data-resize-container][style*="visibility: hidden"] .tiptap-image-edit-btn {
  display: none !important;
}
[data-resize-wrapper] {
  line-height: 0;
}
[data-resize-wrapper] img {
  margin: 0;
  display: block;
  max-width: 100%;
  height: auto;
}
[data-resize-handle] {
  display: none;
  width: 10px;
  height: 10px;
  background: white;
  border: 2px solid #3b82f6;
  border-radius: 2px;
  z-index: 20;
  box-sizing: border-box;
}
[data-resize-handle="top-left"]     { cursor: nw-resize; transform: translate(-50%, -50%); }
[data-resize-handle="top-right"]    { cursor: ne-resize; transform: translate(50%, -50%); }
[data-resize-handle="bottom-left"]  { cursor: sw-resize; transform: translate(-50%, 50%); }
[data-resize-handle="bottom-right"] { cursor: se-resize; transform: translate(50%, 50%); }
[data-resize-container].ProseMirror-selectednode [data-resize-handle] {
  display: block;
}
[data-resize-container].ProseMirror-selectednode [data-resize-wrapper] img {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}
.tiptap code,
.ProseMirror code {
  background-color: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 0.25rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.875em;
  padding: 0.1em 0.4em;
  color: #dc2626;
}
.ProseMirror code::before,
.ProseMirror code::after {
  content: none;
}
.tiptap blockquote {
  border-left: 3px solid #d1d5db;
  padding-left: 1rem;
  margin: 1rem 0;
  color: #6b7280;
}
.tiptap hr {
  border: none;
  border-top: 1px solid #d1d5db;
  margin: 1.5rem 0;
}
.tiptap ul { list-style-type: disc; padding-left: 1.5rem; }
.tiptap ol { list-style-type: decimal; padding-left: 1.5rem; }
.tiptap h1 { font-size: 1.875rem; font-weight: 700; margin: 0.5rem 0; }
.tiptap h2 { font-size: 1.5rem; font-weight: 700; margin: 0.5rem 0; }
.tiptap h3 { font-size: 1.25rem; font-weight: 600; margin: 0.5rem 0; }

/* Open conference row border */
tr.bg-green-100 td { border-top: 1px solid #86efac; border-bottom: 1px solid #86efac; }
tr.bg-green-100 td:first-child { border-left: 1px solid #86efac; }
tr.bg-green-100 td:last-child { border-right: 1px solid #86efac; }

/* Image alignment in rendered TipTap content (data-display attribute) */
.tiptap img[data-display="center"] { margin-left: auto; margin-right: auto; }
.tiptap img[data-display="right"]  { margin-left: auto; margin-right: 0; }

/* Prose table: cell borders and th background */
.prose table { border-collapse: collapse; width: 100%; }
.prose th,
.prose td { border: 1px solid #d1d5db; padding: 0.5rem 0.75rem; }
.prose th { background-color: #f3f4f6; }
.prose th p,
.prose td p { margin: 0; }

/* Current conference row dashed border */
tr.current-conf td { border-top: 2px dashed #60a5fa; border-bottom: 2px dashed #60a5fa; background-color: #dbeafe; }
tr.current-conf td:first-child { border-left: 2px dashed #60a5fa; }
tr.current-conf td:last-child { border-right: 2px dashed #60a5fa; }

/* Admin Help Tag (inline code-like badge) */
.help-tag {
  display: inline-block;
  background-color: #6b7280;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  border: none;
  vertical-align: middle;
  white-space: nowrap;
}

/* Admin Help Modal Content */
.admin-help-content h5 { font-size: 1rem; font-weight: 700; margin-bottom: 0.75rem; color: #111827; }
.admin-help-content h6 { font-size: 0.875rem; font-weight: 700; margin-top: 1rem; margin-bottom: 0.5rem; color: #374151; }
.admin-help-content p { margin-bottom: 0.5rem; }
.admin-help-content ul { list-style-type: disc; padding-left: 1.5rem; margin-bottom: 0.5rem; }
.admin-help-content ol { list-style-type: decimal; padding-left: 1.5rem; margin-bottom: 0.5rem; }
.admin-help-content li { margin-bottom: 0.25rem; }
.admin-help-content ul ul { list-style-type: circle; margin-top: 0.25rem; }
