/* Hive Feedback Widget Styles v1 */
/* All classes prefixed hf- to avoid collisions */

/* Per-message feedback toolbar */
.hf-msg-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.message.assistant:hover .hf-msg-toolbar,
.hf-msg-toolbar.hf-voted {
  opacity: 1;
}

.hf-thumb {
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  color: #888;
  transition: all 0.15s ease;
  line-height: 1;
}

.hf-thumb:hover {
  background: rgba(128, 128, 128, 0.15);
  border-color: rgba(128, 128, 128, 0.3);
  color: #555;
}

.hf-thumb.hf-selected {
  border-color: transparent;
  opacity: 1;
}

.hf-thumb.hf-up.hf-selected {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
}

.hf-thumb.hf-down.hf-selected {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.hf-thumb.hf-disabled {
  pointer-events: none;
  opacity: 0.4;
}

/* Downvote text input */
.hf-downvote-form {
  display: none;
  margin-top: 6px;
  gap: 6px;
  align-items: center;
}

.hf-downvote-form.hf-visible {
  display: flex;
}

.hf-downvote-input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid rgba(128, 128, 128, 0.3);
  border-radius: 6px;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.03);
  color: inherit;
  outline: none;
  max-width: 300px;
}

.hf-downvote-input:focus {
  border-color: rgba(128, 128, 128, 0.5);
}

.hf-downvote-submit {
  padding: 5px 10px;
  border: none;
  border-radius: 6px;
  background: #ef4444;
  color: white;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
}

.hf-downvote-submit:hover {
  background: #dc2626;
}

.hf-downvote-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hf-error-indicator {
  font-size: 11px;
  color: #ef4444;
  padding: 4px 0;
}

.hf-sent-indicator {
  font-size: 11px;
  color: #22c55e;
  padding: 4px 0;
}

/* General feedback button (floating) */
.hf-general-btn {
  position: fixed;
  bottom: 100px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.4);
  transition: all 0.2s ease;
  z-index: 9990;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.hf-general-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.5);
}

/* General feedback modal */
.hf-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  animation: hf-fade-in 0.15s ease;
}

.hf-overlay.hf-visible {
  display: block;
}

@keyframes hf-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.hf-modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  width: 90%;
  max-width: 440px;
  z-index: 9999;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  animation: hf-slide-up 0.2s ease;
}

.hf-modal.hf-visible {
  display: block;
}

@keyframes hf-slide-up {
  from { transform: translate(-50%, -45%); opacity: 0; }
  to { transform: translate(-50%, -50%); opacity: 1; }
}

.hf-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.hf-modal-title {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
}

.hf-modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #888;
  padding: 0 4px;
  line-height: 1;
}

.hf-modal-close:hover {
  color: #333;
}

.hf-form-group {
  margin-bottom: 14px;
}

.hf-form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #555;
  margin-bottom: 6px;
}

.hf-category-select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 13px;
  background: #fafafa;
  color: #333;
  outline: none;
}

.hf-category-select:focus {
  border-color: #6366f1;
}

.hf-message-textarea {
  width: 100%;
  min-height: 100px;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  background: #fafafa;
  color: #333;
  outline: none;
  box-sizing: border-box;
}

.hf-message-textarea:focus {
  border-color: #6366f1;
}

.hf-submit-btn {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.hf-submit-btn:hover {
  opacity: 0.9;
}

.hf-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hf-success-msg {
  text-align: center;
  color: #22c55e;
  font-size: 14px;
  padding: 20px 0;
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
  .hf-modal {
    background: #1e1e2e;
  }
  .hf-modal-title { color: #e0e0e0; }
  .hf-category-select, .hf-message-textarea {
    background: #2a2a3e;
    border-color: #444;
    color: #e0e0e0;
  }
  .hf-downvote-input {
    background: rgba(255, 255, 255, 0.05);
    color: #e0e0e0;
  }
}

/* Mobile responsive */
@media (max-width: 768px) {
  .hf-general-btn {
    bottom: 80px;
    right: 12px;
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  .hf-modal {
    width: 95%;
    padding: 18px;
  }
}
