/* Custom styles for Mario Kart 8 Watcher */

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

.footer {
  margin-top: auto;
}

/* Race card */
.race-card {
  border-left: 4px solid #0d6efd;
  transition: box-shadow 0.3s;
}

.race-card:hover {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.race-card.mode-0 {
  border-left-color: #0d6efd; /* Blue for VS Race */
}

.race-card.mode-1 {
  border-left-color: #dc3545; /* Red for Battle */
}

.race-card.mode-2 {
  border-left-color: #198754; /* Green for Tournament */
}

.race-card.mode-3 {
  border-left-color: #ffc107; /* Yellow for Friend Room */
}

/* Player badge */
.player-badge {
  display: inline-block;
  margin: 2px;
  padding: 4px 8px;
  background-color: #f8f9fa;
  border-radius: 4px;
  font-size: 0.9rem;
}

/* Lobby owner (creator) */
.player-badge.owner {
  background-color: #fff3cd;
  border: 1px solid #ffc107;
}

/* Favorite players */
.player-badge.favorite {
  background-color: #f8d7da;
  border: 2px solid #dc3545;
  font-weight: 500;
}

.player-badge i.bi-star-fill {
  color: #ffc107;
}

/* Guest players (local co-op) */
.player-badge.guest {
  background-color: #d1ecf1;
  border: 1px solid #0dcaf0;
}

.player-badge i.bi-person-plus-fill {
  color: #0dcaf0;
}

/* Table hover effect */
.table tbody tr {
  transition: background-color 0.2s;
}

.table tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.03);
}

/* Loading spinner */
.loading-container {
  text-align: center;
  padding: 2rem;
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 500;
}

.status-badge.online {
  background-color: #d1e7dd;
  color: #0f5132;
}

.status-badge.offline {
  background-color: #f8d7da;
  color: #842029;
}

/* Navbar active link */
.navbar-nav .nav-link.active {
  font-weight: bold;
}

/* Card headers */
.card-header {
  background-color: #f8f9fa;
  font-weight: 600;
}

/* Charts */
canvas {
  max-height: 400px;
}

/* Responsive table */
@media (max-width: 768px) {
  .table {
    font-size: 0.875rem;
  }

  .race-card {
    margin-bottom: 1rem;
  }
}

/* Pulse animation for live indicator */
@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}

.live-indicator {
  animation: pulse 2s infinite;
}

/* Favorite button */
.btn-favorite {
  border: none;
  background: none;
  color: #6c757d;
  font-size: 1.2rem;
  cursor: pointer;
  transition: color 0.2s;
}

.btn-favorite:hover {
  color: #ffc107;
}

.btn-favorite.active {
  color: #ffc107;
}

/* Copy button */
.btn-copy {
  font-size: 0.8rem;
  padding: 2px 6px;
}

/* Clickable player badge */
.player-badge.player-clickable {
  cursor: pointer;
  transition: all 0.2s;
}

.player-badge.player-clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  background-color: #e7f3ff;
  border-color: #0d6efd;
}

/* Activity timeline */
.activity-timeline {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  height: 120px;
  padding: 10px;
  background-color: #f8f9fa;
  border-radius: 8px;
  gap: 2px;
  overflow-x: auto;
}

.timeline-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 20px;
}

.timeline-bar {
  width: 100%;
  min-height: 2px;
  background: linear-gradient(to top, #0d6efd, #6ea8fe);
  border-radius: 2px 2px 0 0;
  transition: all 0.3s;
}

.timeline-day:hover .timeline-bar {
  background: linear-gradient(to top, #0a58ca, #0d6efd);
}

.timeline-day small {
  font-size: 0.65rem;
  color: #6c757d;
  writing-mode: horizontal-tb;
  transform: rotate(-45deg);
  margin-top: 4px;
}

/* Clickable race card */
.race-card.race-clickable {
  cursor: pointer;
  transition: all 0.2s;
}

.race-card.race-clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.2);
}

/* Gantt chart timeline for race modal */
.gantt-container {
  background-color: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #dee2e6;
  overflow: hidden;
}

