/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Import base styles - comprehensive design system */
@import "base.css";

/* Legacy styles below are kept for backward compatibility */
/* TODO: Gradually refactor these to use the new base system */

/* Clip-specific variables (scoped to avoid conflicts with base theme) */
:root {
  --clip-bg: #fafbfc;
  --player-bg: #222;
}
html.dark-mode {
  --clip-bg: #232a36;
  --player-bg: #181c22;
}

#clip-list-column {
  background: var(--player-bg) !important;
}
#clip-list-column li {
  background: var(--clip-bg) !important;
  cursor: pointer;
}
#clip-list-column li a {
  color: inherit;
  text-decoration: none;
  display: block;
  width: 100%;
  height: 100%;
}
#custom-main-player span,
#custom-main-player label,
#custom-main-player input,
#custom-main-player select {
  color: inherit !important;
}

#main-time, #in-out-display {
  color: inherit !important;
}

#clip-list-column li:hover, #clip-list-column li:focus {
  box-shadow: 0 0 0 2px #4f8cff88;
  background: #e0e7ef;
}
html.dark-mode #clip-list-column li:hover, html.dark-mode #clip-list-column li:focus {
  background: #232a36;
  box-shadow: 0 0 0 2px #4f8cffcc;
}

.header-btn {
  background: #f3f4f6;
  color: #2c3e50;
  border: none !important;
  border-radius: 7px !important;
  width: 2.4em;
  height: 2.4em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  box-shadow: none;
  outline: none;
  margin: 0;
  padding: 0;
}
.header-btn:focus {
  outline: none;
}
.header-btn:hover, .header-btn:focus {
  background: #e0e7ef;
  box-shadow: 0 0 0 2px #60a5fa88;
}
html.dark-mode .header-btn {
  background: #23272f;
  color: #f3f4f6;
}
html.dark-mode .header-btn:hover, html.dark-mode .header-btn:focus {
  background: #323846;
  box-shadow: 0 0 0 2px #4f8cff88;
}
.header-btn,
.header-btn:focus,
.header-btn:active {
  border: none !important;
  box-shadow: none;
  outline: none;
}

.sc-btn {
  background: #4f8cff;
  color: #fff;
  border: none;
  border-radius: 7px;
  width: 2.4em;
  height: 2.4em;
  padding: 0;
  font-size: 1.3em;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  outline: none;
  box-shadow: none;
  margin: 0 0.2em 0.2em 0;
}
.sc-btn:focus {
  outline: none;
  box-shadow: 0 0 0 2px #60a5fa88;
}
.sc-btn:hover, .sc-btn:active {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 0 0 2px #60a5fa88;
}
html.dark-mode .sc-btn {
  background: #232a36;
  color: #fff;
  border: 1px solid #4f8cff;
}
html.dark-mode .sc-btn:hover, html.dark-mode .sc-btn:active {
  background: #4f8cff;
  color: #fff;
  box-shadow: 0 0 0 2px #4f8cff88;
}
.sc-btn.save-btn {
  background: #e0f7e9;
  color: #1a7f37;
  border-radius: 0.5em;
  width: 2.2em;
  height: 2.2em;
  padding: 0;
  font-size: 1.3em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  border: none;
  transition: box-shadow 0.18s, background 0.18s;
}
.sc-btn.save-btn:hover, .sc-btn.save-btn:focus {
  background: #b6f5d8;
  box-shadow: 0 0 0 2px #60fa9a88;
}
.sc-btn.cancel-btn {
  background: #f3f4f6;
  color: #b91c1c;
  border-radius: 0.5em;
  width: 2.2em;
  height: 2.2em;
  padding: 0;
  font-size: 1.3em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  border: none;
  transition: box-shadow 0.18s, background 0.18s;
}
.sc-btn.cancel-btn:hover, .sc-btn.cancel-btn:focus {
  background: #fbeaea;
  box-shadow: 0 0 0 2px #fa606088;
}
html.dark-mode .sc-btn.save-btn {
  background: #1a7f37;
  color: #e0f7e9;
}
html.dark-mode .sc-btn.save-btn:hover, html.dark-mode .sc-btn.save-btn:focus {
  background: #23b35d;
  box-shadow: 0 0 0 2px #60fa9a88;
}
html.dark-mode .sc-btn.cancel-btn {
  background: #23272f;
  color: #fa6060;
}
html.dark-mode .sc-btn.cancel-btn:hover, html.dark-mode .sc-btn.cancel-btn:focus {
  background: #3a2323;
  box-shadow: 0 0 0 2px #fa606088;
}

