/* ==============================================================================
 * EHSOLUTIONS DIRECT FEEDBACK PINNING STUDIO & QA SUITE
 * Visual Pin-and-Comment Feedback Dropper for AI Collaborative Direction
 * ============================================================================== */

/* Active Pin Dropper Mode Crosshair */
body.pin-mode-active,
body.pin-mode-active * {
  cursor: crosshair !important;
}

body.pin-mode-active .dev-mode-container,
body.pin-mode-active .dev-mode-container *,
body.pin-mode-active .feedback-pin-modal-backdrop,
body.pin-mode-active .feedback-pin-modal-card,
body.pin-mode-active .dev-drawer {
  cursor: default !important;
}

/* Explicit Interactive Cursors for Modal & Drawer */
body.pin-mode-active input,
body.pin-mode-active textarea,
body.pin-mode-active .pin-input,
body.pin-mode-active .pin-textarea,
.feedback-pin-modal-card input,
.feedback-pin-modal-card textarea,
.pin-input,
.pin-textarea {
  cursor: text !important;
  user-select: text !important;
  -webkit-user-select: text !important;
  pointer-events: auto !important;
}

body.pin-mode-active button,
body.pin-mode-active select,
body.pin-mode-active a,
body.pin-mode-active [role="button"],
.feedback-pin-modal-card button,
.feedback-pin-modal-card select,
.dev-drawer button {
  cursor: pointer !important;
  pointer-events: auto !important;
}

/* Hover Target Highlight */
.dev-pin-target-highlight {
  outline: 2.5px dashed #F59E0B !important;
  outline-offset: 3px !important;
  background-color: rgba(245, 158, 11, 0.08) !important;
  transition: outline 0.1s ease, background-color 0.1s ease !important;
}

/* Floating Controls Container (Bottom Right) */
.dev-mode-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: var(--font-primary, system-ui, -apple-system, sans-serif);
}

.dev-floating-stack {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

/* Pin Mode Toggle Pill */
.dev-pin-launcher-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.1rem;
  background: #0F172A;
  color: #F8FAFC;
  border: 1.5px solid #334155;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.dev-pin-launcher-btn:hover {
  background: #1E293B;
  border-color: #F59E0B;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -4px rgba(245, 158, 11, 0.3);
}

.dev-pin-launcher-btn.active {
  background: #D97706;
  border-color: #F59E0B;
  color: #FFFFFF;
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.6);
  animation: pulsePinBtn 2s infinite ease-in-out;
}

@keyframes pulsePinBtn {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

.dev-pin-launcher-btn.active .dev-pin-badge {
  background: #FFFFFF;
  color: #92400E;
}

.dev-pin-icon {
  font-size: 0.95rem;
}

.dev-pin-badge {
  background: #F59E0B;
  color: #78350F;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.1rem 0.45rem;
  border-radius: 9999px;
  min-width: 16px;
  text-align: center;
}

/* Feedback Hub Launcher Pill */
.dev-launcher-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.1rem;
  background: #0F172A;
  color: #FFFFFF;
  border: 1.5px solid #334155;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.dev-launcher-btn:hover {
  background: #1E293B;
  border-color: #10B981;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -4px rgba(16, 185, 129, 0.3);
}

.dev-launcher-icon {
  font-size: 0.95rem;
}

.dev-launcher-dot {
  width: 8px;
  height: 8px;
  background: #10B981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10B981;
  animation: pulseGreenDot 2s infinite;
}

@keyframes pulseGreenDot {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

/* Feedback Pins Overlay */
.feedback-pins-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 100%;
  pointer-events: none;
  z-index: 9980;
}

/* Pulse animation for pin markers */
@keyframes pulse-pin-ring {
  0% {
    transform: translate(-50%, -50%) scale(0.95);
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
  }
  70% {
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 0 0 12px rgba(245, 158, 11, 0);
  }
  100% {
    transform: translate(-50%, -50%) scale(0.95);
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
  }
}

.ui-pin-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  width: 32px;
  height: 32px;
  background: #F59E0B;
  color: #78350F;
  border: 2.5px solid #FFFFFF;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8rem;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  animation: pulse-pin-ring 2s infinite ease-in-out;
  transition: transform 0.15s ease, background 0.15s ease;
  z-index: 9985;
}

.ui-pin-marker:hover {
  transform: translate(-50%, -50%) scale(1.25);
  background: #D97706;
  color: #FFFFFF;
}

.ui-pin-tooltip {
  position: absolute;
  bottom: calc(100% + 9px);
  left: 50%;
  transform: translateX(-50%);
  background: #0F172A;
  color: #F8FAFC;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-family: var(--font-primary, system-ui, sans-serif);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 10px 20px rgba(0,0,0,0.35);
  border: 1px solid #334155;
  z-index: 9995;
}