.gantt-header {
  display: flex;
  background-color: #e9ecef;
  border-bottom: 2px solid #dee2e6;
  font-weight: 600;
  font-size: 0.9rem;
}

.gantt-player-column {
  min-width: 180px;
  max-width: 180px;
  padding: 10px 15px;
  border-right: 2px solid #dee2e6;
}

.gantt-timeline-column {
  flex: 1;
  padding: 10px 15px;
  position: relative;
}

.gantt-time-markers {
  display: flex;
  justify-content: space-between;
  color: #6c757d;
  font-size: 0.85rem;
}

.gantt-body {
  max-height: 500px;
  overflow-y: auto;
}

.gantt-row {
  display: flex;
  border-bottom: 1px solid #e9ecef;
  transition: background-color 0.2s;
}

.gantt-row:hover {
  background-color: #ffffff;
}

.gantt-player-name {
  min-width: 180px;
  max-width: 180px;
  padding: 8px 15px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border-right: 2px solid #dee2e6;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.gantt-player-name:hover {
  background-color: #e7f3ff;
  color: #0d6efd;
}

.gantt-timeline-track {
  flex: 1;
  padding: 8px 15px;
  position: relative;
  min-height: 40px;
  background-color: #e9ecef;
}

.session-timeline-bar {
  display: block;
  position: absolute;
  height: 24px;
  min-width: 2px;
  border-radius: 4px;
  transition: all 0.3s;
  cursor: pointer;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
}

.session-timeline-bar.active {
  background: linear-gradient(90deg, #198754, #20c997);
  border: 2px solid #146c43;
}

.session-timeline-bar.ended {
  background: linear-gradient(90deg, #0d6efd, #6ea8fe);
  border: 2px solid #0a58ca;
}

.session-timeline-bar:hover {
  transform: translateY(-50%) scaleY(1.2);
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
/* Clickable Statistics Cards */
.stat-card.clickable {
  cursor: pointer;
  transition: all 0.3s ease;
}

.stat-card.clickable:hover {
  transform: translateY(-5px);
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.15);
}

.stat-card.active {
  border: 3px solid #0d6efd;
  box-shadow: 0 0 15px rgba(13, 110, 253, 0.5);
}

.stat-card.text-bg-success.active {
  border-color: #146c43;
  box-shadow: 0 0 15px rgba(20, 108, 67, 0.5);
}

.stat-card.text-bg-warning.active {
  border-color: #cc8800;
  box-shadow: 0 0 15px rgba(204, 136, 0, 0.5);
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: white;
  border: 1px solid #dee2e6;
  border-top: none;
  border-radius: 0 0 0.375rem 0.375rem;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  display: none;
}

.autocomplete-dropdown.show {
  display: block;
}

.autocomplete-item {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: background-color 0.2s;
  border-bottom: 1px solid #f8f9fa;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.active {
  background-color: #e7f3ff;
}

.autocomplete-item .player-name {
  font-weight: 500;
  color: #212529;
}

.autocomplete-item .player-pid {
  font-size: 0.85rem;
  color: #6c757d;
  margin-left: 0.5rem;
}

.autocomplete-item .player-info {
  font-size: 0.75rem;
  color: #6c757d;
  margin-top: 0.25rem;
}

/* Selected Player Badge */
.selected-player-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background-color: #e7f3ff;
  border: 1px solid #0d6efd;
  border-radius: 0.375rem;
  font-size: 0.9rem;
}

.selected-player-badge .player-name {
  font-weight: 500;
  color: #0d6efd;
}

.selected-player-badge .remove-btn {
  background: none;
  border: none;
  color: #dc3545;
  cursor: pointer;
  padding: 0;
  font-size: 1.1rem;
  line-height: 1;
  transition: color 0.2s;
}

.selected-player-badge .remove-btn:hover {
  color: #bb2d3b;
}

/* DataTables control column */
td.dt-control {
  background: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PC9zdmc+') no-repeat center center;
  cursor: pointer;
  text-align: center;
  width: 30px;
  padding: 8px !important;
}

td.dt-control i {
  font-size: 1.2rem;
  transition: transform 0.2s;
}

td.dt-control:hover i {
  transform: scale(1.2);
}