/* Video Player Controls */
.video-player-container {
  width: 100%;
  max-width: 900px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  box-sizing: border-box;
  margin: 0 auto var(--spacing-xl) auto;
  box-shadow: var(--shadow-md);
}

.video-controls {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  margin-top: var(--spacing-sm);
  flex-wrap: wrap;
}

.video-control-btn {
  font-size: 1.1em;
  border: none !important;
  outline: none !important;
}

.video-control-btn:focus {
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
}

.video-play-pause {
  font-size: 1.2em;
}

.video-time-display {
  color: var(--text-color);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.9em;
  font-weight: 500;
  margin-left: var(--spacing-xs);
}

.video-timeline {
  width: 100%;
  margin-top: var(--spacing-sm);
  accent-color: var(--primary);
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: none !important;
  outline: none !important;
}

.video-timeline:focus {
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
}

.video-timeline::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  border: none !important;
}

.video-timeline::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-md);
}

.video-timeline::-webkit-slider-thumb:focus {
  outline: none !important;
  border: none !important;
}

.video-timeline::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: none;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.video-timeline::-moz-range-thumb:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-md);
}

.video-timeline::-moz-range-thumb:focus {
  outline: none !important;
  border: none !important;
}

.video-timeline::-webkit-slider-track {
  width: 100%;
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  border: none !important;
}

.video-timeline::-moz-range-track {
  width: 100%;
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  border: none;
}

/* Modal Components */
.modal-overlay {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.45);
  align-items: center;
  justify-content: center;
}

.modal-overlay.high-z {
  z-index: 10001;
}

.modal {
  background: var(--card-bg);
  color: var(--text-color);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: var(--spacing-xl) var(--spacing-xl) var(--spacing-lg) var(--spacing-xl);
  min-width: 340px;
  max-width: 95vw;
  max-height: 90vh;
  overflow: auto;
  position: relative;
}

.modal-center {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.modal-close {
  position: absolute;
  top: var(--spacing-md);
  right: var(--spacing-md);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5em;
  cursor: pointer;
  padding: var(--spacing-xs);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.modal-close:hover {
  color: var(--text-color);
  background: var(--bg-secondary);
}

.modal h2 {
  margin-top: 0;
  font-size: 1.3em;
  color: var(--text-color);
}

.modal h2.primary {
  color: var(--primary);
}

.modal h2.danger {
  color: var(--danger);
}

.modal-icon {
  font-size: 2.2em;
  margin-bottom: 0.5em;
}

.modal p {
  margin-bottom: var(--spacing-lg);
  color: var(--text-muted);
  text-align: center;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--spacing-md);
}

.modal-actions.center {
  justify-content: center;
}

.modal-error {
  color: var(--danger);
  margin-top: var(--spacing-sm);
  display: none;
}

.modal-form-group {
  margin-bottom: var(--spacing-md);
}

.modal-form-group label {
  font-weight: 600;
  color: var(--text-color);
  display: block;
  margin-bottom: var(--spacing-xs);
}

.modal-textarea {
  width: 100%;
  padding: var(--spacing-sm);
  border-radius: var(--radius-sm);
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--input-text);
  font-size: 1em;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
}

.modal-textarea:focus {
  outline: none;
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px var(--primary-transparent);
}

/* Form Input Styling for Modals */
.form-input {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--input-text);
  font-size: 1em;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px var(--primary-transparent);
}

.form-input:disabled {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* Toggle Groups for Modal Forms */
.toggle-group {
  display: flex;
  gap: var(--spacing-xs);
  flex-wrap: wrap;
  margin-top: var(--spacing-xs);
}

.toggle-group input[type="radio"] {
  display: none;
}

.toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xs) var(--spacing-sm);
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-text);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.875rem;
  font-weight: 500;
  min-width: 2.5em;
  text-align: center;
}

