/* ===========================================
   KAMPDAG DRAG & DROP - Pitch View CSS
   Add to end of style.css
   =========================================== */

/* -- Pitch card container -- */
.kd-pitch-card {
  background: var(--card-bg, #1e293b);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
}

.kd-pitch-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-wrap: wrap;
  gap: 3px;
}

.kd-pitch-card-title {
  font-weight: 900;
  font-size: 13px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 5px;
}

.kd-override-badge {
  display: inline-flex;
  background: rgba(251,191,36,0.12);
  color: #fbbf24;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 5px;
}

.kd-period-keeper {
  background: rgba(168,85,247,0.15);
  color: #c084fc;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}

/* -- Action buttons -- */
.kd-copy-btn,
.kd-reset-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 1px solid rgba(255,255,255,0.1);
  font-size: 9px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 5px;
  cursor: pointer;
  font-family: inherit;
  -webkit-user-select: none;
  user-select: none;
  background: rgba(255,255,255,0.06);
  color: #94a3b8;
}

.kd-copy-btn {
  color: #60a5fa;
  border-color: rgba(59,130,246,0.3);
}

.kd-copy-btn:active,
.kd-reset-btn:active {
  background: rgba(255,255,255,0.15);
}

.kd-reset-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 1px solid rgba(255,255,255,0.1);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  -webkit-user-select: none;
  user-select: none;
  background: rgba(255,255,255,0.06);
  color: #94a3b8;
  margin-left: 8px;
  vertical-align: middle;
}

.kd-reset-all-btn:active {
  background: rgba(255,255,255,0.15);
}

/* -- Pitch field -- */
.kd-pitch-wrap {
  position: relative;
  overflow: visible;
  padding: 5px;
}

.kd-pitch-field {
  position: relative;
  width: 100%;
  aspect-ratio: 68 / 80;
  background: linear-gradient(
    180deg,
    #1b6e1b 0%, #1a6a1a 14%, #1d721d 14.5%,
    #1a6a1a 28%, #1b6e1b 28.5%, #1a6a1a 42%,
    #1d721d 42.5%, #1a6a1a 56%, #1b6e1b 56.5%,
    #1a6a1a 70%, #1d721d 70.5%, #1a6a1a 84%,
    #1b6e1b 84.5%, #1a6a1a 100%
  );
  border-radius: 6px;
  overflow: visible;
}

.kd-pitch-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

/* -- Position slots -- */
.kd-pos-slot {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 3;
  transform: translate(-50%, -50%);
}

.kd-pos-label {
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.4);
  margin-bottom: 1px;
  pointer-events: none;
}

/* -- Bubble sizes by slot count -- */
.kd-slot-small .kd-pos-bubble { width: 52px; height: 52px; }
.kd-slot-small .kd-pos-bubble .kd-p-name { font-size: 10px; max-width: 48px; }
.kd-slot-medium .kd-pos-bubble { width: 44px; height: 44px; }
.kd-slot-medium .kd-pos-bubble .kd-p-name { font-size: 9px; max-width: 40px; }
.kd-slot-large .kd-pos-bubble { width: 38px; height: 38px; }
.kd-slot-large .kd-pos-bubble .kd-p-name { font-size: 8px; max-width: 34px; }

/* -- Position bubbles -- */
.kd-pos-bubble {
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  transition: transform 0.12s, box-shadow 0.12s, opacity 0.12s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  border: 2px solid transparent;
  position: relative;
  cursor: grab;
}

.kd-pos-bubble:active { cursor: grabbing; }

