/* General Body and Container Styles */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #0d1117; /* Dark background */
  color: #c9d1d9; /* Light text */
  margin: 0;
  padding: 0;
  line-height: 1.6;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
  background-color: #161b22; /* Dark container */
  border-radius: 0;
  box-shadow: none;
  border: none;
}

/* Mobile-specific styles */
@media (max-width: 480px) {
  body {
    font-size: 1.1em; /* Larger base font size for mobile */
  }
  
  .container {
    max-width: 100%;
    padding: 15px;
    background-color: #0d1117; /* Match body background on mobile */
  }
}

/* Headings */
h1 {
  color: #58a6ff; /* Lighter blue for dark mode */
  text-align: center;
  margin-top: 0px;
  margin-bottom: 25px;
  font-size: 2em;
  font-weight: 600;
}

h2 {
  color: #58a6ff; /* Lighter blue for dark mode */
  border-bottom: 2px solid #30363d;
  padding-bottom: 8px;
  margin-top: 25px;
  margin-bottom: 15px;
  font-size: 1.5em;
}

@media (max-width: 480px) {
  h1 {
    font-size: 2.5em; /* Larger on mobile */
    margin-bottom: 20px;
    margin-top: 0px;
  }
  
  h2 {
    font-size: 1.8em; /* Larger on mobile */
    margin-top: 20px;
  }
}


/* Player List */
.players ul {
  list-style-type: none;
  padding: 0;
}

.players li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #1c2128; /* Dark background for list items */
  margin-bottom: 6px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #30363d;
  font-size: 1em;
}

@media (max-width: 480px) {
  .players li {
    padding: 12px 15px;
    margin-bottom: 8px;
    font-size: 1.1em;
  }
}

.players li span {
  flex-grow: 1;
}

/* Forms and Inputs */
form {
  display: flex;
  flex-direction: column; /* Stack elements vertically on mobile */
  gap: 10px;
  margin-top: 15px; /* Slightly reduced margin */
}

input[type="text"] {
  width: 100%; /* Full width on mobile */
  padding: 10px;
  border: 1px solid #30363d; /* Dark border */
  border-radius: 8px;
  font-size: 1em;
  transition: border-color 0.3s ease;
  box-sizing: border-box; /* Include padding and border in the element's total width and height */
  background-color: #0d1117; /* Dark input background */
  color: #c9d1d9; /* Light text */
}

@media (max-width: 480px) {
  input[type="text"] {
    padding: 12px;
    font-size: 1.1em;
  }
}

input[type="text"]:focus {
  border-color: #58a6ff;
  outline: none;
}

/* Buttons */
button {
  padding: 10px 15px;
  border: none;
  background-color: #238636; /* Green for dark mode */
  color: white;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1em;
  font-weight: 600;
  transition: background-color 0.3s ease, transform 0.1s ease;
  width: 100%; /* Full width on mobile */
  box-sizing: border-box;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 480px) {
  button {
    padding: 12px 18px;
    font-size: 1.0em;
  }
}

button:hover {
  background-color: #2ea043; /* Lighter green on hover */
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

/* Delete Button (Trashcan) */
button.delete-player {
  background: none;
  border: none;
  color: #f85149; /* Lighter red for dark mode */
  font-size: 1.1em; /* Adjusted for mobile */
  cursor: pointer;
  padding: 0 5px;
  transition: color 0.3s ease;
  width: auto; /* Override full width for delete button */
}

button.delete-player:hover {
  color: #ff7b72;
  transform: scale(1.1);
}

/* Game and Team Display */
.games {
  text-align: center;
}

.game {
  background-color: #1c2128;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
}

.game h3 {
  color: #58a6ff;
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.2em;
}

@media (max-width: 480px) {
  .game h3 {
    font-size: 1.4em;
  }
}

.game ul, .teams ul {
  list-style-type: none;
  padding: 0;
}

.game li, .teams li {
  background-color: #1f2937; /* Dark blue-gray for teams */
  margin-bottom: 6px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #374151;
  font-weight: bold;
  color: #58a6ff;
  font-size: 1em;
}

@media (max-width: 480px) {
  .game li, .teams li {
    padding: 12px 15px;
    margin-bottom: 8px;
    font-size: 1.1em;
  }
}

.games p, .teams p {
  text-align: center;
  color: #8b949e;
  font-style: italic;
}

/* Actions Section */
.actions {
  display: flex;
  flex-wrap: wrap; /* Allow buttons to wrap to the next line */
  justify-content: center;
  gap: 10px; /* Reduced gap */
  margin-top: 25px; /* Slightly reduced margin */
  padding-top: 15px; /* Slightly reduced padding */
  border-top: 1px solid #30363d;
}

.actions form {
  margin: 0;
  /* flex-grow: 1; */ /* Remove flex-grow to prevent stretching */
  display: flex;
  justify-content: center;
}

.actions button {
  /* width: 100%; */ /* Remove full width for inline display */
  max-width: 150px; /* Adjust max-width for better inline fit */
}



.button-group {
  display: flex;
  justify-content: center;
  align-items: stretch;
  margin: 20px auto;
  width: fit-content;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.button-group button {
  border: none;
  border-radius: 0;
  padding: 12px 24px;
  background-color: #238636;
  color: white;
  cursor: pointer;
  font-size: 1em;
  font-weight: 600;
  transition: background-color 0.3s ease;
  margin: 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  flex: 1;
}

/* Separator between buttons */
.button-group button:not(:last-child) {
  border-right: 1px solid rgba(0, 0, 0, 0.2);
}

/* First button gets left rounded corners */
.button-group button:first-child {
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
}

/* Last button gets right rounded corners */
.button-group button:last-child {
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
}

.button-group button:hover {
  background-color: #2ea043;
}

.button-group button:active {
  background-color: #1a7f37;
}

/* Mobile-specific button group adjustments */
@media (max-width: 480px) {
  .button-group {
    width: 100%;
    margin: 20px 0;
  }
  
  .button-group button {
    padding: 12px 16px;
    font-size: 0.9em;
  }
}

/* Responsive Adjustments (Refined) */
@media (min-width: 481px) {
  /* Desktop styles */
  .container {
    margin: 15px auto;
    padding: 20px;
    background-color: #161b22;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
    border: 1px solid #30363d;
  }
  
  form {
    flex-direction: row;
  }

  input[type="text"] {
    width: calc(100% - 110px); /* Original width for larger screens */
  }

  button {
    width: auto;
  }

  .actions {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .actions button {
    width: auto;
    max-width: 200px;
  }
}
