/* General Body & Background Styles */
body {
  background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
  background-size: 600% 600%;
  animation: bgAnimation 30s ease infinite;
  color: white; /* Default text color */
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  min-height: 100vh; /* Ensure body takes full viewport height */
  display: flex; /* Use flexbox for body to manage content vertically */
  flex-direction: column;
}

/* Ensure main content takes available space */
.container {
    flex-grow: 1;
}

@keyframes bgAnimation {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* General Styles for Containers/Sections */
/* No explicit shadow, replaced with subtle border in Blade */
.mb-5.p-4.rounded-3 {
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Custom styles for messages that should be white */
#searchResults .text-muted,
#initialRoleMessage.text-muted {
    color: white !important; /* Override Bootstrap's text-muted to be white */
}

/* ===== Team Cards Grid Styles ===== */
.team-cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* Adaptive columns, min 200px */
  gap: 1.5rem;
  justify-content: center; /* Center the grid items */
}

.team-card {
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.5);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform 0.3s ease; /* Removed box-shadow from transition */
}

.team-card:hover {
  transform: scale(1.05);
  /* Removed box-shadow on hover as per user request */
}

.team-card.active-team { /* Style for the currently selected team */
  border-color: #28a745; /* Green border */
  /* Removed box-shadow for active state */
}

.team-img {
  width: 100%;
  height: auto;
  max-height: 150px; /* Max height to prevent excessively large images on larger screens */
  object-fit: contain;
  object-position: center center;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.team-card-content {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex-grow: 1;
}

.card-title-team {
  font-weight: 700;
  font-size: 1.4rem;
  text-align: center;
  color: #28a745; /* Green for team names */
  margin-bottom: 0.3rem;
}


/* ===== Role Cards Grid Styles ===== */
.role-cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); /* Adaptive columns, min 180px */
  gap: 1.5rem;
  justify-content: center; /* Center the grid items */
}

.role-card {
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.5);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  text-align: center;
  transition: transform 0.3s ease; /* Removed box-shadow from transition */
  /* Removed fixed width/height for flexibility */
}

.role-card:hover {
  transform: scale(1.05);
  /* Removed box-shadow on hover */
}

.role-img-wrapper { /* Wrapper for the image to control its area */
  width: 100%;
  height: 150px; /* Fixed height for the image area */
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.role-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top; /* Ini yang diubah */
  filter: blur(5px);
  transition: filter 0.3s ease;
}

.role-card-content {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  flex-grow: 1;
}

.card-title-role {
  font-weight: 700;
  font-size: 1.2rem;
  color: #0d6efd;
  margin-bottom: 0.3rem;
}

.player-count {
  font-size: 0.9rem;
  color: #cbd5e1;
}

/* ===== Player Cards Grid inside Modal & Search Results ===== */
.player-cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* Adaptive columns, min 280px */
  gap: 1rem;
  justify-content: center; /* Center the grid items */
}

.player-card {
  background-color: #1f1f2e;
  color: white;
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform 0.3s ease; /* Removed box-shadow from transition */
  border: 1px solid rgba(255, 255, 255, 0.1); /* Border as shadow alternative */
}

.player-card:hover {
  transform: translateY(-5px);
  /* Removed box-shadow on hover */
}

.player-card h5 {
  margin-bottom: 0.4rem;
  color: #0d6efd; /* Blue for player names */
}

.player-card p {
  margin-bottom: 0.5rem;
  color: #ddd; /* Light gray for paragraph details */
}

.badge {
  font-size: 0.85rem;
}

.d-flex.justify-content-between {
  margin-top: auto; /* Pushes badges to the bottom */
}


/* ===== Responsive Adjustments (Media Queries) ===== */

/* For devices smaller than 992px (e.g., tablets in portrait, large phones) */
@media (max-width: 991.98px) {
  .container {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }

  h2 { font-size: 2rem; }
  h3 { font-size: 1.75rem; }
  h4 { font-size: 1.5rem; }

  .lead { font-size: 1rem; }

  .team-cards-container {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
  }

  .role-cards-container {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
  }

  .player-cards-container {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.8rem;
  }

  .btn-lg {
    font-size: 1rem;
    padding: 0.6rem 1.2rem;
  }
}

/* For devices smaller than 768px (e.g., most phones) */
@media (max-width: 767.98px) {
  .container {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
  }

  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.5rem; }
  h4 { font-size: 1.25rem; }

  .lead { font-size: 0.9rem; }

  .team-cards-container,
  .role-cards-container,
  .player-cards-container {
    grid-template-columns: 1fr; /* Stack cards in a single column */
    gap: 0.8rem;
  }

  .role-card {
    /* When stacked, allow role card to take full width */
    width: 100%;
    max-width: 300px; /* Max width to keep it readable on very wide phones */
    margin: 0 auto; /* Center individual cards when stacked */
  }

  .role-img-wrapper {
    height: 120px; /* Slightly reduce image height on small screens */
  }

  .btn-lg {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
  }

  /* Adjust modal width for very small screens */
  .modal-dialog {
    margin: 0.5rem;
  }
}

/* For devices smaller than 576px (e.g., small phones) */
@media (max-width: 575.98px) {
  .container {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
  }

  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
  h4 { font-size: 1rem; }

  .card-title-team, .card-title-role {
    font-size: 1.1rem;
  }

  .player-card p {
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
  }
}