.toggle-btn:hover {
  background: var(--btn-secondary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.toggle-group input[type="radio"]:checked + .toggle-btn {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  border-color: var(--btn-primary-bg);
  box-shadow: var(--shadow-sm);
}

.toggle-group input[type="radio"]:checked + .toggle-btn:hover {
  background: var(--btn-primary-hover);
  border-color: var(--btn-primary-hover);
}

/* Clip List Layout - Compact View */
.clip-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: var(--spacing-sm);
}

.clip-list-item {
  background: var(--card-bg);
  border-bottom: 1px solid var(--card-border);
  padding: var(--spacing-sm) var(--spacing-md);
  cursor: pointer;
  transition: background-color 0.15s ease;
  font-size: 0.9rem;
  line-height: 1.5;
}

.clip-list-item:first-child {
  border-top: 1px solid var(--card-border);
}

.clip-list-item:hover {
  background: var(--bg-secondary);
}

.clip-list-item:focus {
  outline: none;
  background: var(--bg-secondary);
  box-shadow: inset 0 0 0 2px var(--primary-transparent);
}

.clip-list-item .clip-team {
  font-weight: 600;
}

.clip-list-item .clip-down-distance {
  color: var(--text-color);
}

.clip-list-item .clip-time {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
  font-weight: 500;
  color: var(--text-muted);
}

.empty-clip-message {
  text-align: center;
  padding: var(--spacing-xl);
  color: var(--text-muted);
  font-size: 1rem;
}

/* Game Show Page Styling */
.game-summary-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-md);
  box-shadow: var(--shadow-md);
  position: relative;
}

.game-teams-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-lg);
  flex-wrap: wrap;
}

.game-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-xs);
}

.team-name {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
}

.team-score {
  font-size: 3rem;
  font-weight: 900;
  color: var(--text-color);
  text-align: center;
  line-height: 1;
}

.game-vs {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 var(--spacing-md);
}

.game-date {
  font-size: 0.875rem;
  color: var(--text-muted);
  background: var(--bg-secondary);
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
}

@media (max-width: 768px) {
  .game-teams-container {
    gap: var(--spacing-md);
  }
  
  .team-score {
    font-size: 2.5rem;
  }
  
  .team-name {
    font-size: 1.25rem;
  }
  
  .game-vs {
    margin: 0 var(--spacing-sm);
  }
}

/* Video and Clip Cards */
.video-card,
.clip-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.video-card:hover,
.clip-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-focus);
}

.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.video-thumbnail,
.clip-thumbnail {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-thumbnail-image,
.clip-thumbnail-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-thumbnail-placeholder,
.clip-thumbnail-placeholder {
  font-size: 3rem;
  color: var(--text-muted);
}

.video-clip-count,
.clip-duration,
.clip-half {
  position: absolute;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
}

.video-clip-count {
  bottom: var(--spacing-xs);
  right: var(--spacing-xs);
}

.clip-duration {
  bottom: var(--spacing-xs);
  left: var(--spacing-xs);
}

.clip-half {
  top: var(--spacing-xs);
  right: var(--spacing-xs);
}

.card-body {
  padding: var(--spacing-md);
}

.card-title {
  margin: 0 0 var(--spacing-xs) 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-color);
  line-height: 1.3;
}

.card-meta {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  font-size: 0.875rem;
}

.clip-teams {
  margin-bottom: var(--spacing-xs);
  font-size: 0.875rem;
}

.clip-teams .team-name {
  font-weight: 600;
  font-size: inherit;
}

/* Section Styling */
.section {
  margin-bottom: var(--spacing-xl);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: var(--spacing-xl);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: var(--spacing-md);
  opacity: 0.6;
}

.empty-state-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-color);
  margin: 0 0 var(--spacing-sm) 0;
}

.empty-state-text {
  color: var(--text-muted);
  margin: 0 0 var(--spacing-lg) 0;
  font-size: 1rem;
  line-height: 1.5;
}

.empty-state-actions {
  display: flex;
  justify-content: center;
  gap: var(--spacing-md);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .clip-list {
    gap: 0;
  }
  
  .clip-list-item {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.85rem;
  }
}

/* Modal styles */
.modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.4);
}

.modal-content {
  background-color: #fefefe;
  margin: 15% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  max-width: 500px;
  border-radius: 8px;
}

.close-button {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
}

.close-button:hover,
.close-button:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}

.color-picker-wrapper {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.color-picker-swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
}

.color-picker-swatch.selected {
  border-color: #007bff;
}