/* shots.css — Shot log table, add-shot mode, cutoff display, confirm buttons */

#shot-log {
  background: var(--surface-glass-thin);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

#shot-log.shot-log-fade-in {
  animation: shotLogFadeIn 0.25s ease both;
}

@keyframes shotLogFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

#shot-log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

#shot-log-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
}


#shot-log-summary {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

#shot-log-table-wrap {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
}

#shot-log-more-indicator {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 0.4rem;
  background: linear-gradient(to top, rgba(26, 29, 39, 0.85) 50%, transparent);
  backdrop-filter: blur(5px);
  color: var(--text-muted);
  font-size: 0.75rem;
  z-index: 5;
  animation: pulse-indicator 1.5s ease-in-out infinite;
  pointer-events: none;
}

.more-arrow {
  font-size: 0.6rem;
}

@keyframes pulse-indicator {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

#shot-log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  table-layout: fixed;
}

#shot-log-table thead {
  position: sticky;
  top: 0;
  background: var(--surface-glass);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  z-index: 1;
}

#shot-log-table th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.4rem 1rem;
  border-bottom: 1px solid var(--border);
}

#shot-log-table th:first-child {
  width: 7rem;
}

#shot-log-table th:last-child {
  text-align: right;
  width: 40px;
}

#shot-log-table.has-targets th:last-child {
  width: 36px;
}

.shot-target-cell {
  text-align: right;
  padding-right: 0.5rem !important;
}

#shot-log-table td {
  border-bottom: 1px solid rgba(46, 51, 69, 0.5);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#shot-log-table tbody tr {
  cursor: pointer;
  transition: background-color 0.1s, opacity 0.2s ease, transform 0.2s ease;
}

#shot-log-table tbody tr.shot-poof {
  animation: shot-poof 0.35s ease forwards;
}

@keyframes shot-poof {
  0%   { opacity: 0.5; transform: scale(1); }
  40%  { opacity: 0.6; transform: scale(1.05); }
  100% { opacity: 0; transform: scale(0.3); height: 0; padding: 0; }
}

#shot-log-table tbody tr.shot-fade-in {
  opacity: 0;
  transform: translateY(6px);
}

#shot-log-table tbody tr.shot-fade-in.shot-visible {
  opacity: 1;
  transform: translateY(0);
}

#shot-log-table tbody tr:hover {
  background: var(--surface-hover);
}

#shot-log-table tbody tr:last-child td {
  border-bottom: none;
}

.shot-split {
  color: var(--text-muted);
}

.shot-split.first-shot {
  color: var(--yellow);
}

.shot-row-hidden {
  display: none;
}

/* Shot menu styles */
.shot-menu-cell {
  text-align: right;
  width: 40px;
  padding-right: 0.75rem !important;
}

#shot-log-table td.shot-num-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: calc(0.4rem + 2px);
  padding-bottom: calc(0.4rem + 2px);
  padding-left: 0.5rem;
  white-space: nowrap;
}

.shot-play-btn {
  width: 24px;
  height: 24px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}

.shot-play-btn .play-icon {
  display: inline-block;
  transform: translate(0px, 1px);
}

.shot-play-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--text-muted);
}

.shot-excluded .shot-play-btn {
  display: none;
}

.shot-edit-btn {
  font-size: 0.75rem;
}

.shot-num {
  margin-left: 0.25rem;
  color: var(--text-muted);
}

.shot-time-input {
  width: 5.5rem;
  padding: 0.15rem 0.35rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(26, 29, 39, 0.9);
  color: var(--text);
  font-size: 0.8rem;
  font-family: inherit;
  text-align: center;
  outline: none;
}

.shot-time-input:focus {
  border-color: var(--accent, #7eb4f5);
}

.shot-toggle-btn {
  border: none;
  border-radius: 4px;
  background: rgb(46, 51, 69);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin-left: auto;
  opacity: 0.6;
  line-height: 1;
}

.shot-included .shot-toggle-btn {
  color: #ff6b7f;
}

.shot-toggle-btn:hover {
  background: rgb(53, 59, 79);
  opacity: 1;
}

.shot-excluded .shot-toggle-btn {
  opacity: 0.4;
}

.shot-excluded .shot-toggle-btn:hover {
  opacity: 0.8;
}

#shot-log-table tr.shot-excluded {
  opacity: 0.5;
}

