/* Edger Pitch Search styles - align with site look */
#in-house-edger-container {
  padding-top: calc(var(--navbar-offset, 96px) + 32px) !important;
  scroll-margin-top: calc(var(--navbar-offset, 96px) + 16px);
}

.edger-container { width: 100%; max-width: 1680px; margin: 0 auto; color: var(--text-color); }

.edger-title {
  width: 100%;
  text-align: left;
  font-size: 28px;
  font-weight: 700;
  margin: 10px 0 20px;
}

/* Tabs for Single | Comparison */
.edger-tabs { display:flex; gap:6px; justify-content:center; margin: 6px 0 16px 0; border-bottom: 2px solid #333; }
.edger-tab { background: transparent; border:none; color:#ccc; padding:10px 16px; font-weight:700; cursor:pointer; border-bottom:3px solid transparent; }
.edger-tab:hover { color:#fff; background: rgba(212,175,37,0.08); }
.edger-tab.active { color:#D4AF25; border-bottom-color:#D4AF25; background: rgba(212,175,37,0.08); }
.edger-view { display:none; }
.edger-view.active { display:block; }
.edger-compare-iframe { width:100%; height:70vh; border:0; background: #000; border-radius: 8px; }

/* Two-column layout: 20/80 split */
.edger-two-col {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) 4fr; /* ~20/80 */
  gap: 16px;
  align-items: start;
  min-width: 0; /* prevent child overflow */
}

@media (max-width: 1000px) {
  .edger-two-col { grid-template-columns: 1fr; }
}

/* New layout: video hero on top, filters below */
.edger-video-hero { width: 100%; height: 60vh; min-height: 420px; margin-bottom: 12px; }

/* Legacy .edger-filters kept for backward compatibility */
.edger-filters { display: none; }

.edger-filters-card {
  background: var(--secondary-color);
  border: 1px solid #444;
  border-radius: 12px;
  padding: 10px 12px;
  min-width: 0; /* allow inputs to shrink within card */
}

/* Scope filter spacing to Edger card to avoid leaking to MLB/NCAA */
.edger-filters-card .filter-group + .filter-group { margin-top: 14px; }

.filter-label {
  display: block;
  font-size: 11px;
  color: #bbb;
  margin-bottom: 4px;
}

.filter-input,
.filter-select {
  width: 100%;
  background: #222;
  color: #fff;
  border: 2px solid #444;
  border-radius: 8px;
  padding: 4px 6px;
  font-size: 12px;
}

/* Scope filter-row layout to Edger only to prevent global overrides */
.edger-filters-card .filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.apply-btn {
  width: 100%;
  padding: 10px 14px;
  background: #2196f3;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  margin-top: 8px;
}

.apply-btn:hover { background: #1976d2; }

.edger-video-card {
  background: var(--secondary-color);
  border: 1px solid #444;
  border-radius: 12px;
  padding: 12px 12px 8px;
  height: 100%;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.video-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.video-title {
  font-size: 18px;
  font-weight: 600;
}

.video-zoom-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: #bbb;
  user-select: none;
}

.video-zoom-value {
  min-width: 44px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.video-zoom-btn {
  background: #333;
  color: #fff;
  border: 1px solid #555;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.video-zoom-btn:hover:not([disabled]) {
  background: #3f3f3f;
  border-color: #666;
}

.video-zoom-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.video-zoom-reset {
  margin-left: 4px;
}

.video-container {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-pan-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  transition: transform 0.08s ease-out;
}

.video-container.zoomed .video-pan-wrapper { cursor: grab; }
.video-container.panning .video-pan-wrapper { cursor: grabbing; }

.video-player { width: 100%; height: 100%; background: #000; object-fit: contain; }

.video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  font-size: 16px;
  pointer-events: none;
}

.video-controls {
  display: flex;
  gap: 8px;
}

.control-input {
  background: #222;
  color: #fff;
  border: 2px solid #444;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 13px;
  min-width: 240px;
}

.control-btn {
  padding: 8px 12px;
  background: #444;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.control-btn:hover { background: #555; }

/* Results table inside video card */
.results-wrap { margin-top: 8px; }
.mini-table { width: 100%; border-collapse: collapse; font-size: 12px; table-layout: auto; }
.mini-table thead th { background: #2b2b2b; color: #ddd; font-weight: 600; padding: 6px 8px; border: 1px solid #444; text-align: center; }
.mini-table thead th:nth-child(even) { background: #333333; }
.mini-table tbody td { padding: 5px 6px; border: 1px solid #444; text-align: center; color: #eee; }
.mini-table tbody tr:hover { background: #2a2a2a; }

/* VAA and HAA columns in mini-table - make them dynamically sized */
.mini-table th:nth-child(9),
.mini-table td:nth-child(9),
.mini-table th:nth-child(10),
.mini-table td:nth-child(10) {
    width: auto;
    min-width: 50px;
    max-width: 80px;
    white-space: nowrap;
    padding: 5px 4px;
}

/* Clean compact filters */
.filter-header { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.filter-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 10px; }
@media (max-width: 900px) { .filter-grid { grid-template-columns: 1fr; } }
.metric-collapse { border: 1px solid #444; border-radius: 8px; overflow: hidden; background: #222; margin-top: 8px; }
.metric-collapse summary { cursor: pointer; padding: 6px 8px; font-weight: 600; list-style: none; font-size: 12px; line-height: 1.2; }
.metric-collapse[open] summary { background: #2a2a2a; }
.metric-body { padding: 8px 10px 10px; }
.metric-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.apply-row { display: flex; justify-content: flex-end; margin-top: 10px; }

/* Compact inputs */
.filter-select, .filter-input { height: 30px; padding: 4px 6px; font-size: 12px; }
.control-btn { height: 34px; font-size: 12px; }
.apply-btn { height: 36px; font-size: 13px; padding: 0 14px; }

/* Date-range row styles (reuse global, tweak spacing) */
.edger-filters-card .date-range-container { display:flex; flex-wrap: nowrap; gap: 8px; justify-content: start; align-items: flex-end; margin-bottom: 6px; }
.edger-filters-card .date-input-group { flex: 1; min-width: 0; }
.edger-filters-card .date-input-group label { display:block; font-size: 11px; color: #ccc; margin-bottom: 2px; }
.edger-filters-card .date-input {
  width: 100%;
  height: 26px;
  border-radius: 6px;
  background: #222;
  color: #fff;
  border: 2px solid #444;
  padding: 2px 6px;
  font-size: 11px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
/* Tighten the internal editable fields and calendar icon for WebKit */
.edger-filters-card .date-input::-webkit-datetime-edit { padding: 0; }
.edger-filters-card .date-input::-webkit-calendar-picker-indicator { margin: 0; padding: 0 2px; }
.edger-filters-card .date-update-btn { height: 34px; padding: 0 12px; }

/* Make selects visually consistent */
.filter-select { appearance: none; background-color: #222; border: 2px solid #444; color: #fff; border-radius: 8px; }
.filter-select:focus, .filter-input:focus { outline: none; border-color: #666; box-shadow: 0 0 0 2px rgba(255,255,255,0.06); }

/* Highlight selected row in results */
.mini-table tbody tr.selected-row { background: rgba(33, 150, 243, 0.25); }
.mini-table tbody tr.selected-row td { color: #fff; font-weight: 600; }

/* Sorting + pagination */
.mini-table thead th.sortable { cursor: pointer; user-select: none; }
.mini-table thead th.sortable .sort-ind { margin-left: 6px; opacity: 0.75; }
.pagination { display: flex; gap: 6px; align-items: center; justify-content: flex-end; padding: 6px 0 0; }
.pagination button { background: #444; color: #fff; border: 1px solid #555; border-radius: 6px; padding: 4px 8px; font-size: 12px; cursor: pointer; }
.pagination button[disabled] { opacity: 0.5; cursor: default; }
.pagination .active { background: #2196f3; border-color: #2196f3; }

/* Pitch badge styling */
.pitch-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

/* Pitcher search input + suggestions */
.edger-search { position: relative; }
.edger-search-input { width: 100%; height: 34px; background: #222; color:#fff; border:2px solid #444; border-radius:8px; padding:6px 8px; font-size:13px; box-sizing:border-box; max-width:100%; }
.edger-suggestions {
  position: absolute; top: 38px; left: 0; right: 0;
  background:#1f1f1f; border:1px solid #444; border-radius:8px;
  z-index: 20;
  /* Keep within the embedded viewport and card */
  max-height: min(45vh, 360px);
  overflow: auto;
  overscroll-behavior: contain;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

/* Ensure all filter inputs/selects don't overflow the card */
.edger-filters-card input[type="date"],
.edger-filters-card .filter-input,
.edger-filters-card .filter-select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

/* Avoid grid content overflow due to long content */
.edger-filters-card .filter-row { min-width: 0; }
.edger-suggestion { padding:8px 10px; cursor:pointer; color:#eee; }
.edger-suggestion:hover, .edger-suggestion.active { background:#2a2a2a; color:#fff; }
.edger-tabs { display:flex; gap:6px; justify-content:center; margin: 6px 0 16px 0; border-bottom: 2px solid #333; }
.edger-tab { background: transparent; border:none; color:#ccc; padding:10px 16px; font-weight:700; cursor:pointer; border-bottom:3px solid transparent; }
.edger-tab:hover { color:#fff; background: rgba(212,175,37,0.08); }
.edger-tab.active { color:#D4AF25; border-bottom-color:#D4AF25; background: rgba(212,175,37,0.08); }
.edger-view { display:none; }
.edger-view.active { display:block; }
.edger-compare-grid { display:grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.edger-compare-iframe { width:100%; height:80vh; border:0; background:#000; border-radius:8px; }

/* Global compare controls */
.edger-compare-controls { display:flex; flex-wrap:wrap; align-items:center; gap:10px; justify-content:center; margin: 8px 0 16px 0; }
.edger-compare-controls .btn { background:#D4AF25; color:#000; border:1px solid #D4AF25; font-weight:700; border-radius:6px; padding:8px 12px; cursor:pointer; display:inline-flex; align-items:center; gap:6px; }
.edger-compare-controls .btn .icon { display:inline-flex; align-items:center; justify-content:center; }
.edger-compare-controls .btn .icon svg { width:16px; height:16px; fill: currentColor; }
.edger-compare-controls .range { flex: 1 1 420px; display:flex; align-items:center; gap:10px; }
.edger-compare-controls input[type="range"]{ width:100%; height: 28px; }
/* Thicker range track */
.edger-compare-controls input[type="range"]::-webkit-slider-runnable-track { height: 12px; background:#333; border-radius:6px; }
.edger-compare-controls input[type="range"]::-webkit-slider-thumb { -webkit-appearance:none; width:18px; height:18px; margin-top:-3px; background:#D4AF25; border-radius:50%; border:1px solid #000; }
.edger-compare-controls input[type="range"]::-moz-range-track { height: 12px; background:#333; border-radius:6px; }
.edger-compare-controls input[type="range"]::-moz-range-thumb { width:18px; height:18px; background:#D4AF25; border-radius:50%; border:1px solid #000; }

/* ==================== Drawing Tool Styles ==================== */

.edger-video-with-tools {
  display: flex;
  gap: 12px;
  width: 100%;
  height: 100%;
}

.drawing-toolbar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--secondary-color);
  border: 1px solid #444;
  border-radius: 12px;
  padding: 12px;
  width: 80px;
  min-width: 80px;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

.drawing-toolbar::-webkit-scrollbar {
  width: 6px;
}

.drawing-toolbar::-webkit-scrollbar-track {
  background: #222;
  border-radius: 3px;
}

.drawing-toolbar::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 3px;
}

.drawing-toolbar::-webkit-scrollbar-thumb:hover {
  background: #666;
}

.toolbar-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toolbar-title {
  font-size: 11px;
  font-weight: 600;
  color: #bbb;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  margin-bottom: 4px;
}

.tool-btn {
  width: 100%;
  aspect-ratio: 1;
  background: #333;
  border: 2px solid #555;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  padding: 8px;
}

.tool-btn:hover {
  background: #3f3f3f;
  border-color: #666;
}

.tool-btn.active {
  background: #2196f3;
  border-color: #2196f3;
  color: #fff;
}

.tool-btn svg {
  width: 24px;
  height: 24px;
}

.color-palette {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.color-btn {
  width: 100%;
  aspect-ratio: 1;
  border: 2px solid #555;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}

.color-btn:hover {
  transform: scale(1.1);
  border-color: #777;
}

.color-btn.active {
  border-color: #fff;
  border-width: 3px;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.size-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  background: #444;
  border-radius: 4px;
  height: 6px;
  outline: none;
}

.size-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: #2196f3;
  border-radius: 50%;
  cursor: pointer;
}

.size-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: #2196f3;
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.size-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 24px;
}

.size-preview span {
  display: block;
  background: #fff;
  border-radius: 50%;
  transition: all 0.15s ease;
}

.action-btn {
  width: 100%;
  background: #444;
  border: 1px solid #555;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  padding: 8px 6px;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.action-btn:hover {
  background: #555;
  border-color: #666;
}

.action-btn svg {
  width: 18px;
  height: 18px;
}

.drawing-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* Default to none, enabled when tool is selected */
  z-index: 10;
}

.video-pan-wrapper {
  position: relative;
}

/* Update video container when canvas is present */
.edger-video-with-tools .video-container {
  flex: 1;
  min-width: 0;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .edger-video-with-tools {
    flex-direction: column;
  }

  .drawing-toolbar {
    flex-direction: row;
    width: 100%;
    max-width: 100%;
    min-width: 100%;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px;
  }

  .toolbar-section {
    min-width: fit-content;
  }

  .color-palette {
    grid-template-columns: repeat(4, 1fr);
  }
}
