.tiptap-editor-container {
  border: 1px solid #495057;
  border-radius: 0.375rem;
  background-color: #212529;
  margin-bottom: 1rem;
}

.tiptap-toolbar {
  border-bottom: 1px solid #495057;
  padding: 0.5rem;
  background-color: #2f3133;
  border-radius: 0.375rem 0.375rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.tiptap-toolbar .btn {
  border-color: #495057;
  color: #adb5bd;
  background-color: transparent;
  font-size: 0.875rem;
  padding: 0.25rem 0.5rem;
}

.tiptap-toolbar .btn:hover {
  background-color: #495057;
  color: #fff;
  border-color: #6c757d;
}

.tiptap-toolbar .btn.active {
  background-color: #5C94FE;
  border-color: #5C94FE;
  color: #fff;
}

.tiptap-toolbar .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.tiptap-editor-content {
  min-height: 200px;
  padding: 1rem;
  color: #adb5bd;
  background-color: #212529;
  border-radius: 0 0 0.375rem 0.375rem;
}

.tiptap-editor-content .ProseMirror {
  outline: none;
  min-height: 150px;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  color: inherit;
}

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

.tiptap-editor-content .ProseMirror h1,
.tiptap-editor-content .ProseMirror h2,
.tiptap-editor-content .ProseMirror h3,
.tiptap-editor-content .ProseMirror h4,
.tiptap-editor-content .ProseMirror h5,
.tiptap-editor-content .ProseMirror h6 {
  color: #fff;
  font-weight: 600;
  margin: 1rem 0 0.5rem 0;
}

.tiptap-editor-content .ProseMirror h1 {
  font-size: 2rem;
}

.tiptap-editor-content .ProseMirror h2 {
  font-size: 1.5rem;
}

.tiptap-editor-content .ProseMirror h3 {
  font-size: 1.25rem;
}

.tiptap-editor-content .ProseMirror p {
  margin: 0.5rem 0;
}

.tiptap-editor-content .ProseMirror ul,
.tiptap-editor-content .ProseMirror ol {
  padding-left: 1.5rem;
  margin: 0.5rem 0;
}

.tiptap-editor-content .ProseMirror li {
  margin: 0.25rem 0;
}

.tiptap-editor-content .ProseMirror blockquote {
  border-left: 4px solid #5C94FE;
  padding-left: 1rem;
  margin: 1rem 0;
  color: #ced4da;
  font-style: italic;
}

.tiptap-editor-content .ProseMirror code {
  background-color: #495057;
  color: #f8f9fa;
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.875rem;
}

.tiptap-editor-content .ProseMirror pre {
  background-color: #343a40;
  color: #f8f9fa;
  padding: 1rem;
  border-radius: 0.375rem;
  overflow-x: auto;
  margin: 1rem 0;
}

.tiptap-editor-content .ProseMirror pre code {
  background-color: transparent;
  padding: 0;
}

.tiptap-editor-content .ProseMirror hr {
  border: none;
  border-top: 2px solid #495057;
  margin: 2rem 0;
}

.tiptap-editor-content .ProseMirror strong {
  font-weight: 600;
  color: #fff;
}

.tiptap-editor-content .ProseMirror em {
  font-style: italic;
}

.tiptap-editor-content .ProseMirror s {
  text-decoration: line-through;
}

/* Focus styles */
.tiptap-editor-container:focus-within {
  border-color: #5C94FE;
  box-shadow: 0 0 0 0.2rem rgba(92, 148, 254, 0.25);
}

/* Collaboration header */
.tiptap-collab-header {
  border-radius: 0.375rem 0.375rem 0 0;
}

.collab-cursor {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Collaboration caret indicators in editor (TipTap v3) */
.ProseMirror .collaboration-carets__caret {
  border-left-width: 2px !important;
  border-left-style: solid !important;
  border-right: none !important;
  border-top: none !important;
  border-bottom: none !important;
  margin-left: -1px;
  margin-right: -1px;
  pointer-events: none;
  position: relative;
  word-break: normal;
  display: inline-block;
  height: 1.2em;
}

.ProseMirror .collaboration-carets__label {
  border-radius: 3px 3px 3px 0;
  color: white !important;
  font-size: 12px !important;
  font-style: normal !important;
  font-weight: 600 !important;
  left: -2px;
  line-height: 1.2 !important;
  padding: 0.1rem 0.3rem !important;
  position: absolute;
  top: -1.4em;
  user-select: none;
  white-space: nowrap;
  z-index: 10;
  display: block !important;
  width: auto !important;
  height: auto !important;
}

/* Legacy support for collaboration-cursor (in case some components still use it) */
.tiptap-editor-content .ProseMirror .collaboration-cursor__caret {
  border-left: 2px solid var(--caret-color);
  border-right: none;
  margin-left: -1px;
  margin-right: -1px;
  pointer-events: none;
  position: relative;
  word-break: normal;
}

.tiptap-editor-content .ProseMirror .collaboration-cursor__label {
  background-color: var(--caret-color);
  border-radius: 3px 3px 3px 0;
  color: white;
  font-size: 12px !important;
  font-style: normal;
  font-weight: 600;
  left: -1px;
  line-height: 1.2 !important;
  padding: 0.1rem 0.3rem;
  position: absolute;
  top: -1.4em;
  user-select: none;
  white-space: nowrap;
  z-index: 10;
}

/* Responsive toolbar */
@media (max-width: 576px) {
  .tiptap-toolbar {
    padding: 0.25rem;
  }
  
  .tiptap-toolbar .btn {
    padding: 0.1875rem 0.375rem;
    font-size: 0.8125rem;
  }
  
  .tiptap-editor-content {
    padding: 0.75rem;
  }
  
  .collab-cursor {
    width: 20px;
    height: 20px;
    font-size: 0.625rem;
  }
}

/* Save Status Fade Transitions */
.fade-enter-active, .fade-leave-active {
  transition: opacity 0.3s ease;
}

.fade-enter-from, .fade-leave-to {
  opacity: 0;
}

/* Save Indicator Styles */
.save-indicator {
  position: relative;
}

.save-popover {
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 10px;
  min-width: 250px;
  z-index: 1000;
}

/* Document Table Column Widths */
.documents-table {
  table-layout: fixed;
}

.documents-table .col-name {
  width: 30%;
}

.documents-table .col-type {
  width: 10%;
}

.documents-table .col-owner {
  width: 15%;
}

.documents-table .col-access {
  width: 15%;
}

.documents-table .col-modified {
  width: 15%;
}

.documents-table .col-actions {
  width: 15%;
}

/* Bubble Menu Styles */
.bubble-menu {
  background: var(--bs-dark, #212529);
  border: 1px solid var(--bs-secondary, #6c757d);
  border-radius: 0.375rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  padding: 0.25rem;
  z-index: 1000;
  position: absolute;
  
  /* Let TipTap control visibility through positioning */
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

/* When TipTap shows the bubble menu */
.bubble-menu[data-show],
.bubble-menu.is-active,
.bubble-menu[style*="visibility: visible"] {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.bubble-menu .btn-group {
  background: transparent;
}

.bubble-menu .btn {
  border-color: var(--bs-secondary, #6c757d);
  color: var(--bs-light, #f8f9fa);
  background-color: transparent;
  font-size: 0.875rem;
  padding: 0.25rem 0.5rem;
  border-width: 1px;
}

.bubble-menu .btn:hover {
  background-color: var(--bs-secondary, #6c757d);
  color: #fff;
  border-color: var(--bs-light, #f8f9fa);
}

.bubble-menu .btn.active {
  background-color: #5C94FE;
  border-color: #5C94FE;
  color: #fff;
}

.bubble-menu .btn:focus {
  box-shadow: 0 0 0 0.2rem rgba(92, 148, 254, 0.25);
}

/* Ensure bubble menu appears above other elements */
.bubble-menu {
  position: absolute !important;
}