* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #53a2d4 0%, #2a5570 100%);
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
}

header {
  text-align: center;
  color: white;
  padding: 30px 0;
}

header h1 {
  font-size: 2.5rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Game Selector */
.game-selector {
  background: white;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.selector-content {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.selector-content label {
  font-weight: bold;
  color: #53a2d4;
  font-size: 1.1rem;
}

.selector-content select {
  flex: 1;
  min-width: 250px;
  padding: 12px;
  border: 2px solid #53a2d4;
  border-radius: 8px;
  font-size: 1rem;
  background: white;
  cursor: pointer;
  transition: all 0.3s;
}

.selector-content select:hover {
  border-color: #764ba2;
}

.selector-content select:focus {
  outline: none;
  border-color: #764ba2;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.selected-game-info {
  flex: 1;
  padding: 12px 20px;
  background: linear-gradient(135deg, #53a2d4, #764ba2);
  color: white;
  border-radius: 8px;
  font-weight: 500;
}

.no-game-message {
  text-align: center;
  padding: 40px;
  color: #999;
  font-size: 1.1rem;
  font-style: italic;
}

.dashboard {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
}

section {
  background: white;
  border-radius: 10px;
  padding: 25px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

section h2 {
  color: #53a2d4;
  margin-bottom: 20px;
  font-size: 1.8rem;
}

.add-form {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.add-form input,
.add-form select {
  flex: 1;
  min-width: 150px;
  padding: 10px;
  border: 2px solid #ddd;
  border-radius: 5px;
  font-size: 1rem;
}

.add-form button {
  padding: 10px 20px;
  background: #53a2d4;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: bold;
  transition: background 0.3s;
}

.add-form button:hover {
  background: #764ba2;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
}

thead {
  background: #53a2d4;
  color: white;
}

th, td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

tbody tr:hover {
  background: #f5f5f5;
}

.rank-1 {
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  font-weight: bold;
}

.rank-2 {
  background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
  font-weight: bold;
}

.rank-3 {
  background: linear-gradient(135deg, #cd7f32 0%, #e6a157 100%);
  font-weight: bold;
}

.action-btn {
  padding: 5px 10px;
  margin: 0 3px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: opacity 0.3s;
}

.action-btn:hover {
  opacity: 0.7;
}

.update-btn {
  background: #4CAF50;
  color: white;
}

.copy-btn {
  background: #17a2b8;
  color: white;
}

.copy-btn:hover {
  background: #138496;
}

.delete-btn {
  background: #f44336;
  color: white;
}

.status-badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: bold;
}

.status-scheduled {
  background: #2196F3;
  color: white;
}

.status-in-progress {
  background: #FF9800;
  color: white;
}

.status-completed {
  background: #4CAF50;
  color: white;
}

.status-cancelled {
  background: #9E9E9E;
  color: white;
}

.status-active {
  background: #4CAF50;
  color: white;
}

.status-inactive {
  background: #9E9E9E;
  color: white;
}

/* Players Section */
.players-section {
  margin-top: 20px;
}

.players-form {
  display: grid;
  grid-template-columns: 2fr 2fr 2fr 1fr;
  gap: 10px;
  align-items: center;
}

.players-form input[type="text"],
.players-form input[type="email"] {
  padding: 10px;
  border: 2px solid #667eea;
  border-radius: 5px;
  font-size: 0.95rem;
}

.players-form input:focus {
  outline: none;
  border-color: #764ba2;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.players-form button {
  padding: 10px 20px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s;
}

.players-form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

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

.modal.show {
  display: block;
}

.modal-content {
  background-color: #fefefe;
  margin: 5% auto;
  padding: 0;
  border: 1px solid #888;
  border-radius: 10px;
  width: 90%;
  max-width: 1000px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
  padding: 20px;
  background: linear-gradient(135deg, #53a2d4, #764ba2);
  color: white;
  border-radius: 10px 10px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  color: white;
}

.close {
  color: white;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s;
}

.close:hover,
.close:focus {
  transform: scale(1.2);
}

.modal-body {
  padding: 25px;
  max-height: calc(85vh - 120px);
  overflow-y: auto;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #333;
  font-weight: 600;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #53a2d4;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.team-coach-assignment {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 15px;
  border-left: 4px solid #53a2d4;
}

.team-coach-assignment h4 {
  color: #53a2d4;
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.coach-select-group {
  margin-top: 10px;
}

.coach-select-group label {
  display: block;
  margin-bottom: 5px;
  font-size: 0.9rem;
  color: #666;
}

.coach-select-group select {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 5px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 25px;
  padding: 15px 25px;
  background: #f9f9f9;
  border-top: 1px solid #e0e0e0;
  border-radius: 0 0 10px 10px;
  flex-shrink: 0;
}

.btn-primary,
.btn-secondary {
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-primary {
  background: linear-gradient(135deg, #53a2d4, #764ba2);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background: #5a6268;
}

/* Scoring Categories Styles */
.btn-add-category {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  margin-bottom: 15px;
  font-weight: 600;
  transition: all 0.3s;
}

.btn-add-category:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(40, 167, 69, 0.3);
}

.scoring-categories-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 400px;
  overflow-y: auto;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 8px;
}

.scoring-category-item {
  background: white;
  padding: 15px;
  border-radius: 8px;
  border: 2px solid #e0e7ff;
}

.category-row {
  display: grid;
  grid-template-columns: 100px 120px 2fr 80px 100px 40px;
  gap: 10px;
  align-items: end;
}

.category-field label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  color: #53a2d4;
  font-size: 0.85rem;
}

.category-field input[type="text"],
.category-field input[type="number"] {
  width: 100%;
  padding: 8px;
  border: 2px solid #53a2d4;
  border-radius: 5px;
  font-size: 0.9rem;
}

.category-field input[type="text"]:focus,
.category-field input[type="number"]:focus {
  outline: none;
  border-color: #764ba2;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.category-field-checkbox {
  display: flex;
  align-items: center;
}

.category-field-checkbox label {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  cursor: pointer;
}

.category-field-checkbox input[type="checkbox"] {
  cursor: pointer;
  width: 18px;
  height: 18px;
}

.category-field-action {
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-remove-category {
  background: #dc3545;
  color: white;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.btn-remove-category:hover {
  background: #c82333;
  transform: scale(1.1);
}

@media (max-width: 768px) {
  header h1 {
    font-size: 1.8rem;
  }

  section {
    padding: 15px;
  }

  table {
    font-size: 0.9rem;
  }

  th, td {
    padding: 8px;
  }
  
  .category-row {
    grid-template-columns: 1fr;
  }
  
  .category-field {
    width: 100%;
  }
}

/* ========================================
   TEAM BUILDER STYLES
   ======================================== */

.team-builder-section {
  background: white;
  border-radius: 10px;
  padding: 25px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.team-builder-container {
  margin-top: 20px;
}

.create-team-form {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 30px;
}

.create-team-form h3 {
  margin-bottom: 15px;
  color: #53a2d4;
}

.teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.team-card {
  background: white;
  border: 2px solid #e0e7ff;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s;
}

.team-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(102, 126, 234, 0.2);
  border-color: #53a2d4;
}

.team-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 2px solid #e0e7ff;
}

.team-card-header h3 {
  color: #53a2d4;
  font-size: 1.3rem;
  margin: 0;
}

.btn-manage {
  background: linear-gradient(135deg, #53a2d4, #764ba2);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s;
}

.btn-manage:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

.team-card-body {
  margin: 15px 0;
}

.team-stat {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}

.team-stat:last-child {
  border-bottom: none;
}

.stat-label {
  color: #666;
  font-weight: 500;
}

.stat-value {
  color: #53a2d4;
  font-weight: bold;
}

.team-card-footer {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 2px solid #e0e7ff;
  text-align: right;
}

.btn-danger-small {
  background: #dc3545;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.3s;
}

.btn-danger-small:hover {
  background: #c82333;
}

/* Team Management Modal Styles */
#teamManagementModal .modal-content {
  max-width: 900px;
}

.add-item-inline {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  padding: 15px;
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
  border-radius: 8px;
  border: 2px solid #4caf50;
}

.add-item-inline input {
  flex: 1;
  padding: 10px;
  border: 2px solid #4caf50;
  border-radius: 5px;
  font-size: 0.95rem;
}

.add-item-inline input:focus {
  outline: none;
  border-color: #2e7d32;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.add-item-inline button {
  background: linear-gradient(135deg, #4caf50, #2e7d32);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s;
  white-space: nowrap;
}

.add-item-inline button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(76, 175, 80, 0.3);
}

.add-player-inline {
  display: grid;
  grid-template-columns: 2fr 2fr 2fr 1fr;
  gap: 10px;
}

.add-player-inline input {
  width: 100%;
}

.game-assignment {
  margin-bottom: 20px;
}

.game-assignment select {
  width: 100%;
  padding: 10px;
  border: 2px solid #53a2d4;
  border-radius: 5px;
  font-size: 0.95rem;
}

.game-assignment button {
  background: linear-gradient(135deg, #53a2d4, #764ba2);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s;
  width: 100%;
}

.game-assignment button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

.coach-assignment {
  margin-bottom: 20px;
}

.coach-assignment label {
  display: block;
  margin-bottom: 8px;
  color: #53a2d4;
  font-weight: 600;
}

.coach-assignment button {
  background: linear-gradient(135deg, #53a2d4, #764ba2);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s;
  width: 100%;
}

.coach-assignment button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

.assigned-list {
  margin-top: 20px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
}

.assigned-list h4 {
  color: #53a2d4;
  margin-bottom: 10px;
}

.assigned-list ul {
  list-style: none;
  padding: 0;
}

.assigned-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  margin-bottom: 8px;
  background: white;
  border-radius: 5px;
  border: 1px solid #e0e7ff;
}

.btn-remove-small {
  background: #dc3545;
  color: white;
  border: none;
  padding: 4px 10px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.3s;
}

.btn-remove-small:hover {
  background: #c82333;
}

.player-drafting {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 15px;
}

.available-players,
.drafted-players {
  border: 2px solid #e0e7ff;
  border-radius: 8px;
  padding: 15px;
  background: #f8f9fa;
}

.available-players h4,
.drafted-players h4 {
  color: #53a2d4;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e0e7ff;
}

#playerSearchInput {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  border: 2px solid #53a2d4;
  border-radius: 5px;
  font-size: 0.95rem;
}

#playerSearchInput:focus {
  outline: none;
  border-color: #764ba2;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.player-list {
  max-height: 400px;
  overflow-y: auto;
}

.player-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  margin-bottom: 10px;
  background: white;
  border-radius: 5px;
  border: 1px solid #e0e7ff;
  transition: all 0.3s;
}

.player-item:hover {
  border-color: #53a2d4;
  box-shadow: 0 2px 5px rgba(102, 126, 234, 0.1);
}

.player-item.drafted {
  background: linear-gradient(135deg, #f5f7fa, #e0e7ff);
  border-color: #53a2d4;
}

.player-item.player-unavailable {
  background: #f5f5f5;
  border-color: #d0d0d0;
  opacity: 0.6;
  cursor: not-allowed;
}

.player-item.player-unavailable:hover {
  border-color: #d0d0d0;
  box-shadow: none;
}

.player-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.player-info strong {
  color: #333;
  font-size: 1rem;
}

.player-score {
  color: #666;
  font-size: 0.85rem;
}

.player-drafted-label {
  color: #dc3545;
  font-size: 0.8rem;
  font-weight: 600;
  font-style: italic;
}

.btn-draft {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  border: none;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.3s;
.btn-draft:disabled {
  background: #9e9e9e;
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
  box-shadow: none;
}

.btn-draft:disabled:hover {
  transform: none;
  box-shadow: none;
}

}

.btn-draft:hover {
  transform: scale(1.05);
  box-shadow: 0 3px 8px rgba(40, 167, 69, 0.3);
}

@media (max-width: 768px) {
  .teams-grid {
    grid-template-columns: 1fr;
  }
  
  .player-drafting {
    grid-template-columns: 1fr;
  }
}

/* Real-time notification animations */
@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

.notification {
  animation: slideIn 0.3s ease;
}
