/* Styles for the revamped matches page */

:root {
  --filter-bg: rgba(26, 35, 50, 0.7);
  --filter-border: rgba(0, 191, 255, 0.2);
  --filter-hover-bg: rgba(0, 191, 255, 0.1);
  --input-bg: rgba(17, 24, 39, 0.8);
}

.matches-main {
  padding-top: 80px;
  min-height: 100vh;
  background-color: var(--dark-background);
  background-image: radial-gradient(circle at 10% 20%, rgba(0, 191, 255, 0.1), transparent 30%),
    radial-gradient(circle at 90% 80%, rgba(0, 191, 255, 0.1), transparent 30%);
  padding-left: 0;
  padding-right: 0;
}

.matches-main .container {
  max-width: none;
  width: 100%;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 1280px) {
  .matches-main .container {
    padding-left: 3rem;
    padding-right: 3rem;
  }
}

@media (min-width: 1536px) {
  .matches-main .container {
    padding-left: 6rem;
    padding-right: 6rem;
  }
}

/* Filter Bar */
.filter-bar {
  background-color: var(--filter-bg);
  backdrop-filter: blur(10px);
  padding: 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid var(--filter-border);
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 2rem;
  justify-content: space-between;
  flex-wrap: wrap; /* Allow wrapping on larger screens */
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.filter-group .filter-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-300);
  white-space: nowrap;
}

.filter-pills {
  display: flex;
  gap: 0.5rem;
}

.filter-pills button {
  background-color: transparent;
  color: var(--gray-300);
  border: 1px solid var(--gray-700);
  padding: 0.5rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
  height: 2.25rem; /* Fixed height for consistency */
  display: flex;
  align-items: center;
  justify-content: center;
}

.filter-pills button:hover {
  background-color: var(--gray-800);
  color: white;
  border-color: var(--gray-600);
}

.filter-pills button.active {
  background-color: var(--primary-blue);
  color: var(--dark-background);
  border-color: var(--primary-blue);
  font-weight: 600;
  box-shadow: 0 0 10px rgba(0, 191, 255, 0.4);
}

.search-input-wrapper {
  flex-basis: auto; /* Allow content to dictate initial width */
  flex-grow: 1;
  flex-shrink: 1;
  position: relative;
  min-width: 150px; /* Adjust min-width as needed for the input field */
  max-width: 300px;
  display: flex;
  align-items: center;
  gap: 0.5rem; /* Gap between search label and input */
}

.search-input-wrapper i {
  /* No longer absolutely positioned, but still present if needed */
  position: static;
  transform: none;
  left: auto;
  color: var(--gray-400);
  width: 1rem;
  height: 1rem;
  z-index: 10;
  pointer-events: none;
}

.search-input {
  width: 100%;
  background-color: var(--input-bg);
  border: 1px solid var(--gray-700);
  color: white;
  padding: 0.5rem 1rem; /* Adjusted padding as icon is no longer inside */
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  height: 2.25rem;
  line-height: 1.25;
  box-sizing: border-box;
}

.search-input::placeholder {
  /* Placeholder styles removed */
  display: none;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 2px rgba(0, 191, 255, 0.3);
}

/* Matches Grid */
.matches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

@media (min-width: 768px) {
  .matches-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}

@media (min-width: 1024px) {
  .matches-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1280px) {
  .matches-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1600px) {
  .matches-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* Match Card Enhancements */
.match-card {
  background-color: var(--gray-900);
  border: 1px solid var(--gray-800);
  border-radius: 0.75rem;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.match-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 191, 255, 0.5);
  border-color: rgba(0, 191, 255, 0.5);
}

.match-card-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--gray-800);
}

