/* Annotation system — block-level annotations for blog articles */

.annotatable {
  cursor: pointer;
  transition: background 0.15s ease;
  border-left: 3px solid transparent;
  padding-left: 6px;
  position: relative;
}

.annotatable:hover {
  background: rgba(26, 115, 232, 0.04);
  border-left-color: #ccc;
}

.annotated {
  border-left-width: 3px;
  border-left-style: solid;
}

/* Color coding by emoji type */
.annotated-emoji-yes { border-left-color: #2e7d32; }
.annotated-emoji-x { border-left-color: #c62828; }
.annotated-emoji-pileOfPoo { border-left-color: #e65100; }
.annotated-emoji-wrench { border-left-color: #1565c0; }
.annotated-emoji-star { border-left-color: #f9a825; }
.annotated-emoji-clipboard { border-left-color: #6a1b9a; }
.annotated-emoji-magnifyingGlass { border-left-color: #00838f; }
.annotated-emoji-lightBulb { border-left-color: #fdd835; }
.annotated-emoji-prohibited { border-left-color: #d50000; }

.annotation-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  font-size: 13px;
  line-height: 1;
  border-radius: 3px;
  margin-left: 4px;
  cursor: pointer;
  user-select: none;
  vertical-align: middle;
  position: relative;
}

.annotation-badges {
  display: inline-flex;
  gap: 2px;
  margin-left: 4px;
  vertical-align: middle;
}

.annotation-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #222;
  color: #fff;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  z-index: 100;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.annotation-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -4px;
  border-width: 4px;
  border-style: solid;
  border-color: #222 transparent transparent transparent;
}

.annotation-badge:hover .annotation-tooltip {
  display: block;
}

/* Emoji picker - floating palette */
.annotation-picker {
  display: none;
  position: fixed;
  z-index: 200;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 6px 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.annotation-picker.visible {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  max-width: 300px;
}

.annotation-picker button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  font-size: 18px;
  line-height: 1;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fafafa;
  cursor: pointer;
  transition: background 0.1s;
}

.annotation-picker button:hover {
  background: #e0e0e0;
  border-color: #999;
}

.annotation-picker .picker-close {
  width: auto;
  font-size: 11px;
  padding: 2px 6px;
  margin-left: 4px;
  color: #666;
}

/* Comment modal */
.annotation-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 300;
  align-items: center;
  justify-content: center;
}

.annotation-modal-overlay.visible {
  display: flex;
}

.annotation-modal {
  background: #fff;
  border-radius: 8px;
  padding: 16px 20px;
  min-width: 300px;
  max-width: 440px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

.annotation-modal h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.annotation-modal .emoji-preview {
  font-size: 28px;
  display: block;
  margin-bottom: 8px;
}

.annotation-modal .meaning-label {
  font-size: 12px;
  color: #666;
  margin-bottom: 8px;
}

.annotation-modal input[type="text"],
.annotation-modal textarea {
  width: 100%;
  padding: 6px 8px;
  font: inherit;
  font-size: 13px;
  border: 1px solid #ccc;
  border-radius: 4px;
  margin-bottom: 8px;
  box-sizing: border-box;
}

.annotation-modal textarea {
  min-height: 60px;
  resize: vertical;
}

.annotation-modal .modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.annotation-modal .modal-actions button {
  font: inherit;
  font-size: 13px;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid #ccc;
  background: #f5f5f5;
}

.annotation-modal .modal-actions button.primary {
  background: #1a73e8;
  color: #fff;
  border-color: #1a73e8;
}

.annotation-modal .modal-actions button.primary:hover {
  background: #1557b0;
}

/* Skin-aware adjustments */
body.skin-skyblog .annotation-picker {
  border: 3px ridge #ff99cc;
  background: #ffe6f5;
}

body.skin-skyblog .annotation-picker button {
  border: 2px outset #ff99dd;
  background: #fff0f5;
}

body.skin-skyblog .annotation-modal {
  border: 4px groove #ff99dd;
  background: #fffff0;
}
