/* ======== Reset básico ======== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", Roboto, sans-serif;
}

body {
  background: #f5f7fa;
  color: #333;
  line-height: 1.6;
  min-height: 100vh;
}

/* ======== Barra de navegación ======== */
#navbar {
  width: 100%;
  background: linear-gradient(90deg, #2c3e50, #3498db);
  padding: 40px 60px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 3px 10px rgba(0,0,0,0.25);
}

#navbar ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 25px;
}

#navbar a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  padding: 8px 12px;
  border-radius: 6px;
  transition: all 0.3s ease;
}

#navbar a:hover,
#navbar a.active {
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}

/* ======== Header ======== */
header {
  text-align: center;
  padding: 30px 15px 15px;
}

header h1 {
  font-size: 2.5rem;
  font-weight: 900;
  color: #2c3e50;
  text-shadow: 2px 2px 8px rgba(0,0,0,0.15);
  margin-bottom: 10px;
}

header h1 small {
  display: block;
  font-size: 1rem;
  color: #555;
  margin-top: 4px;
  font-weight: 400;
}

#top-controls {
  margin: 20px auto;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

#team-selector select,
#team-selector button {
  padding: 10px 15px;
  border: 2px solid #3498db;
  border-radius: 8px;
  background: #fff;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
label[for="selectTeam"] {
    font-size: 1.4rem;
    font-family: 'Roboto', sans-serif;
    color: #34495e;
    font-weight: 700;
    letter-spacing: 1px;
}


#team-selector select:focus,
#team-selector button:focus {
  outline: none;
  box-shadow: 0 0 10px rgba(41, 128, 185, 0.5);
  transform: scale(1.03);
}

/* ======== Nombre del equipo ======== */
#team-name-wrap {
  margin: 15px 0;
}

.highlighted-team,
#team-name {
  font-size: 2rem;
  color: #e67e22;
  font-weight: 800;
  margin: 15px 0;
  text-shadow: 2px 2px 6px rgba(0,0,0,0.2);
  letter-spacing: 1px;
  border-bottom: 3px solid #e67e22;
  display: inline-block;
  padding: 5px 15px;
  border-radius: 8px;
  background: rgba(255, 223, 186, 0.2);
  transition: transform 0.3s ease;
}

.highlighted-team:hover,
#team-name:hover {
  transform: scale(1.05);
}

/* ======== Layout principal ======== */
#container {
    
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 20px;
  flex-wrap: wrap;
}

aside#bench {
  width: 350px;
  background: #fff;
  border-radius: 12px;
  padding: 15px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.1);
}

aside#bench h3 {
  text-align: center;
  margin-bottom: 10px;
  font-size: 1.2rem;
  color: #2c3e50;
}

#players-list {
    
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 500px;
  overflow-y: auto;
}

#players-list div {
  padding: 8px 12px;
  background: #3498db;
  color: #fff;
  border-radius: 8px;
  cursor: grab;
  transition: transform 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

#players-list div:hover {
  transform: scale(1.05);
}

.player-number {
  font-weight: 700;
  background: rgba(255,255,255,0.2);
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 0.9rem;
}

.player-name {
  flex: 1;
  text-align: left;
}

/* ======== Cancha ======== */
#field-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* cancha arriba, botones abajo */
  min-width: 350px;
  max-width: 850px;
  background: #2ecc71;
  border-radius: 15px;
  padding: 15px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  height: 600px; /* ocupa todo el espacio de sección */
}

#field {
  width: 100%;
  flex: 1; /* ocupa todo el espacio disponible dentro de field-wrap */
  background: linear-gradient(180deg, #27ae60, #2ecc71);
  border: 3px solid #fff;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  margin-bottom: 10px;
}

#field .player {
  position: absolute;
  width: 55px;
  height: 55px;
  background: #3498db;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #fff;
  font-weight: bold;
  cursor: grab;
  box-shadow: 0 3px 8px rgba(0,0,0,0.2);
  transition: transform 0.25s ease;
}

#field .player span {
  line-height: 1.1;
}

#field .player .player-number {
  font-size: 0.8rem;
  margin-bottom: 2px;
  background: rgba(255,255,255,0.2);
  padding: 2px 4px;
  border-radius: 4px;
}

#field .player .player-name {
  font-size: 0.8rem;
}

#field .player:hover {
  transform: scale(1.1);
}

/* ======== Botones de control ======== */
/* ======== Botones de control debajo de cancha ======== */
#field-controls {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 15px; /* espacio entre cancha y botones */
  flex-wrap: wrap;
}

#field-controls button {
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  color: #fff;
  background: #f39c12;
  transition: background 0.3s ease, transform 0.25s ease;
}

#field-controls button:hover {
  background: #e67e22;
  transform: translateY(-2px);
}


/* ======== Modal crear equipo mejorado ======== */
.modal-hidden {
  display: none;
}

#modal-create {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 200;
}

.modal-card {
  background: #fff;
  padding: 35px 30px;
  border-radius: 18px;
  max-width: 600px;
  width: 90%;
  box-shadow: 0 8px 25px rgba(0,0,0,0.35);
  animation: fadeIn 0.35s ease;
}

.modal-card h3 {
  text-align: center;
  margin-bottom: 20px;
  font-size: 1.5rem;
  color: #2c3e50;
  letter-spacing: 0.5px;
  text-shadow: 1px 1px 5px rgba(0,0,0,0.1);
}

#new-players-list {
  max-height: 250px;
  overflow-y: auto;
  margin-bottom: 15px;
  border: 1px solid #ddd;
  padding: 10px;
  border-radius: 10px;
  background: #fdfdfd;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.create-form-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.create-form-row input,
.create-form-row select {
  padding: 10px 12px;
  border: 2px solid #3498db;
  border-radius: 8px;
  flex: 1;
  font-size: 1rem;
  transition: all 0.25s ease;
}

.create-form-row input:focus,
.create-form-row select:focus {
  outline: none;
  border-color: #2980b9;
  box-shadow: 0 0 8px rgba(52,152,219,0.4);
  transform: scale(1.02);
}

.create-form-row button {
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.create-form-row button:hover {
  background: linear-gradient(135deg, #2980b9, #2471a3);
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.create-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

.create-actions button {
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  transition: all 0.25s ease;
}

.create-actions button.save-btn {
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  color: #fff;
}

.create-actions button.save-btn:hover {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.create-actions button.cancel-btn {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: #fff;
}

.create-actions button.cancel-btn:hover {
  background: linear-gradient(135deg, #c0392b, #a93226);
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

#createHint {
  display: block;
  margin-top: 12px;
  font-size: 0.9rem;
  color: #555;
  text-align: center;
}

@keyframes fadeIn {
  from {opacity:0; transform:scale(0.9);}
  to {opacity:1; transform:scale(1);}
}