.match-card-content {
  padding: 1rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.match-card-players {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.player-info {
  flex: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.player-info .avatar {
  width: 4rem;
  height: 4rem;
  border-width: 2px;
}

.player-info .player-name {
  color: white;
  font-weight: 600;
  font-size: 1rem;
  margin-top: 0.5rem;
  line-height: 1.2;
  width: 100%;
  text-decoration: none; /* Removed underline from player name links */
}

.player-info .player-country {
  color: var(--gray-400);
  font-size: 0.875rem;
}

.player-info .flag-icon {
  font-size: 1.25rem;
  margin-top: 0.25rem;
}

.vs-separator {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-blue);
  padding-top: 1.5rem;
}

.winner-badge {
  background-color: #f59e0b;
  color: var(--dark-background);
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  margin-top: 0.25rem;
  text-transform: uppercase;
}

.match-card-details {
  border-top: 1px solid var(--gray-800);
  padding-top: 1rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.detail-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--gray-300);
  gap: 1rem;
}

.detail-item .label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gray-400);
  flex-shrink: 0;
}

.detail-item .label i {
  width: 1rem;
  height: 1rem;
}

/* Streamer list in match card */
.streamer-list-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.streamer-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.streamer-item-link {
  text-decoration: none;
}
.streamer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: rgba(0, 0, 0, 0.2);
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  transition: background-color 0.2s;
}
.streamer-item-link:hover .streamer-item {
  background-color: rgba(0, 191, 255, 0.1);
}
.streamer-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gray-300);
  font-weight: 500;
  min-width: 0;
}
.streamer-info span:first-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.streamer-platform {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  text-transform: capitalize;
  flex-shrink: 0;
  color: white;
}

.match-card-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: auto;
  width: 100%;
}

.match-card-actions .btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Status-specific styles */
.match-card[data-status="live"] {
  border-color: #ef4444;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
}
.match-card[data-status="upcoming"] {
  border-color: var(--primary-blue);
}
.match-card[data-status="completed"] {
  opacity: 0.8;
}
.match-card[data-status="completed"]:hover {
  opacity: 1;
}

/* Loading and Error states */
.centered-message {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 40vh;
  color: var(--gray-300);
  font-size: 1.125rem;
}

/* Section headings */
.match-section-heading {
  color: white;
  font-size: 2.25rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 1rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

/* Countdown badge */
.badge-countdown {
  background-color: var(--primary-blue);
  color: var(--dark-background);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  animation: pulse-countdown 1.5s infinite;
}

@keyframes pulse-countdown {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 191, 255, 0.7);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(0, 191, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 191, 255, 0);
  }
}

/* Styles for the revamped streamer modal */
.streamer-item-modal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: rgba(31, 41, 55, 0.4);
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--gray-700);
  text-decoration: none;
  transition: all 0.2s ease-in-out;
}

.streamer-item-modal:hover {
  background-color: var(--filter-hover-bg);
  border-color: var(--primary-blue);
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 4px 15px rgba(0, 191, 255, 0.1);
}

/* Responsive adjustments for filter bar */
@media (max-width: 799px) {
  .filter-bar {
    flex-direction: column; /* Stack items vertically */
    align-items: flex-start; /* Align items to the start */
    gap: 1rem; /* Gap between rows */
    padding-bottom: 0.75rem; /* Add padding for scroll indicator if visible */
    overflow-x: hidden; /* Prevent main bar from scrolling horizontally */
    flex-wrap: wrap; /* Allow wrapping of filter groups */
  }

  .filter-group {
    width: 100%; /* Each filter group takes full width */
    flex-wrap: nowrap; /* Prevent filter pills from wrapping within their group */
    overflow-x: auto; /* Enable horizontal scrolling for filter pills */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    scrollbar-width: none; /* Hide scrollbar for Firefox */
    justify-content: flex-start; /* Align pills to the start */
    padding-bottom: 0.25rem; /* Small padding for scroll indicator */
  }

  .filter-group::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome, Safari, Opera */
  }

  .filter-group .filter-label {
    flex-shrink: 0; /* Prevent label from shrinking */
    margin-right: 0.5rem; /* Space between label and pills */
  }

  .filter-pills {
    flex-grow: 1; /* Allow pills container to take available space */
    flex-shrink: 0; /* Prevent pills container from shrinking */
    white-space: nowrap; /* Ensure pills stay in one line */
  }

  .search-input-wrapper {
    width: 100%; /* Search input wrapper takes full width */
    max-width: none; /* Remove max-width constraint */
    flex-grow: 1; /* Allow it to grow */
    flex-shrink: 0; /* Prevent shrinking */
  }

  .search-input {
    width: 100%; /* Search input takes full width of its wrapper */
  }
}