.ui-pin-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: #0F172A transparent transparent transparent;
}

.ui-pin-marker:hover .ui-pin-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-2px);
}

/* Feedback Pin Modal Dialog */
.feedback-pin-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 10000;
  animation: fadeIn 0.15s ease;
}

.feedback-pin-modal-card {
  width: 100%;
  max-width: 480px;
  background: #0F172A;
  color: #F8FAFC;
  border: 1.5px solid #334155;
  border-radius: 18px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  animation: slideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.feedback-pin-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem 1.35rem;
  background: #1E293B;
  border-bottom: 1px solid #334155;
}

.feedback-pin-modal-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.feedback-pin-modal-title h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  color: #F8FAFC;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.pin-num-tag {
  background: #F59E0B;
  color: #78350F;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, monospace;
}

.pin-modal-close-btn {
  background: transparent;
  border: none;
  color: #94A3B8;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

.pin-modal-close-btn:hover {
  color: #FFFFFF;
}

.feedback-pin-modal-body {
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.pin-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.pin-form-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #94A3B8;
}

/* Feedback Pin Modal Form Controls with High Specificity */
.feedback-pin-modal-card .pin-input,
.feedback-pin-modal-card .pin-readonly-input,
.feedback-pin-modal-card input[type="text"],
.pin-input {
  width: 100% !important;
  background: #1E293B !important;
  border: 1.5px solid #334155 !important;
  border-radius: 8px !important;
  padding: 0.75rem 0.9rem !important;
  color: #F8FAFC !important;
  -webkit-text-fill-color: #F8FAFC !important;
  font-family: inherit !important;
  font-size: 0.85rem !important;
  font-weight: 500 !important;
  outline: none !important;
  box-sizing: border-box !important;
  caret-color: #F59E0B !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease !important;
}

.feedback-pin-modal-card .pin-input:focus,
.feedback-pin-modal-card input[type="text"]:focus {
  border-color: #F59E0B !important;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25) !important;
  background: #0F172A !important;
}

.feedback-pin-modal-card .pin-select-input,
.feedback-pin-modal-card select,
.pin-select-input {
  width: 100% !important;
  background-color: #1E293B !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23F59E0B' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.9rem center !important;
  background-size: 1.1rem !important;
  padding-right: 2.5rem !important;
  border: 1.5px solid #334155 !important;
  border-radius: 8px !important;
  padding-top: 0.75rem !important;
  padding-bottom: 0.75rem !important;
  padding-left: 0.9rem !important;
  color: #F8FAFC !important;
  -webkit-text-fill-color: #F8FAFC !important;
  font-family: inherit !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  outline: none !important;
  box-sizing: border-box !important;
  cursor: pointer !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease !important;
}

.feedback-pin-modal-card .pin-select-input:focus,
.feedback-pin-modal-card select:focus {
  border-color: #F59E0B !important;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25) !important;
  background-color: #0F172A !important;
}

.feedback-pin-modal-card .pin-select-input option,
.feedback-pin-modal-card select option {
  background-color: #0F172A !important;
  color: #F8FAFC !important;
  padding: 0.5rem !important;
  font-weight: 500 !important;
}

.feedback-pin-modal-card .pin-textarea,
.feedback-pin-modal-card textarea,
.pin-textarea {
  width: 100% !important;
  background: #1E293B !important;
  border: 1.5px solid #334155 !important;
  border-radius: 8px !important;
  padding: 0.85rem !important;
  color: #F8FAFC !important;
  -webkit-text-fill-color: #F8FAFC !important;
  font-family: inherit !important;
  font-size: 0.875rem !important;
  outline: none !important;
  resize: vertical !important;
  box-sizing: border-box !important;
  line-height: 1.5 !important;
  caret-color: #F59E0B !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease !important;
}

.feedback-pin-modal-card .pin-textarea:focus,
.feedback-pin-modal-card textarea:focus {
  border-color: #F59E0B !important;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25) !important;
  background: #0F172A !important;
}

.feedback-pin-modal-card input::placeholder,
.feedback-pin-modal-card textarea::placeholder,
.pin-input::placeholder,
.pin-textarea::placeholder {
  color: #64748B !important;
  -webkit-text-fill-color: #64748B !important;
}

.feedback-pin-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.1rem 1.35rem;
  background: #1E293B;
  border-top: 1px solid #334155;
}

.pin-modal-actions-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.pin-btn-delete {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 8px;
  color: #F87171;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
}

.pin-btn-delete:hover {
  background: #EF4444;
  color: #FFFFFF;
  border-color: #EF4444;
}

