html,
body {
  margin: 0;
  padding: 0;
  background-color: #0b132b;
  font-family: "Verdana", sans-serif;
}

/* Header */
.main-header {
  background: linear-gradient(to right, #fff700, #FFFC00, #ffd700); /* Gradient around Snapchat Yellow */
  padding: 0.5rem 0;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */
}

.title {
  color: black; /* Black font for contrast with yellow */
  font-size: 3.5rem;
  margin: 0;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5); /* Subtle white shadow */
}

/* Layout */
.main-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 2rem;
  max-width: 1200px;
  margin: 2rem auto;
  padding: 1rem;
}

/* Pitch Section */
.pitch-panel {
  flex: 2;
  min-width: 250px;
}

.pitch {
  width: 100%;
  height: 600px;
  background-color: #17876d;
  border-radius: 10px;
  padding: 2rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
  max-width: 500px;
  box-sizing: border-box;
  border: 3px solid #ffffff33;
}

.position-row {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.position-slot {
  background-color: rgba(255, 255, 255, 0.15);
  border: 1px dashed #ffffff88;
  border-radius: 8px;
  width: 120px;
  height: 80px;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1rem;
  font-weight: bold;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.position-slot:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

/* Player Panel */
.player-panel {
  flex: 1;
  min-width: 260px;
  max-width: 300px;
  background: linear-gradient(135deg, #e0e7ef, #d6dee8);
  border: 1px solid #ccc;
  border-radius: 10px;
  padding: 1rem;
  height: auto;
  max-height: 90vh;
  overflow-y: auto;
  align-self: flex-start;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  margin: 0 auto; /* Center the player panel horizontally */
}

.filters {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.filters input,
.filters select {
  padding: 0.5rem;
  font-size: 1rem;
}

.filters select {
  padding: 0.5rem;
  font-size: 1rem;
  border: 1px solid #ccc; /* Add a subtle border */
  border-radius: 5px; /* Rounded corners */
  background-color: #f9f9f9; /* Light background for a clean look */
  color: #333; /* Dark text for readability */
  transition: all 0.3s ease; /* Smooth transition for hover effects */
  appearance: none; /* Remove default browser styling */
  cursor: pointer;
}

.filters select:hover {
  border-color: #007bff; /* Highlight border on hover */
  background-color: #e6f0ff; /* Slightly lighter background on hover */
}

.filters select:focus {
  outline: none; /* Remove default focus outline */
  border-color: #0056b3; /* Darker blue border on focus */
  box-shadow: 0 0 5px rgba(0, 91, 187, 0.5); /* Add a subtle glow effect */
}

.player-group-header {
  font-size: 1.1rem;
  font-weight: bold;
  color: #333;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  padding-left: 1rem;
  border-bottom: 1px solid #ccc;
}

/* Player Entry */
.player-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  margin-bottom: 0.5rem;
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  transition: background-color 0.2s ease, transform 0.1s ease;
  cursor: pointer;
}

.player-entry:hover {
  background-color: #f9f9f9;
  transform: translateY(-2px);
}

/* Player Name */
.player-name {
  font-weight: bold;
  font-size: 0.9rem;
  color: #333;
  flex-grow: 1;
}

/* Player Club */
.player-club {
  font-size: 0.8rem;
  color: #777;
  margin-left: 0.5rem;
}

/* EA Rating */
.ea-rating {
  font-weight: bold;
  font-size: 1rem;
  color: #00796b;
}

/* Info Button */
.info-button {
  background: none;
  border: none;
  color: #007bff;
  font-size: 1.2rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.info-button:hover {
  color: #0056b3;
}

.player-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
}

.player-right {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-shrink: 0;
}

.player-rating,
.ea-rating {
  font-weight: bold;
  font-size: 1rem;
  color: #00796b;
}

/* Footer */
footer {
  text-align: center;
  padding: 1rem;
  background-color: #0b132b;
  color: #ccc;
  font-size: 0.9rem;
}

footer a {
  color: #77c9d4;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

.footer-author-message {
  font-size: 0.85rem;
  color: #bbb;
  font-style: italic;
  margin-top: 0.5rem;
  text-align: center;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: opacity 0.3s ease;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: linear-gradient(135deg, #e0e7ef, #d6dee8); /* Match player list background */
  color: #333;
  padding: 1.5rem;
  border-radius: 10px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  margin: 0 auto; /* Center the modal content horizontally */
}

#closePlayerListModal {
  cursor: pointer;
  font-size: 1.5rem;
  font-weight: bold;
  color: #333;
  border: none;
  background: none;
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  transition: color 0.2s ease;
}

#closePlayerListModal:hover {
  color: #d32f2f;
}

/* Another Modal (Player Profile Card, Generated by AI) */
.player-profile-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 15, 15, 0.75);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.3s ease;
}

.player-profile-modal.hidden {
  display: none;
}

.player-profile-content {
  background: linear-gradient(135deg, #f7f9fc, #e0e7ef);
  border-radius: 12px;
  padding: 2rem;
  max-width: 420px;
  width: 90%;
  text-align: center;
  color: #333;
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.close-profile-btn {
  position: absolute;
  top: 0.5rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.75rem;
  color: #333;
  cursor: pointer;
}

.close-profile-btn:hover {
  color: #d32f2f;
}

.profile-details img {
  width: 160px;
  height: 200px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 1rem;
}

.profile-details h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.profile-details p {
  margin: 0.3rem 0;
  font-size: 0.95rem;
  color: #444;
}

.player-credit {
  font-size: 0.85rem;
  color: #666;
  font-style: italic;
  margin-top: 0.5rem;
}


/* Responsive Behavior */
@media (max-width: 768px) {
  .player-profile-content {
    width: 95%;
  }
}

/* Scrollable Player List */
.scrollable-player-list {
  overflow-y: auto; /* Enable vertical scrolling */
  scrollbar-width: none; /* Hide scrollbar in Firefox */
}

.scrollable-player-list::-webkit-scrollbar {
  width: 0; /* Hide scrollbar in WebKit browsers (Chrome, Edge, Safari) */
}

.slot-filled {
  width: 100%;
  height: 100%;
  background-color: #FFFC00;
  color: black;
  font-size: 0.85rem;
  font-weight: bold;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 3px solid black;
  border-radius: 10px;
  text-align: center;
  position: relative;
}

.pitch-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.pitch-action-btn {
  background-color: red;
  color: black;
  border: 2px solid black;
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.pitch-action-btn:hover {
  background-color: red;
  transform: translateY(-2px);
}

.pitch-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hidden {
  display: none;
}

/* Responsiveness */
@media (max-width: 768px) {
  .main-container {
    flex-direction: column;
  }

  .pitch-panel,
  .player-panel {
    width: 100%;
    max-width: 100%;
  }

  .pitch-panel {
    order: -1;
    margin-bottom: 1rem;
  }

  .player-panel {
    width: 100%;
    max-width: 95%; /* Prevent overspill on smaller screens */
    margin: 0 auto; /* Center horizontally */
  }

  .modal-content {
    width: 95%; /* Prevent overspill on smaller screens */
    margin: 0 auto; /* Center horizontally */
  }
}

@media (max-width: 500px) {
  .pitch {
    height: 480px;
    padding: 1rem;
  }

  .position-slot {
    width: 100px;
    height: 80px;
    font-size: 0.85rem;
  }

  .title {
    font-size: 2.5rem;
    line-height: 1.2;
  }

  .filters select {
    padding: 0.4rem;
    font-size: 0.95rem;
  }

  .player-panel {
    width: 100%;
    max-width: 90%; /* Further reduce width for very small screens */
    margin: 0 auto; /* Center horizontally */
  }

  .modal-content {
    width: 90%; /* Further reduce width for very small screens */
    margin: 0 auto; /* Center horizontally */
  }
}

.header-author-instructions {
  display: none; /* Default: hide on all screens */
}

@media (min-width: 768px) {
  .header-author-instructions {
    display: block;
    max-width: 900px;
    margin: 0.5rem auto 1rem auto;
    padding: 0 1rem;
    font-size: 0.95rem;
    color: #222;
    text-align: center;
  }
}
