/* ─── Feedback Widget ─── */
/* All classes prefixed .jh-fb- to avoid collisions */

/* ─── Theming: override these custom properties in your own CSS ─── */
:root {
  --jh-fb-accent: #ea4e1b;
  --jh-fb-accent-hover: #d4431a;
  --jh-fb-accent-shadow: rgba(234, 78, 27, 0.4);
  --jh-fb-accent-shadow-hover: rgba(234, 78, 27, 0.5);
  --jh-fb-accent-light: rgba(234, 78, 27, 0.15);
  --jh-fb-font-heading: "Outfit", "Plus Jakarta Sans", sans-serif;
  --jh-fb-font-body: "Source Sans 3", Inter, sans-serif;
}

/* Floating trigger button */
.jh-fb-btn {
  position: fixed !important;
  bottom: 24px !important;
  right: 24px !important;
  z-index: 9999 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 12px 22px !important;
  background: var(--jh-fb-accent) !important;
  color: #fff !important;
  font-family: var(--jh-fb-font-heading) !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  border: none !important;
  border-radius: 999px !important;
  cursor: pointer !important;
  box-shadow: 0 4px 14px var(--jh-fb-accent-shadow) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
  line-height: 1 !important;
  text-decoration: none !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  outline: none !important;
}
.jh-fb-btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px var(--jh-fb-accent-shadow-hover) !important;
  background: var(--jh-fb-accent) !important;
  color: #fff !important;
  text-decoration: none !important;
}
.jh-fb-btn:active {
  transform: translateY(0) !important;
}
.jh-fb-btn svg {
  width: 18px !important;
  height: 18px !important;
  flex-shrink: 0 !important;
}

/* ─── Crop overlay (screenshot + crosshair) ─── */
.jh-fb-crop-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(17, 13, 36, 0.95);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Instruction banner (shared between select + crop) */
.jh-fb-select-banner {
  position: relative;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 20px;
  background: #1a1535;
  color: #fff;
  font-family: var(--jh-fb-font-body);
  font-size: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}
.jh-fb-select-sep {
  color: #666;
  font-size: 12px;
}
.jh-fb-skip-btn {
  padding: 6px 14px;
  background: transparent;
  color: var(--jh-fb-accent);
  border: 1px solid var(--jh-fb-accent);
  border-radius: 6px;
  font-family: var(--jh-fb-font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.jh-fb-skip-btn:hover {
  background: var(--jh-fb-accent);
  color: #fff;
}
.jh-fb-select-cancel {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}
.jh-fb-select-cancel:hover {
  color: #fff;
}
.jh-fb-select-cancel svg {
  width: 18px;
  height: 18px;
}

/* Screenshot image area */
.jh-fb-crop-img-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 16px;
  cursor: crosshair;
}
.jh-fb-crop-img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 6px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}

/* Drag highlight rectangle */
.jh-fb-highlight {
  position: fixed;
  display: none;
  border: 2px solid var(--jh-fb-accent);
  background: var(--jh-fb-accent-light);
  border-radius: 3px;
  pointer-events: none;
  z-index: 10002;
}

/* ─── Feedback form (bottom-right panel) ─── */
.jh-fb-form {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10001;
  width: 380px;
  max-width: calc(100vw - 32px);
  background: #1a1535;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  padding: 20px;
  animation: jh-fb-slide-up 0.25s ease;
}
@keyframes jh-fb-slide-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.jh-fb-form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.jh-fb-form-title {
  font-family: var(--jh-fb-font-heading);
  font-weight: 700;
  font-size: 18px;
  color: #fff;
  margin: 0;
}
.jh-fb-form-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #666;
  cursor: pointer;
  border-radius: 6px;
  padding: 0;
  transition: background 0.15s, color 0.15s;
}
.jh-fb-form-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.jh-fb-form-close svg {
  width: 16px;
  height: 16px;
}
.jh-fb-form-subtitle {
  font-family: var(--jh-fb-font-body);
  font-size: 13px;
  color: #888;
  margin: 0 0 14px;
}

/* ─── Category pill selector ─── */
.jh-fb-category-bar {
  margin-bottom: 12px;
}
.jh-fb-category-label {
  display: block;
  font-family: var(--jh-fb-font-body);
  font-size: 12px;
  color: #888;
  margin-bottom: 6px;
}
.jh-fb-category-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.jh-fb-category-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: #211c3a;
  color: #aaa;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  font-family: var(--jh-fb-font-body);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  line-height: 1;
}
.jh-fb-category-pill svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.jh-fb-category-pill:hover {
  background: #333;
  color: #ddd;
  border-color: #666;
}
.jh-fb-category-pill--active {
  background: var(--jh-fb-accent);
  color: #fff;
  border-color: var(--jh-fb-accent);
}
.jh-fb-category-pill--active:hover {
  background: var(--jh-fb-accent-hover);
  border-color: var(--jh-fb-accent-hover);
  color: #fff;
}

/* Screenshot thumbnail in form */
.jh-fb-thumb-wrap {
  margin-bottom: 12px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  background: #110d24;
}
.jh-fb-thumb {
  display: block;
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  object-position: center;
}