.kd-pos-bubble .kd-p-name {
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.kd-pos-bubble .kd-p-hint {
  font-size: 7px;
  font-weight: 700;
  opacity: 0.6;
  color: #fff;
  pointer-events: none;
}

/* Zone colors */
.kd-bb-f { background: rgba(34,197,94,0.85); border-color: rgba(34,197,94,0.45); }
.kd-bb-m { background: rgba(59,130,246,0.85); border-color: rgba(59,130,246,0.45); }
.kd-bb-a { background: rgba(239,68,68,0.85); border-color: rgba(239,68,68,0.45); }
.kd-bb-k { background: rgba(168,85,247,0.85); border-color: rgba(168,85,247,0.45); cursor: not-allowed; opacity: 0.85; }

/* State indicators */
.kd-pref-warn {
  box-shadow: 0 0 0 2px #f59e0b, 0 2px 8px rgba(0,0,0,0.3);
}
.kd-pref-warn::after {
  content: '\26a0';
  position: absolute;
  top: -3px;
  right: -3px;
  font-size: 8px;
  background: #f59e0b;
  color: #000;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.kd-is-new {
  box-shadow: 0 0 0 2px #fbbf24, 0 2px 8px rgba(0,0,0,0.3);
}

.kd-dragging {
  opacity: 0.15;
  transform: scale(0.8);
  pointer-events: none;
}

.kd-pos-slot.kd-drop-target .kd-pos-bubble {
  transform: scale(1.15);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.7), 0 4px 16px rgba(0,0,0,0.4);
  filter: brightness(1.3);
}

/* -- Bench area -- */
.kd-bench-area {
  padding: 5px 10px;
  background: rgba(0,0,0,0.18);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  border-top: 1px solid rgba(255,255,255,0.04);
}

.kd-bench-label {
  color: #94a3b8;
  font-size: 10px;
  font-weight: 700;
}

.kd-bench-bubble {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  transition: transform 0.12s, opacity 0.12s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  background: rgba(100,116,139,0.7);
  border: 2px solid rgba(100,116,139,0.4);
  cursor: grab;
}

.kd-bench-bubble:active { cursor: grabbing; }
.kd-bench-bubble.kd-dragging { opacity: 0.15; transform: scale(0.8); }

.kd-bench-bubble .kd-p-name {
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 36px;
}

/* -- Swap strip -- */
.kd-swap-strip {
  padding: 6px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 3px 6px;
  font-size: 11px;
  color: #cbd5e1;
  border-top: 1px solid rgba(255,255,255,0.06);
  line-height: 1.4;
}

.kd-swap-strip .kd-sw-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 6px;
  white-space: nowrap;
}

.kd-swap-strip .kd-sw-item.kd-sw-in-item {
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.2);
}

.kd-swap-strip .kd-sw-item.kd-sw-out-item {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.15);
}

.kd-sw-in { color: #4ade80; font-weight: 800; font-size: 11px; }
.kd-sw-out { color: #f87171; font-weight: 800; font-size: 11px; }
.kd-sw-name { font-weight: 700; }
.kd-sw-label { font-size: 9px; font-weight: 600; opacity: 0.6; text-transform: uppercase; letter-spacing: 0.03em; }

/* -- Drag ghost -- */
.kd-drag-ghost {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 3px #60a5fa;
  transform: translate(-50%, -50%) scale(1.08);
  will-change: left, top;
}

.kd-drag-ghost .kd-g-name {
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  pointer-events: none;
}

/* -- Responsive -- */
@media (max-width: 360px) {
  .kd-slot-small .kd-pos-bubble { width: 46px; height: 46px; }
  .kd-slot-small .kd-pos-bubble .kd-p-name { font-size: 9px; }
  .kd-bench-bubble { width: 36px; height: 36px; }
  .kd-bench-bubble .kd-p-name { font-size: 8px; }
}

@media (min-width: 768px) {
  .kd-slot-small .kd-pos-bubble { width: 62px; height: 62px; }
  .kd-slot-small .kd-pos-bubble .kd-p-name { font-size: 11px; max-width: 56px; }

  /* Constrain pitch card size on desktop - prevent oversized cards */
  .kd-pitch-field {
    max-height: 380px;
  }
  .kd-pitch-wrap {
    max-height: 400px;
  }
  .kd-pitch-card {
    max-width: 520px;
  }
  /* Bench bubbles slightly larger on desktop */
  .kd-bench-bubble { width: 44px; height: 44px; }
  .kd-bench-bubble .kd-p-name { font-size: 10px; }
}
