/* Grip Library styles - based on Edger Pitch Search */
#grip-library-container {
  padding-top: calc(var(--navbar-offset, 96px) + 32px) !important;
  scroll-margin-top: calc(var(--navbar-offset, 96px) + 16px);
}

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

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

/* Two-column layout: 35/65 split */
.grip-library-two-col {
  display: grid;
  grid-template-columns: 35fr 65fr;
  gap: 16px;
  align-items: start;
  min-width: 0;
}

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

/* Left column stacking */
.grip-library-left-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Left panel - release point inputs */
.grip-library-inputs-card {
  background: var(--secondary-color);
  border: 1px solid #444;
  border-radius: 12px;
  padding: 16px;
  min-width: 0;
}

.input-header {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #D4AF25;
}

.input-group {
  margin-bottom: 16px;
}

.input-label {
  display: block;
  font-size: 13px;
  color: #bbb;
  margin-bottom: 6px;
  font-weight: 500;
}

.input-field {
  width: 100%;
  background: #222;
  color: #fff;
  border: 2px solid #444;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  box-sizing: border-box;
}

.input-field:focus {
  outline: none;
  border-color: #D4AF25;
  box-shadow: 0 0 0 2px rgba(212, 175, 37, 0.2);
}

.input-helper {
  font-size: 11px;
  color: #888;
  margin-top: 4px;
  font-style: italic;
}

.generate-btn {
  width: 100%;
  padding: 12px 16px;
  background: #D4AF25;
  color: #000;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  margin-top: 8px;
  transition: background 0.2s ease;
}

.generate-btn:hover:not(:disabled) {
  background: #e6c035;
}

.generate-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Movement plot card (left column, bottom) */
.grip-library-movement-card {
  background: var(--secondary-color);
  border: 1px solid #444;
  border-radius: 12px;
  padding: 16px;
  min-width: 0;
}

/* Right panel - video and results */
.grip-library-main-card {
  background: var(--secondary-color);
  border: 1px solid #444;
  border-radius: 12px;
  padding: 16px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.movement-plot-section {
  margin-bottom: 20px;
}

.plot-header {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #D4AF25;
}

.plot-container {
  background: #1a1a1a;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.plot-canvas-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.plot-placeholder {
  color: #888;
  font-size: 14px;
  text-align: center;
}

.search-btn {
  width: 100%;
  padding: 12px 16px;
  background: #2196f3;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  margin-top: 16px;
  transition: background 0.2s ease;
}

.search-btn:hover:not(:disabled) {
  background: #1976d2;
}

.search-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Results section */
.results-section {
  margin-top: 24px;
}

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

.results-title {
  font-size: 18px;
  font-weight: 600;
  color: #D4AF25;
}

.results-count {
  font-size: 13px;
  color: #888;
}

/* Video player section - Grip Library specific */
.grip-library-container .video-section {
  margin-bottom: 20px;
  background: #1a1a1a;
  border-radius: 8px;
  padding: 12px;
  height: 60vh;
  min-height: 420px;
  display: flex;
  flex-direction: column;
}

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

.grip-library-container .video-title {
  font-size: 16px;
  font-weight: 600;
}

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

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

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

/* Results table */
.results-table-container {
  overflow-x: auto;
  border-radius: 8px;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  table-layout: auto;
}

.results-table thead th {
  background: #2b2b2b;
  color: #ddd;
  font-weight: 600;
  padding: 8px 10px;
  border: 1px solid #444;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 1;
}

.results-table thead th:nth-child(even) {
  background: #333333;
}

.results-table tbody td {
  padding: 6px 8px;
  border: 1px solid #444;
  text-align: center;
  color: #eee;
}

.results-table tbody tr:hover {
  background: #2a2a2a;
  cursor: pointer;
}

.results-table tbody tr.selected-row {
  background: rgba(33, 150, 243, 0.25);
}

.results-table tbody tr.selected-row td {
  color: #fff;
  font-weight: 600;
}

.play-btn {
  background: #D4AF25;
  color: #000;
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 11px;
  transition: background 0.2s ease;
}

.play-btn:hover {
  background: #e6c035;
}

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

/* Error message */
.error-message {
  background: rgba(244, 67, 54, 0.1);
  border: 1px solid rgba(244, 67, 54, 0.3);
  color: #f44336;
  padding: 12px 16px;
  border-radius: 8px;
  margin-top: 16px;
  font-size: 14px;
}

/* Loading state */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  z-index: 10;
}

.loading-spinner {
  border: 3px solid #333;
  border-top: 3px solid #D4AF25;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