.jh-fb-textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px;
  background: #211c3a;
  color: #eee;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  font-family: var(--jh-fb-font-body);
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.jh-fb-textarea:focus {
  outline: none;
  border-color: var(--jh-fb-accent);
}
.jh-fb-textarea::placeholder {
  color: #666;
}

/* Error state for textarea (toggled by JS) */
.jh-fb-textarea-error {
  border-color: var(--jh-fb-accent);
}

.jh-fb-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.jh-fb-submit {
  flex: 1;
  padding: 10px 18px;
  background: var(--jh-fb-accent);
  color: #fff;
  font-family: var(--jh-fb-font-heading);
  font-weight: 600;
  font-size: 14px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}
.jh-fb-submit:hover {
  background: var(--jh-fb-accent-hover);
}
.jh-fb-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.jh-fb-cancel {
  padding: 10px 18px;
  background: transparent;
  color: #999;
  font-family: var(--jh-fb-font-body);
  font-weight: 500;
  font-size: 14px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.jh-fb-cancel:hover {
  color: #fff;
  border-color: #888;
}
.jh-fb-hint {
  font-family: var(--jh-fb-font-body);
  font-size: 11px;
  color: #555;
  margin: 8px 0 0;
}

/* ─── Success toast ─── */
.jh-fb-toast {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 10002;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: #1a1535;
  border: 1px solid #2a2d31;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  animation: jh-fb-slide-up 0.25s ease;
}
.jh-fb-toast-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 185, 129, 0.15);
  border-radius: 50%;
  flex-shrink: 0;
}
.jh-fb-toast-icon svg {
  width: 18px;
  height: 18px;
  color: #10b981;
}
.jh-fb-toast-text {
  font-family: var(--jh-fb-font-heading);
  font-weight: 600;
  font-size: 14px;
  color: #fff;
}

/* ─── Review Mode — pin overlay ─── */
.jh-fb-review-toolbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  background: #1a1535;
  color: #fff;
  font-family: var(--jh-fb-font-body);
  font-size: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  animation: jh-fb-slide-down 0.2s ease;
}
@keyframes jh-fb-slide-down {
  from { opacity: 0; transform: translateY(-100%); }
  to   { opacity: 1; transform: translateY(0); }
}
.jh-fb-review-count {
  flex: 1;
  font-weight: 600;
}
.jh-fb-review-new {
  padding: 6px 16px;
  background: var(--jh-fb-accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-family: var(--jh-fb-font-heading);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}
.jh-fb-review-new:hover {
  background: var(--jh-fb-accent-hover);
}
.jh-fb-review-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}
.jh-fb-review-close:hover { color: #fff; }
.jh-fb-review-close svg { width: 18px; height: 18px; }

/* Pin container */
.jh-fb-pin-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  z-index: 9997;
  pointer-events: none;
}

/* Individual pin circle */
.jh-fb-pin {
  position: absolute;
  width: 28px;
  height: 28px;
  margin-left: -14px;
  margin-top: -14px;
  background: var(--jh-fb-accent);
  color: #fff;
  font-family: var(--jh-fb-font-heading);
  font-weight: 700;
  font-size: 12px;
  line-height: 28px;
  text-align: center;
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s;
  z-index: 9997;
}
.jh-fb-pin:hover {
  transform: scale(1.2);
  z-index: 9998;
}

/* Tooltip on hover */
.jh-fb-pin-tooltip {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 8px;
  width: 260px;
  padding: 10px 12px;
  background: #1a1535;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  color: #eee;
  font-family: var(--jh-fb-font-body);
  font-size: 12px;
}
.jh-fb-pin:hover .jh-fb-pin-tooltip { display: block; }

.jh-fb-pin-tooltip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.jh-fb-pin-cat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  color: #ccc;
}
.jh-fb-pin-cat svg { width: 13px; height: 13px; }
.jh-fb-pin-status-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #999;
  font-size: 11px;
}
.jh-fb-pin-status {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.jh-fb-pin-tooltip-text {
  margin: 0 0 6px;
  color: #ccc;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.jh-fb-pin-tooltip-date {
  color: #666;
  font-size: 11px;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .jh-fb-btn {
    bottom: 16px;
    right: 16px;
    padding: 10px 18px;
    font-size: 13px;
  }
  .jh-fb-form {
    bottom: 16px;
    right: 16px;
    width: calc(100vw - 32px);
  }
  .jh-fb-select-banner {
    font-size: 12px;
    gap: 8px;
    padding: 10px 16px;
  }
}

/* ─── Reduced motion ─── */
@media (prefers-reduced-motion: reduce) {
  .jh-fb-btn,
  .jh-fb-skip-btn,
  .jh-fb-select-cancel,
  .jh-fb-form-close,
  .jh-fb-submit,
  .jh-fb-cancel,
  .jh-fb-textarea {
    transition: none;
  }
  .jh-fb-form,
  .jh-fb-toast,
  .jh-fb-review-toolbar {
    animation: none;
  }
  .jh-fb-pin {
    transition: none;
  }
}