.pin-btn-cancel {
  background: transparent;
  border: 1px solid #475569;
  border-radius: 8px;
  color: #CBD5E1;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pin-btn-cancel:hover {
  background: #334155;
  color: #FFFFFF;
}

.pin-btn-save {
  background: #F59E0B;
  border: none;
  border-radius: 8px;
  color: #78350F;
  padding: 0.6rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
}

.pin-btn-save:hover {
  background: #D97706;
  color: #FFFFFF;
}

/* Slide-Out Feedback Drawer */
.dev-drawer {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: min(480px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  background: #0F172A;
  color: #F8FAFC;
  border: 1.5px solid #334155;
  border-radius: 18px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: drawerSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10000;
}

@keyframes drawerSlideUp {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.dev-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: #1E293B;
  border-bottom: 1px solid #334155;
}

.dev-header-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.dev-header-title h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #FFFFFF;
  margin: 0;
}

.dev-badge {
  background: #F59E0B;
  color: #78350F;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.dev-btn-close {
  background: transparent;
  border: none;
  color: #94A3B8;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.dev-btn-close:hover {
  color: #FFFFFF;
  background: #334155;
}

.dev-drawer-content {
  padding: 1.15rem 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  font-size: 0.85rem;
}

.dev-section {
  background: #1E293B;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 1rem;
}

.dev-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  font-weight: 700;
  color: #F8FAFC;
}

.dev-title-with-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dev-pin-count-badge {
  background: #F59E0B;
  color: #78350F;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.1rem 0.5rem;
  border-radius: 9999px;
  font-family: ui-monospace, SFMono-Regular, monospace;
}

.dev-mini-btn {
  background: #334155;
  color: #F8FAFC;
  border: none;
  border-radius: 4px;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.dev-mini-btn:hover {
  background: #475569;
}

.dev-mini-btn.danger:hover {
  background: #EF4444;
  color: #FFFFFF;
}

.dev-pins-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
}

.dev-empty-pins {
  text-align: center;
  padding: 1.5rem 1rem;
  color: #64748B;
  background: #0F172A;
  border-radius: 8px;
  border: 1px dashed #334155;
}

.empty-pin-icon {
  font-size: 1.75rem;
  display: block;
  margin-bottom: 0.35rem;
}

.dev-empty-pins p {
  font-size: 0.85rem;
  font-weight: 600;
  color: #94A3B8;
  margin: 0 0 0.25rem 0;
}

.dev-empty-pins small {
  font-size: 0.75rem;
  color: #64748B;
  display: block;
}

.dev-pin-card {
  background: #0F172A;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.8rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dev-pin-card:hover {
  border-color: #F59E0B;
}

.dev-pin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dev-pin-num-pill {
  background: #F59E0B;
  color: #78350F;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, monospace;
}

.dev-pin-category-tag {
  background: #334155;
  color: #E2E8F0;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
}

.dev-pin-card-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.dev-pin-edit-btn {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 4px;
  color: #38BDF8;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  transition: all 0.15s ease;
}

.dev-pin-edit-btn:hover {
  background: #38BDF8;
  color: #0F172A;
  border-color: #38BDF8;
}

.dev-pin-delete-btn {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 4px;
  color: #F87171;
  cursor: pointer;
  padding: 0.15rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  transition: all 0.15s ease;
}

.dev-pin-delete-btn:hover {
  background: #EF4444;
  color: #FFFFFF;
  border-color: #EF4444;
}

.dev-pin-card-target {
  font-weight: 700;
  color: #38BDF8;
  font-size: 0.775rem;
  font-family: ui-monospace, SFMono-Regular, monospace;
}

.dev-pin-card-comment {
  color: #CBD5E1;
  font-size: 0.825rem;
  line-height: 1.45;
  margin: 0;
  background: rgba(15, 23, 42, 0.4);
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  border-left: 2px solid #F59E0B;
}

.dev-pin-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.85rem;
}

.dev-primary-btn {
  width: 100%;
  background: #10B981;
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  padding: 0.7rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: background 0.15s ease, transform 0.15s ease;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.dev-primary-btn:hover {
  background: #059669;
  transform: translateY(-1px);
}

.dev-mini-action-row {
  display: flex;
  gap: 0.5rem;
}

.dev-secondary-btn {
  flex: 1;
  background: #334155;
  color: #F8FAFC;
  border: 1px solid #475569;
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: background 0.15s ease;
}

.dev-secondary-btn:hover {
  background: #475569;
}

.dev-feedback-status {
  font-size: 0.775rem;
  color: #34D399;
  text-align: center;
  min-height: 1.2rem;
}

/* Utilities */
.hidden {
  display: none !important;
}

.flex-items-center {
  display: flex;
  align-items: center;
}

.gap-1\.5 {
  gap: 0.375rem;
}
