/* Live Matches Plugin Styles - Exact Match Interface */
.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);
}

/* 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: 8px1;
  }

  .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;
  }
}