#shot-log-table tr.shot-toggle {
  animation: shotToggle 0.35s ease;
}

@keyframes shotToggle {
  0% { opacity: 1; transform: scale(1); }
  40% { opacity: 0.3; transform: scale(0.97); }
  100% { opacity: 1; transform: scale(1); }
}

#shot-log-table tr.shot-excluded.shot-toggle {
  animation: shotToggleOut 0.35s ease;
}

@keyframes shotToggleOut {
  0% { opacity: 1; }
  40% { opacity: 0.15; transform: scale(0.97); }
  100% { opacity: 0.5; }
}

#shot-log-table tr.shot-excluded td {
  text-decoration: line-through;
  color: var(--text-muted);
}

#shot-log-table tr.shot-excluded .shot-split.excluded {
  text-decoration: none;
  font-style: italic;
}

#shot-log-table tr.shot-excluded .shot-menu-cell,
#shot-log-table tr.shot-excluded .shot-toggle-btn {
  text-decoration: none;
}

/* Add Shot Button */

.btn-add-shot {
  background: rgba(52, 199, 89, 0.75);
  color: #000;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  flex-shrink: 0;
}

.btn-add-shot:hover:not(:disabled) {
  background: rgba(45, 184, 78, 0.85);
}

body.no-blur .btn-add-shot { background: var(--green); }

/* User-added shot styling */

tr.shot-user-added td:first-child {
  border-left: 3px solid var(--green);
}

.floating-bubble.bubble-user-added {
  box-shadow: 0 0 0 1px var(--green), 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* Playhead restyled during add-shot mode */
#waveform-container.add-shot-mode #playhead {
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.8) 0px,
    rgba(255, 255, 255, 0.8) 3px,
    transparent 3px,
    transparent 6px
  );
  width: 2px;
}

#waveform-container.add-shot-mode #playhead::after {
  content: "+";
  background: var(--green);
  color: #000;
  width: auto;
  height: auto;
  border-radius: 3px;
  border: none;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  padding: 2px 4px;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

@keyframes addShotPulse {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: 1; }
  50% { transform: translateX(-50%) scale(1.4); opacity: 0.5; }
}

#waveform-container.add-shot-mode.add-shot-pulse #playhead::after {
  animation: addShotPulse 0.6s ease;
}

/* End Cutoff */

.btn-cutoff {
  background: rgba(255, 159, 10, 0.75);
  color: #000;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.btn-cutoff:hover:not(:disabled) {
  background: rgba(230, 140, 5, 0.85);
}

#cutoff-display {
  font-size: 0.8rem;
  color: var(--yellow);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}

body.no-blur .btn-cutoff { background: #ff9f0a; }

/* Confirm Shots Button */

.btn-confirm-shots,
.btn-confirm-targets {
  background: rgba(74, 124, 255, 0.75);
  color: #fff;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.btn-confirm-shots:hover:not(:disabled),
.btn-confirm-targets:hover:not(:disabled) {
  background: rgba(58, 106, 239, 0.85);
}

/* Back Step Button */

.back-step-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.back-step-icon:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--text-muted);
}

#back-step .icon-undo { display: none; }
#back-step.is-undo .icon-back { display: none; }
#back-step.is-undo .icon-undo { display: flex; }

/* Gun Type Button & Popup */

.shot-gun-btn {
  opacity: 0.8;
  font-weight: 700;
  font-size: 0.7rem;
}

.shot-gun-btn:hover {
  opacity: 1;
}

.gun-type-popup {
  position: fixed;
  z-index: 9999;
  background: rgba(26, 29, 39, 0.92);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  min-width: 120px;
}

.gun-type-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.1s;
  white-space: nowrap;
}

.gun-type-option:hover {
  background: var(--surface-hover);
}

.gun-type-option.active {
  background: rgba(255, 255, 255, 0.08);
}

.gun-type-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-weight: 700;
  font-size: 0.8rem;
}
