.matches-filter-container {
  display: flex;
  justify-content: space-between;
  border-radius: 12px;
  background: #1e293b;
  overflow: hidden;
  margin-bottom: 20px;
  position: relative;
  padding: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  width: 100%;
  box-sizing: border-box;
}

.matches-filter-container::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 20px;
  background: linear-gradient(90deg, transparent 0%, #1e293b 70%, #1e293b 100%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}

.matches-filter-container.has-scroll::after {
  opacity: 1;
}

@media (max-width: 1279px) {
  .matches-filter-container::after {
    display: none;
  }
}

@media (min-width: 1280px) {
  .matches-filter-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
  }
}

.filter-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition: all 0.3s ease;
  outline: none;
  border: none;
  cursor: pointer;
  margin: 0;
  padding: 10px 16px;
  gap: 6px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  text-decoration: none;
  min-height: 36px;
  box-shadow: none;
  min-width: 0;
  flex: 1;
}

.filter-btn:focus-visible {
  outline: 2px solid #ffd700;
  outline-offset: 2px;
}

.filter-btn:disabled {
  pointer-events: none;
  opacity: 0.5;
}

.filter-btn svg {
  pointer-events: none;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

@media (min-width: 1280px) {
  .filter-btn {
    gap: 8px;
    font-size: 14px;
    padding: 4px 20px;
  }

  .filter-btn svg {
    width: 18px;
    height: 18px;
  }
}

.filter-btn:hover {
  background: #7c8593;
  transform: translateY(-1px);
}

.filter-btn.active {
  background: #fbbf24;
  color: #000000;
  box-shadow: 0 2px 8px rgba(251, 191, 36, 0.4);
  font-weight: 700;
}

.filter-btn.active:hover {
  background: #f59e0b;
  transform: translateY(-1px);
}

/* Dark mode styles removed - using fixed theme */

.filter-btn-text {
  display: block;
  transition: opacity 0.2s ease;
}

.filter-btn-text.mobile-show {
  display: none;
}

@media (max-width: 1279px) {
  .filter-btn-text.xl-only {
    display: none;
  }

  .filter-btn-text.mobile-show {
    display: block;
  }
}

@media (min-width: 1280px) {
  .filter-btn-text.hidden-xl {
    display: none;
  }

  .filter-btn-text.mobile-show {
    display: none;
  }
}

/* Filter Animation */
.matches-grid.filtering {
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.match-item {
  transition: all 0.3s ease;
}

.filter-no-matches {
  text-align: center;
  padding: 40px 20px;
  margin: 20px 0;
  color: #ffffff;
  font-size: 16px;
  background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
  border-radius: 12px;
  border: 2px solid #34495e;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Enhanced Responsive Filter Styles */
@media (max-width: 1279px) {
  .matches-filter-container {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 4px;
    background: #1e293b;
  }

  .matches-filter-container::-webkit-scrollbar {
    display: none;
  }

  .filter-btn {
    min-width: 85px;
    white-space: nowrap;
    padding: 8px 14px;
    font-size: 12px;
    min-height: 34px;
    gap: 4px;
    margin-right: 3px;
  }

  .filter-btn:last-child {
    margin-right: 0;
  }

  .filter-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
  }

  .filter-btn-text.xl-only {
    display: none;
  }

  .filter-btn-text.mobile-show {
    display: block;
  }
}

@media (max-width: 768px) {
  .matches-filter-container {
    margin-bottom: 15px;
    padding: 3px;
    background: #1e293b;
    position: relative;
  }

  .filter-btn {
    padding: 8px 10px;
    font-size: 11px;
    min-height: 32px;
    min-width: 70px;
    gap: 3px;
    margin-right: 2px;
  }

  .filter-btn svg {
    width: 16px;
    height: 16px;
  }
}

@media (max-width: 480px) {
  .filter-btn {
    padding: 6px 8px;
    font-size: 10px;
    min-height: 30px;
    min-width: 65px;
    gap: 2px;
    margin-right: 2px;
  }

  .filter-btn svg {
    width: 14px;
    height: 14px;
  }

  .filter-btn-text {
    font-size: 9px;
  }
}

/* Touch and scroll states */
.matches-filter-container.touching {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}

.matches-filter-container.scrolling .filter-btn {
  pointer-events: none;
}

.filter-btn:active {
  transform: scale(0.95);
  transition: transform 0.1s ease;
}

.filter-btn:focus {
  outline: 2px solid #ffd700;
  outline-offset: 2px;
}

/* Smooth scroll behavior */
.matches-filter-container {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* Better visual feedback on mobile */
@media (max-width: 1279px) {
  .filter-btn:hover {
    background: #7c8593;
  }

  .filter-btn.active:hover {
    background: #f59e0b;
  }
}

.live-matches-container {
  width: 100%;
  margin: 0 auto;
  padding: 20px;
}

/* Matches Grid - 3 Column Layout */
.matches-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 20px;
}

.match-item {
  width: 100%;
  height: auto;
  min-width: 0; /* Prevents flex item from growing beyond parent */
  overflow: hidden; /* Prevents content from overflowing */
}

/* Match Card */
.match-card {
  background: url("./bg-nui-dark.png") no-repeat center center;
  background-size: cover;
  border-radius: 12px;
  border: 2px solid #34495e;
  overflow: hidden;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.match-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Mountain Background Pattern */
.match-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 300'%3E%3Cpath d='M0,300 L0,200 L100,150 L200,180 L300,120 L400,160 L500,100 L600,140 L700,80 L800,120 L900,60 L1000,100 L1100,40 L1200,80 L1200,300 Z' fill='%23000000' opacity='0.2'/%3E%3Cpath d='M0,300 L0,220 L150,180 L250,200 L350,160 L450,180 L550,140 L650,160 L750,120 L850,140 L950,100 L1050,120 L1150,80 L1200,100 L1200,300 Z' fill='%23000000' opacity='0.1'/%3E%3C/svg%3E");
  background-size: cover;
  background-position: bottom;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 1;
}

/* League Header */
.league-header {
  position: relative;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 2;
  min-height: 50px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.league-header:hover {
  opacity: 0.9;
}

.league-name {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.viewers-display {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.viewers-display svg {
  margin-top: -4px;
}

.match-time-display {
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Live Badge and Viewers */
.live-badge,
.offline-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
}

.live-badge {
  background: #e74c3c;
  padding: 4px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  animation: pulse-red 2s infinite;
}

.offline-badge {
  background: #7f8c8d;
  padding: 4px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.offline-badge::before {
  content: "🔥";
  margin-right: 4px;
}

@keyframes pulse-red {
  0% {
    background-color: #e74c3c;
  }
  50% {
    background-color: #c0392b;
  }
  100% {
    background-color: #e74c3c;
  }
}

.teams-section {
  position: relative;
  padding: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 2;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.teams-section:hover {
  opacity: 0.9;
}

.team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
  color: #ffffff;
}

.team-logo {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid #ecf0f1;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
}

.team-logo:hover {
  transform: scale(1.1);
}

.team-logo img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 50%;
}

.team-name {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Score Section */
.score-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.score-container {
  background: linear-gradient(to bottom, #231abd, #0a1d89);
  padding: 4px 8px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.score-container {
  display: flex;
  align-items: center;
  gap: 4px;
}

.score {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.score-separator {
  font-size: 20px;
  font-weight: 600;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.icon-live {
  height: 12px;
  width: 12px;
  object-fit: contain;
}

/* Match Status */
.match-status {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  color: #00be23;
  background: rgba(39, 174, 96, 0.2);
  border: 1px solid rgba(39, 174, 96, 0.5);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.live-time {
  border: none;
  background: none;
  padding: 0;
  font-size: 20px;
}

.match-status.live {
  color: #00be23;
}

.hidden {
  display: none;
}

.match-status.live::after {
  content: "";
  animation: blink 1s infinite;
}

@keyframes blink {
  0%,
  50% {
    opacity: 1;
  }
  51%,
  100% {
    opacity: 0;
  }
}

.match-time {
  color: #ecf0f1;
  font-size: 16px;
  font-weight: 600;
}

/* Commentator Section with Swiper */
.commentator-section {
  position: relative;
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 2;
}

.commentator-swiper {
  position: relative;
  width: 100%;
  overflow: hidden; /* Prevents infinite width */
  max-width: 100%; /* Ensures it doesn't exceed parent */
}

.commentator-swiper .swiper-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  flex-shrink: 0;
}

.commentator-swiper .swiper-wrapper {
  max-width: 100%;
}

.commentator-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex: 1;
  width: 100%;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.commentator-info:hover {
  opacity: 0.9;
}

.commentator-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.commentator-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.commentator-details {
  min-width: 0;
}

.commentator-name {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.commentator-title {
  font-size: 11px;
  font-weight: 400;
  color: #bdc3c7;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Swiper Navigation Buttons */
.commentator-swiper .swiper-button-next,
.commentator-swiper .swiper-button-prev {
  width: 24px;
  height: 24px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #ffffff;
  margin-top: -12px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.commentator-swiper .swiper-button-next:after,
.commentator-swiper .swiper-button-prev:after {
  font-size: 12px;
  font-weight: 600;
}

.commentator-swiper .swiper-button-next:hover,
.commentator-swiper .swiper-button-prev:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.commentator-swiper .swiper-button-next {
  right: 0px;
}

.commentator-swiper .swiper-button-prev {
  left: 0px;
}

.commentator-swiper .swiper-pagination-bullet {
  width: 6px;
  height: 6px;
  background: rgba(255, 255, 255, 0.4);
  opacity: 1;
  margin: 0 3px;
  transition: all 0.3s ease;
}

.commentator-swiper .swiper-pagination-bullet-active {
  background: #ffffff;
  transform: scale(1.2);
}

/* Hide navigation when only one slide */
.commentator-swiper[data-slides="1"] .swiper-button-next,
.commentator-swiper[data-slides="1"] .swiper-button-prev,
.commentator-swiper[data-slides="1"] .swiper-pagination {
  display: none !important;
}

/* Center pagination when there are few slides */
.commentator-swiper.swiper-center-pagination .swiper-pagination {
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2px;
}

.commentator-swiper.swiper-center-pagination .swiper-pagination-bullet {
  position: relative;
  margin: 0 2px;
  transform: none;
}

.commentator-swiper.swiper-center-pagination .swiper-pagination-bullet-active {
  background: #ffffff;
  transform: scale(1.3);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* Enhanced pagination for 2-3 slides */
.commentator-swiper[data-slides="2"] .swiper-pagination,
.commentator-swiper[data-slides="3"] .swiper-pagination {
  justify-content: center;
  text-align: center;
}

.commentator-swiper[data-slides="2"] .swiper-pagination-bullet,
.commentator-swiper[data-slides="3"] .swiper-pagination-bullet {
  width: 8px;
  height: 8px;
  margin: 0 4px;
  background: rgba(255, 255, 255, 0.6);
}

.commentator-swiper[data-slides="2"] .swiper-pagination-bullet-active,
.commentator-swiper[data-slides="3"] .swiper-pagination-bullet-active {
  background: #ffffff;
  transform: scale(1.4);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
}

.viewers-count {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: #bdc3c7;
}

.flame-icon {
  width: 10px;
  height: 10px;
  color: #f39c12;
}

/* Commentator Controls */
.commentator-controls {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.nav-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: #3498db;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.nav-btn:hover {
  background: #2980b9;
  transform: scale(1.1);
}

.nav-btn:active {
  transform: scale(0.95);
}

.nav-btn svg {
  width: 12px;
  height: 12px;
}

/* Loading State */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 20px;
  background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
  border-radius: 12px;
  color: #ffffff;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid #ffffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.loading-state p {
  font-size: 16px;
  color: #ffffff;
  margin: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* No Matches Message */
.lmp-no-matches {
  text-align: center;
  padding: 60px 20px;
  color: #ffffff;
  font-size: 18px;
  background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
  border-radius: 12px;
  border: 2px solid #34495e;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* === NEW API HELPER UI STYLES === */

/* Message styling */
.lmp-message {
  padding: 12px 16px;
  margin: 10px 0;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  position: relative;
  animation: lmpSlideIn 0.3s ease-out;
}

.lmp-message.lmp-success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.lmp-message.lmp-error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

@keyframes lmpSlideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Button styling */
.lmp-refresh-btn,
.lmp-status-btn {
  margin: 10px 5px !important;
  padding: 8px 16px !important;
  border: none !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  transition: all 0.2s ease !important;
  display: inline-block !important;
}

.lmp-refresh-btn {
  background: #0073aa !important;
  color: white !important;
}

.lmp-refresh-btn:hover:not(:disabled) {
  background: #005a87 !important;
  transform: translateY(-1px);
}

.lmp-status-btn {
  background: #46b450 !important;
  color: white !important;
}

.lmp-status-btn:hover:not(:disabled) {
  background: #39a944 !important;
  transform: translateY(-1px);
}

.lmp-refresh-btn:disabled,
.lmp-status-btn:disabled {
  opacity: 0.7 !important;
  cursor: not-allowed !important;
  transform: none !important;
}

/* Control panel styling */
.lmp-controls {
  margin: 15px 0;
  padding: 15px;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
}

.lmp-controls h4 {
  margin: 0 0 10px 0;
  color: #495057;
  font-size: 16px;
}

/* API status indicator */
.lmp-api-status {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  margin-left: 10px;
}

.lmp-api-status.online {
  background: #d4edda;
  color: #155724;
}

.lmp-api-status.offline {
  background: #f8d7da;
  color: #721c24;
}

.lmp-api-status.checking {
  background: #fff3cd;
  color: #856404;
}

/* Enhanced loading state */
.loading-state.enhanced {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  position: relative;
  z-index: 1000;
}

.loading-state.enhanced::before {
  content: "";
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #0073aa;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s linear infinite;
  margin-right: 10px;
  vertical-align: middle;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .lmp-controls {
    padding: 10px;
  }

  .lmp-refresh-btn,
  .lmp-status-btn {
    display: block !important;
    width: 100% !important;
    margin: 5px 0 !important;
  }

  .lmp-message {
    font-size: 13px;
    padding: 10px 12px;
  }
}

/* Responsive Design */
@media (max-width: 1200px) {
  .matches-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
}

@media (max-width: 768px) {
  .matches-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .live-matches-container {
    padding: 15px;
  }

  .teams-section {
    padding: 10px;
  }

  .team-logo {
    width: 50px;
    height: 50px;
  }

  .team-logo img {
    width: 40px;
    height: 40px;
  }

  .score {
    font-size: 20px;
  }

  .team-name {
    font-size: 12px;
    max-width: 100px;
  }

  .commentator-section {
    padding: 10px 12px;
  }

  .commentator-name {
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .matches-grid {
    gap: 10px;
  }

  .teams-section {
    padding: 8px;
  }

  .team-logo {
    width: 45px;
    height: 45px;
  }

  .team-logo img {
    width: 35px;
    height: 35px;
  }

  .score {
    font-size: 18px;
  }

  .league-name {
    font-size: 12px;
  }

  .team-name {
    font-size: 11px;
    max-width: 80px;
  }
}
