/* Annotations page */
.annotations-page {
  display: flex;
  gap: var(--space-lg);
}

.annotations-content {
  flex: 1;
  min-width: 0;
}

.annotations-sidebar {
  width: 320px;
  flex-shrink: 0;
}

/* Read-only editor for annotations */
.annotation-editor-wrap {
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.annotation-editor-wrap .ql-toolbar {
  display: none;
}

.annotation-editor-wrap .ql-container {
  border: none;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  min-height: 500px;
}

.annotation-editor-wrap .ql-editor {
  padding: var(--space-xl) var(--space-2xl);
  line-height: 1.8;
  cursor: text;
}

/* Floating annotation toolbar */
.annotation-toolbar {
  position: absolute;
  background: var(--color-navy);
  color: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: flex;
  gap: 4px;
  z-index: 50;
  transform: translateX(-50%);
}

.annotation-toolbar.hidden {
  display: none;
}

.annotation-toolbar button {
  background: transparent;
  color: var(--color-white);
  padding: 6px 10px;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.annotation-toolbar button:hover {
  background: var(--color-navy-light);
}

.annotation-toolbar button.highlight-btn { color: #fbbf24; }
.annotation-toolbar button.rewrite-btn { color: #f87171; }
.annotation-toolbar button.comment-btn { color: #60a5fa; }

/* Annotation highlights in text */
.ql-editor .highlight-yellow {
  background-color: var(--color-highlight-yellow);
  cursor: pointer;
}

.ql-editor .highlight-red {
  background-color: var(--color-highlight-red);
  cursor: pointer;
}

.ql-editor .highlight-blue {
  background-color: var(--color-highlight-blue);
  cursor: pointer;
}

/* Sidebar annotations list */
.annotation-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}

.annotation-list-header h3 {
  font-size: 1rem;
}

.annotation-card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: var(--space-md);
  margin-bottom: var(--space-sm);
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
}

.annotation-card:hover {
  box-shadow: var(--shadow-md);
}

.annotation-card.type-highlight {
  border-left-color: #fbbf24;
}

.annotation-card.type-rewrite {
  border-left-color: #ef4444;
}

.annotation-card.type-comment {
  border-left-color: #3b82f6;
}

.annotation-card .selected-text {
  font-style: italic;
  font-size: 0.8rem;
  color: var(--color-gray-500);
  margin-bottom: var(--space-sm);
  max-height: 40px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.annotation-card .comment-text {
  font-size: 0.85rem;
  color: var(--color-navy);
  margin-bottom: var(--space-sm);
}

.annotation-card .annotation-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.7rem;
  color: var(--color-gray-400);
}

.annotation-card .annotation-actions {
  display: flex;
  gap: var(--space-xs);
}

/* Comment input form (inline) */
.annotation-comment-form {
  margin-top: var(--space-md);
  padding: var(--space-md);
  background: var(--color-offwhite);
  border-radius: var(--radius-md);
}

.annotation-comment-form textarea {
  width: 100%;
  min-height: 80px;
  resize: vertical;
  margin-bottom: var(--space-sm);
}

.annotation-comment-form .form-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
}

@media (max-width: 900px) {
  .annotations-page {
    flex-direction: column;
  }
  .annotations-sidebar {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .annotation-editor-wrap .ql-editor {
    padding: var(--space-md);
  }

  .annotation-toolbar {
    flex-wrap: wrap;
    max-width: 280px;
  }

  .annotation-toolbar button {
    font-size: 0.7rem;
    padding: 5px 8px;
  }

  .annotation-card {
    padding: var(--space-sm);
  }

  .annotation-card .annotation-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-xs);
  }
}
