/* =======================================================
   CFL Manager - Team of the Week Styles
   Updated for new formation structure (Offense 6+5, Defense 4–2–5)
======================================================= */

.cflm-totw {
  max-width: 1100px;
  margin: 0 auto;
  font-family: 'Roboto', sans-serif;
}

/* --- TABS --- */
.totw-tabs {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.totw-tab {
  padding: 8px 18px;
  background: #eee;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
}

.totw-tab.active {
  background: #0073aa;
  color: #fff;
}

/* --- TAB GROUPS --- */
.totw-group {
  display: none;
}

.totw-group.active {
  display: block;
}

/* --- ROWS --- */
.totw-row {
  margin-bottom: 32px;
}

.totw-row-title {
  text-align: center;
  font-weight: 600;
  color: #f5b800;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* --- GRID LAYOUT --- */
.totw-row-grid {
  display: grid;
  justify-content: center; /* Centers the whole row */
  justify-items: center;
  gap: 16px;
}

.totw-offensive-line {
  grid-template-columns: repeat(6, 1fr);
}

.totw-skill-positions {
  grid-template-columns: repeat(5, 1fr);
}



/* OFFENSE ROWS */
.totw-offensive-line {
  grid-template-columns: repeat(6, 1fr);
}

.totw-skill-positions {
  grid-template-columns: repeat(5, 1fr);
}

/* DEFENSE ROWS (4–2–5) */
.totw-front-line {
  grid-template-columns: repeat(4, 1fr);
}

.totw-linebackers {
  grid-template-columns: repeat(2, 1fr);
}

.totw-secondary {
  grid-template-columns: repeat(5, 1fr);
}

/* SPECIAL TEAMS */
.totw-specialists {
  grid-template-columns: repeat(4, 1fr);
}

/* --- CARDS --- */
.totw-card {
  background: #111;
  color: white;
  border-radius: 10px;
  padding: 14px;
  text-align: left;
  position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  width: 180px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* =======================================================
   TEAM BACKGROUND ENHANCEMENT FOR TOTW CARDS
   ======================================================= */

.totw-card {
  position: relative;
  background-color: #111; /* fallback */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
  color: #fff;
  border-radius: 10px;
  padding: 14px;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 180px;
  min-height: 120px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Subtle overlay for readability */
.totw-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 0;
  transition: background 0.3s ease;
}

.totw-card:hover::before {
  background: rgba(0, 0, 0, 0.4);
}

.totw-card > * {
  position: relative;
  z-index: 1;
}

.totw-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

/* Optional: Slight blur for backgrounds */
.totw-card::after {
  content: "";
  position: absolute;
  inset: 0;
  backdrop-filter: blur(2px);
  z-index: 0;
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

.totw-card:hover::after {
  opacity: 0.3;
}


.totw-logo {
  width: 50px;
  height: 50px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
}

.totw-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.totw-card-info h4 {
  font-size: 17px;
  margin: 0;
  font-weight: 700;
}

.totw-team {
  font-size: 13px;
  color: #ccc;
}

.totw-stats {
  background: rgba(255,255,255,0.08);
  padding: 8px;
  border-radius: 6px;
  margin-top: 6px;
  font-size: 14px;
}

/* --- POSITION LABEL --- */
.totw-position-header {
  text-align: center;
  font-size: 13px;
  color: #f5b800;
  margin-bottom: 6px;
  font-weight: 600;
  text-transform: uppercase;
}

/* --- RESPONSIVE LAYOUTS --- */
@media (max-width: 1000px) {
  .totw-offensive-line { grid-template-columns: repeat(3, 1fr); }
  .totw-skill-positions { grid-template-columns: repeat(3, 1fr); }
  .totw-front-line { grid-template-columns: repeat(2, 1fr); }
  .totw-secondary { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 600px) {
  .totw-offensive-line,
  .totw-skill-positions,
  .totw-front-line,
  .totw-linebackers,
  .totw-secondary,
  .totw-specialists {
    grid-template-columns: repeat(2, 1fr);
  }

  .totw-card {
    width: 150px;
    padding: 10px;
  }

  .totw-card-info h4 {
    font-size: 15px;
  }
}
