/* Body Map Component — Interactive Animal Diagrams */

.body-map-container {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.body-map-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.body-map-header h3 {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-neutral-800);
}

.body-map-layer-toggle {
  display: flex;
  gap: var(--space-1);
  background: var(--color-neutral-100);
  border-radius: var(--radius-lg);
  padding: 2px;
}

.body-map-layer-btn {
  padding: var(--space-2) var(--space-3);
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-neutral-600);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 40px;
}

.body-map-layer-btn.active {
  background: var(--color-white);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.body-map-svg-wrap {
  position: relative;
  background: var(--color-neutral-50);
  border: 2px solid var(--color-neutral-200);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.body-map-svg-wrap svg {
  width: 100%;
  height: auto;
  max-height: 400px;
}

.body-map-svg-wrap svg .bm-zone {
  cursor: pointer;
  transition: fill 0.2s, stroke 0.2s, opacity 0.2s, transform 0.15s;
  stroke: rgba(0, 0, 0, 0.25);
  stroke-width: 1.5;
  stroke-linejoin: round;
}

.body-map-svg-wrap svg .bm-zone:hover {
  opacity: 0.88;
  stroke: var(--color-primary);
  stroke-width: 2.5;
  filter: drop-shadow(0 2px 6px rgba(27, 122, 74, 0.25));
}

.body-map-svg-wrap svg .bm-zone.zoomable:hover {
  stroke: var(--color-secondary);
  stroke-width: 2.5;
  cursor: zoom-in;
}

.body-map-svg-wrap svg .bm-zone.selected {
  stroke: var(--color-error);
  stroke-width: 3;
  filter: drop-shadow(0 0 6px rgba(220, 38, 38, 0.4));
  animation: bm-pulse 2s ease-in-out infinite;
}

@keyframes bm-pulse {
  0%, 100% { stroke-opacity: 1; }
  50% { stroke-opacity: 0.6; }
}

.body-map-svg-wrap svg .bm-zone.interior {
  fill-opacity: 0.7;
  stroke: rgba(0, 0, 0, 0.15);
}

.body-map-svg-wrap svg .bm-label {
  font-size: 9px;
  fill: var(--color-neutral-800);
  pointer-events: none;
  font-weight: 600;
  text-anchor: middle;
  text-shadow: 0 0 3px rgba(255, 255, 255, 0.8);
}

.body-map-svg-wrap svg .bm-zoom-hint {
  pointer-events: none;
  opacity: 0.7;
}

/* Zoom overlay for detailed sub-diagrams */
.body-map-zoom-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.96);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  animation: bmFadeIn 0.2s ease;
}

@keyframes bmFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.body-map-zoom-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-neutral-800);
  margin-bottom: var(--space-2);
}

.body-map-zoom-back {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  background: var(--color-neutral-100);
  border: 1px solid var(--color-neutral-300);
  border-radius: var(--radius-full);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  color: var(--color-neutral-700);
}

/* Selected zones summary */
.body-map-selections {
  margin-top: var(--space-3);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.body-map-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  background: var(--color-error-light, #FEE2E2);
  color: var(--color-error);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
}

.body-map-chip .remove-zone {
  cursor: pointer;
  font-weight: 700;
  margin-left: var(--space-1);
  opacity: 0.7;
}

.body-map-chip .remove-zone:hover {
  opacity: 1;
}

/* Note input per zone */
.body-map-zone-note {
  margin-top: var(--space-3);
  padding: var(--space-3);
  background: var(--color-neutral-50);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-neutral-200);
}

.body-map-zone-note label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-neutral-700);
  display: block;
  margin-bottom: var(--space-1);
}

.body-map-zone-note textarea {
  width: 100%;
  min-height: 60px;
  border: 1px solid var(--color-neutral-300);
  border-radius: var(--radius-md);
  padding: var(--space-2);
  font-size: var(--text-sm);
  resize: vertical;
}

/* Touch-friendly: ensure minimum 48px targets on mobile */
@media (max-width: 768px) {
  .body-map-svg-wrap {
    min-height: 280px;
    padding: var(--space-2);
  }

  .body-map-svg-wrap svg .bm-zone {
    stroke-width: 2;
  }

  .body-map-layer-btn {
    min-height: 48px;
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-base);
  }
}

/* Method selection cards */
.symptom-method-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  max-width: 600px;
  margin: var(--space-6) auto;
}

@media (max-width: 480px) {
  .symptom-method-cards {
    grid-template-columns: 1fr;
  }
}

.symptom-method-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-6) var(--space-4);
  background: var(--color-white);
  border: 2px solid var(--color-neutral-200);
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  min-height: 180px;
}

.symptom-method-card:hover,
.symptom-method-card.active {
  border-color: var(--color-primary);
  background: var(--color-primary-light, #F0FDF4);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.symptom-method-card .method-icon {
  font-size: 48px;
  line-height: 1;
}

.symptom-method-card .method-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-neutral-800);
}

.symptom-method-card .method-desc {
  font-size: var(--text-sm);
  color: var(--color-neutral-500);
  line-height: 1.4;
}
