/* ==========================================================
   MUFC CSS Stylesheet (Previous/Upcoming Carousel & Layout)
   ========================================================== */

/* ---------- Section 1: Slider Carousels ---------- */

.mufc-carousel-wrapper {
  position: relative;
  width: 100%;
  max-width: 500px;
  margin: 30px auto;
  direction: rtl;
  padding: 0 55px; /* space for horizontal arrows */
  box-sizing: border-box;
}

.mufc-carousel-container {
  display: flex;
  overflow: hidden;
  width: 100%;
}

.mufc-slide {
  display: none;
  width: 100%;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.mufc-slide.mufc-active {
  display: block;
  opacity: 1;
}

.mufc-card {
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  box-sizing: border-box;
}

/* Distinct border and shadow for live matches */
.mufc-card.live-match {
  border-color: #ff4d4d !important;
  box-shadow: 0 0 10px rgba(255, 77, 77, 0.15) !important;
}

.mufc-card-comp {
  font-size: 11px;
  font-weight: 700;
  color: #888;
  margin-bottom: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mufc-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: bold;
}
.mufc-badge.finished {
  background-color: #ffeaea;
  color: #c00;
}
.mufc-badge.upcoming {
  background-color: #eaf6ff;
  color: #007bff;
}

/* Blinking red badge for live matches */
.mufc-badge.live {
  background-color: #ff4d4d;
  color: #fff;
  animation: mufcBlink 1.5s infinite;
}

@keyframes mufcBlink {
  0% { opacity: 1; }
  50% { opacity: 0.4; }
  100% { opacity: 1; }
}

.mufc-card-teams {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 15px;
}

.mufc-card-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  flex: 1;
  min-width: 0;
}

.mufc-card-team img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.mufc-card-vs {
  font-size: 13px;
  color: #000;
  font-weight: 700;
  background: #f7f7f7;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #eee;
  white-space: nowrap;
}

.mufc-card.live-match .mufc-card-vs {
  background: #ffeaea;
  color: #ff4d4d;
  border-color: #ffcccc;
}

.mufc-card-time-row {
  font-size: 13px;
  font-weight: bold;
  color: #333;
  margin-bottom: 12px;
}

.mufc-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #666;
  border-top: 1px solid #eee;
  padding-top: 12px;
}

.mufc-card-venue {
  padding: 1px 8px;
  border-radius: 4px;
  background: #f5f5f5;
  font-size: 11px;
}

/* Nav Buttons on Desktop */
.mufc-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: #fff;
  border: 1px solid #ddd;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  transition: all 0.2s ease;
  z-index: 10;
  user-select: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.mufc-carousel-prev {
  right: 5px;
}

.mufc-carousel-next {
  left: 5px;
}

/* ---------- Section 2: Tab box ---------- */

.mufc-tabbox {
  margin: 30px 0;
  direction: rtl;
}

.mufc-tabbox-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 2px solid #eee;
  margin-bottom: 18px;
}

.mufc-tab-btn {
  padding: 12px 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  color: #888;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.mufc-tab-btn:hover { color: #c00; }

.mufc-tab-btn.active {
  color: #c00;
  border-bottom-color: #c00;
}

.mufc-tab-panel { display: none; }
.mufc-tab-panel.active { display: block; }

/* Sub-tabs (Table / Fixtures / Scorers / Assists / Other) */
.mufc-subtabs-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.mufc-subtab-btn {
  padding: 6px 14px;
  border: 1px solid #eee;
  border-radius: 20px;
  background: #fafafa;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  color: #666;
  transition: all 0.15s ease;
}

.mufc-subtab-btn:hover { border-color: #c00; color: #c00; }

.mufc-subtab-btn.active {
  background: #c00;
  border-color: #c00;
  color: #fff;
}

.mufc-subtab-panel { display: none; }
.mufc-subtab-panel.active { display: block; }

/* ---------- Minimalist Table styling ---------- */

.league-table-wrapper {
  width: 100%;
  margin-top: 15px;
}

.league-table-wrapper table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  table-layout: fixed;
  font-size: 12px;
}

.league-table-wrapper thead tr {
  background-color: #fff;
}

.league-table-wrapper thead th {
  padding: 6px 2px;
  font-weight: bold;
  border-bottom: 1px solid #ddd;
  color: #555;
}

.league-table-wrapper tbody tr {
  border-bottom: 1px solid #ddd;
}

.league-table-wrapper tbody tr:hover td {
  background-color: #f5f5f5;
}

.league-table-wrapper td, 
.league-table-wrapper th {
  padding: 6px 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  border: none;
}

.league-table-wrapper td.team-cell {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  text-align: right;
}

.league-table-wrapper td.team-cell img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}

.league-table-wrapper td.team-cell span.rank {
  font-weight: bold;
  min-width: 15px;
}

.mufc-highlight td {
  background-color: #fff5f5;
  font-weight: bold;
}
.mufc-highlight:hover td {
  background-color: #ffecec !important;
}

/* ---------- RESPONSIVE DESIGN ---------- */

@media (max-width: 768px) {
  /* Tables horizontal scroll */
  .league-table-wrapper {
    overflow-x: auto;
  }
  .league-table-wrapper table {
    table-layout: auto;
    font-size: 11px;
    min-width: 320px;
  }
  .league-table-wrapper td.team-cell {
    flex-wrap: nowrap;
    gap: 4px;
  }
  .league-table-wrapper td:not(.team-cell) {
    padding: 2px 1px;
  }
  .mufc-tabbox-nav {
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  .mufc-tab-btn {
    white-space: nowrap;
  }

  /* Carousel vertical stack (Arrows Top & Bottom) */
  .mufc-carousel-wrapper {
    padding: 45px 0;
    max-width: 100%;
  }
  .mufc-carousel-btn {
    top: auto;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%);
  }
  .mufc-carousel-prev {
    top: 0; /* Up Arrow */
  }
  .mufc-carousel-next {
    bottom: 0; /* Down Arrow */
  }
}