/* Mobile-specific adjustments for Matches page (max-width: 640px) */
@media (max-width: 640px) {
  .matches-main .container {
    padding-left: 1rem; /* Reverted */
    padding-right: 1rem; /* Reverted */
  }

  .match-section-heading {
    font-size: 1.75rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
  }

  .match-card-header {
    padding: 0.75rem 1rem; /* Reverted */
  }

  .match-card-content {
    padding: 1rem; /* Reverted */
  }

  .player-info .avatar {
    width: 3.5rem;
    height: 3.5rem;
  }

  .player-info .player-name {
    font-size: 0.9375rem;
  }

  .player-info .player-country {
    font-size: 0.75rem;
  }

  .vs-separator {
    font-size: 1.125rem;
    padding-top: 1.25rem;
  }

  .detail-item {
    font-size: 0.8125rem;
  }

  .streamer-item {
    font-size: 0.875rem; /* Reverted */
    padding: 0.375rem 0.75rem; /* Reverted */
  }

  .match-card-actions .btn {
    font-size: 0.8125rem;
    padding: 0.625rem 0.75rem;
  }

  .streamer-item-modal {
    padding: 0.75rem 1rem; /* Reverted */
    font-size: 0.875rem; /* Reverted */
  }
}

/* Further adjustments for very small screens (max-width: 480px) */
@media (max-width: 480px) {
  .matches-main {
    padding-top: 70px; /* Adjust for potentially smaller header */
  }

  .matches-main .container {
    padding-left: 1rem; /* Reverted */
    padding-right: 1rem; /* Reverted */
  }

  .filter-bar {
    padding: 0.75rem; /* Reverted */
    gap: 1rem; /* Reverted */
  }

  .filter-group .filter-label {
    font-size: 0.875rem; /* Reverted */
  }

  .filter-pills button {
    font-size: 0.875rem; /* Reverted */
    padding: 0.5rem 0.75rem; /* Reverted */
    height: 2.25rem; /* Reverted */
  }

  .search-input {
    font-size: 0.875rem; /* Reverted */
    padding: 0.5rem 1rem; /* Reverted */
    height: 2.25rem; /* Reverted */
  }

  .match-section-heading {
    font-size: 1.5rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
  }

  .match-card-header {
    padding: 0.75rem 1rem; /* Reverted */
  }

  .match-card-content {
    padding: 1rem; /* Reverted */
  }

  .player-info .avatar {
    width: 3rem;
    height: 3rem;
  }

  .player-info .player-name {
    font-size: 0.875rem;
  }

  .player-info .player-country {
    font-size: 0.6875rem;
  }

  .vs-separator {
    font-size: 1rem;
    padding-top: 1rem;
  }

  .detail-item {
    font-size: 0.75rem;
  }

  .streamer-item {
    font-size: 0.875rem; /* Reverted */
    padding: 0.375rem 0.75rem; /* Reverted */
  }

  .match-card-actions .btn {
    font-size: 0.75rem;
    padding: 0.5rem 0.625rem;
  }

  .streamer-item-modal {
    padding: 0.75rem 1rem; /* Reverted */
    font-size: 0.875rem; /* Reverted */
  }
}

/* Player name hover pulse animation */
@keyframes subtle-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

.player-name-hover-pulse:hover {
  animation: subtle-pulse 0.3s ease-in-out;
}
