/* SPMS Dashboard CSS Styles */

/* === GLOBAL STYLES === */
body {
  font-size: 1.4rem; /* Larger base font for HD displays */
  background-color: #d4d4d4 !important; /* Much darker grey background (4 shades darker total) */
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 2cm,
    #ffffe0 2cm,
    #ffffe0 calc(2cm + 2px)
  ) !important;
}

/* === TV SLIDESHOW CONTAINER === */
/* Container for simple TV slideshow */
#slideshow-container {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

#slide-container {
  position: relative;
  width: 100%;
  height: 100%;
}

/* Used by all 6 dashboard screens as main container */
.slide-item {
  min-height: 100vh;
  padding: 30px 30px 60px 30px; /* Extra bottom padding for countdown footer */
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  background-color: #d4d4d4; /* Much darker grey background (4 shades darker total) */
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 2cm,
    #ffffe0 2cm,
    #ffffe0 calc(2cm + 2px)
  );
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

.slide-item.active {
  opacity: 1;
  z-index: 2;
}

/* Fallback for carousel-item class (backward compatibility) */
.carousel-item {
  min-height: 100vh;
  padding: 30px 30px 60px 30px;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  background-color: #d4d4d4;
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 2cm,
    #ffffe0 2cm,
    #ffffe0 calc(2cm + 2px)
  );
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

.carousel-item.active {
  opacity: 1;
  z-index: 2;
}

/* Columbia logo as background in top left */
.slide-item::before,
.carousel-item::before {
  content: "";
  position: absolute;
  top: 20px;
  left: 20px;
  width: 100px;
  height: 100px;
  background-image: url("/static/images/team_logos/t_184.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 1.0;
  z-index: 1;
}

/* Club 1919 logo as background in top right */
.slide-item::after,
.carousel-item::after {
  content: "";
  position: absolute;
  top: -35px;
  right: 20px;
  width: 200px;
  height: 200px;
  background-image: url("/static/images/logo_club1919.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 1.0;
  z-index: 1;
}

/* === INTRO SCREEN === */
.intro-screen {
  background: linear-gradient(
    135deg,
    #ffd700 0%,
    #ffed4a 25%,
    #fff9c4 50%,
    #ffed4a 75%,
    #ffd700 100%
  ) !important;
  background-size: 400% 400% !important;
  animation: gradientShift 8s ease infinite;
  border: 8px solid #333;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.welcome-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  text-align: center;
  position: relative;
  z-index: 10;
}

.competition-title {
  font-size: 4.5rem;
  font-weight: 900;
  color: #000;
  text-shadow: 4px 4px 8px rgba(255, 255, 255, 0.8);
  margin-bottom: 1rem;
  margin-top: 3rem;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.competition-subtitle {
  font-size: 3rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 2rem;
  text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.6);
}

.welcome-message {
  font-size: 4rem;
  font-weight: 700;
  color: #000;
  margin-bottom: 2rem;
  text-shadow: 3px 3px 6px rgba(255, 255, 255, 0.7);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.competition-details {
  font-size: 1.8rem;
  color: #555;
  font-weight: 500;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}

/* === SCHERM 1 & 2: MAIN STANDINGS + PERIOD STANDINGS === */
/* Main table container for league standings */
.standings-table {
  font-size: 1.3rem;
  margin-top: 2.5cm; /* Increased from 1.5cm to move tables 1cm lower */
}

/* Period slides mobile-specific smaller fonts */
.mobile-mode .standings-table {
  font-size: 0.8rem !important;
}

.mobile-mode .standings-table th {
  font-size: 1.0rem !important;
}

.mobile-mode .standings-table td {
  font-size: 0.8rem !important;
}

/* All table headers and cells padding */
.standings-table th,
.standings-table td {
  padding: 10px 6px; /* Reduced padding to create more horizontal space */
}

/* Generic table headers */
.standings-table th {
  font-size: 2.6rem; /* 2x the normal table font size (was 1.3rem) */
  font-weight: bold;
}

/* Position column (#) header in standings table */
.position-header {
  font-size: 3.9rem; /* 1.5x van 2.6rem = 3.9rem */
}

/* Position number cells in standings table */
.position-cell {
  font-size: 1.95rem; /* 1.5x van 1.3rem = 1.95rem */
  font-weight: bold;
}

/* Statistics headers (G, W, G, V) in standings table */
.stats-header {
  font-size: 3.9rem; /* 1.5x van 2.6rem = 3.9rem */
}

/* Statistics data cells in standings table */
.stats-cell {
  font-size: 1.95rem; /* 1.5x van 1.3rem = 1.95rem */
}

/* Points column cells in standings table */
.points-cell {
  font-size: 1.95rem; /* 1.5x van 1.3rem = 1.95rem */
  font-weight: bold;
  color: #0066cc; /* Blue color for points */
}

/* Team name cells in standings table */
.team-name-cell {
  font-size: 1.9rem; /* Reduced from 2.15rem for more space */
  font-weight: bold;
  color: #333;
  white-space: nowrap; /* Prevent text wrapping */
  overflow: hidden; /* Hide overflow */
  text-overflow: ellipsis; /* Add ... if text is too long */
  max-width: 280px; /* Increased from 200px to show full names */
}

/* Team logo styling */
.team-logo {
  width: 24px;
  height: 24px;
  object-fit: contain;
  margin-right: 8px;
  vertical-align: middle;
  border-radius: 2px;
}

/* Larger team logo styling for matches (1.3x bigger) */
.team-logo-large {
  width: 32px;
  height: 32px;
  object-fit: contain;
  margin-right: 10px;
  vertical-align: middle;
  border-radius: 3px;
}

/* Larger team logo styling positioned after team name */
.team-logo-large-after {
  width: 32px;
  height: 32px;
  object-fit: contain;
  margin-left: 10px;
  vertical-align: middle;
  border-radius: 3px;
}

/* === TEAM FORM CIRCLES === */
.team-form {
  display: inline-flex;
  gap: 1px; /* Added 1px spacing between circles */
  align-items: center;
  margin-left: 4px; /* Reduced from 8px to halve spacing */
}

.form-circle {
  font-size: 1.8rem;
  font-weight: bold;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-block;
  text-align: center;
  line-height: 16px;
}

.form-win {
  color: #28a745; /* Green for wins */
}

.form-draw {
  color: #007bff; /* Blue for draws */
}

.form-loss {
  color: #dc3545; /* Red for losses */
}

.form-unplayed {
  color: #6c757d; /* Grey for unplayed */
}

/* === FEATURED TEAM HIGHLIGHTING === */
.featured-team-row {
  background-color: rgba(255, 215, 0, 0.2) !important; /* Light gold background */
  border: 2px solid #ffd700 !important; /* Gold border */
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.3) !important;
}

.featured-team-row .position-cell {
  font-size: calc(1.95rem + 2px) !important;
  font-weight: 900 !important;
  color: #000 !important;
}

.featured-team-row .team-name-cell {
  font-size: calc(2.15rem + 2px) !important;
  font-weight: 900 !important;
  color: #000 !important;
}

.featured-team-row .stats-cell {
  font-size: calc(1.95rem + 2px) !important;
  font-weight: 900 !important;
  color: #000 !important;
}

.featured-team-row .points-cell {
  font-size: calc(1.95rem + 2px) !important;
  font-weight: 900 !important;
  color: #000 !important;
}

/* === TV FOOTER === */
.tv-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  padding: 8px 16px;
  z-index: 1000;
}

.tv-footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.screen-number {
  font-size: 1.125rem;
  font-weight: bold;
  color: #ffc107;
}

.countdown {
  font-size: 1.125rem;
  font-weight: bold;
  color: #ffc107;
  margin-left: 15px;
}

.footer-branding {
  text-align: center;
  flex: 1;
}

.footer-branding span {
  font-size: 1.5rem;
  color: #ffc107;
  font-weight: 500;
}

/* Desktop footer display */
.desktop-footer {
  display: inline;
}

.mobile-footer {
  display: none;
}

/* === TEST MODE INDICATOR === */
.test-mode-indicator {
  position: fixed;
  top: 10px;
  right: 10px;
  background-color: rgba(255, 0, 0, 0.9);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 1.2rem;
  font-weight: bold;
  z-index: 9999;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  border: 2px solid #fff;
  animation: testBlink 2s ease-in-out infinite;
}

@keyframes testBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* === MOBILE & RESPONSIVE STYLES === */
/* Mobile device detection */
.mobile-mode {
  font-size: 1rem !important; /* Smaller base font for mobile */
}

.tablet-mode {
  font-size: 1.2rem !important; /* Medium font for tablets */
}

.tv-mode {
  font-size: 1.4rem !important; /* Keep large font for TV/desktop */
}

/* Mobile-specific header styling */
.mobile-header {
  font-size: 1.4rem !important;
  font-weight: bold;
  margin-bottom: 0.5rem;
  color: #333;
  text-align: center;
  padding: 0 10px;
}

/* Mobile matches container */
.mobile-matches-container {
  padding: 0 5px;
  height: calc(100vh - 120px); /* Full viewport minus header space and footer space */
  max-height: calc(100vh - 120px); /* Same as height for consistency */
  overflow-y: auto;
  overflow-x: hidden; /* Prevent horizontal scrolling */
  max-width: 100vw; /* Ensure container doesn't exceed viewport */
  display: flex;
  flex-direction: column;
}

/* Mobile match item styling */
.mobile-match-item {
  background-color: rgba(255, 255, 255, 0.95);
  border-radius: 6px;
  padding: 4px 6px; /* Halved from 8px 12px */
  margin-bottom: 3px; /* Halved from 6px */
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  border-left: 3px solid #ffd700;
  max-width: 100%; /* Ensure items don't exceed container */
  overflow: hidden; /* Hide any overflow content */
}

.mobile-match-item.played {
  border-left-color: #28a745; /* Green for played matches */
}

.mobile-match-item.upcoming {
  border-left-color: #007bff; /* Blue for upcoming matches */
}

.mobile-match-date {
  font-size: 0.9rem;
  font-weight: 600;
  color: #666;
  text-align: center;
  margin-bottom: 2px; /* Halved from 4px */
}

.mobile-match-teams {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px; /* Reduced gap for more space */
  width: 100%; /* Ensure full width usage */
}

.mobile-team {
  flex: 0 1 35%; /* Fixed percentage instead of flex: 1 */
  max-width: 120px; /* Same max width as standings table */
  font-size: 0.9rem; /* Same font size as standings table */
  font-weight: bold;
  color: #333;
  text-align: center;
  white-space: nowrap; /* Prevent text wrapping */
  overflow: hidden; /* Hide overflow text */
  text-overflow: ellipsis; /* Add ... for long names */
}

.mobile-team.featured {
  color: #000 !important;
  font-weight: 900 !important;
  background-color: rgba(255, 215, 0, 0.3);
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 0.9rem !important; /* Same font size as standings table featured teams */
  max-width: 120px !important; /* Same max width as standings table featured teams */
}

.mobile-score {
  flex: 0 0 auto; /* Don't grow or shrink */
  font-size: 1.1rem; /* Slightly smaller */
  font-weight: bold;
  color: #0066cc;
  min-width: 50px; /* Slightly smaller min width */
  text-align: center;
}

.mobile-vs {
  flex: 0 0 auto; /* Don't grow or shrink */
  font-size: 1.0rem; /* Slightly smaller */
  font-weight: 600;
  color: #666;
  min-width: 30px; /* Smaller min width */
  text-align: center;
}

/* Mobile responsive table adjustments - Only for actual mobile devices */
@media (max-width: 480px) {
  /* Intro screen mobile adjustments */
  .competition-title {
    font-size: 2.0rem !important;
    margin-top: 1.5rem !important;
    white-space: nowrap !important;
    letter-spacing: 0.02em !important;
  }
  
  .competition-subtitle {
    font-size: 1.5rem !important;
  }
  
  .welcome-message {
    font-size: 2rem !important;
  }
  
  .competition-details {
    font-size: 1.2rem !important;
    line-height: 1.4 !important;
    text-align: center !important;
  }
  
  /* Mobile statistics text styling */
  #competition-matches-stats,
  #columbia-matches-stats {
    font-size: 1.1rem !important;
    line-height: 1.3 !important;
    text-align: center !important;
  }
  
  /* Table adjustments for mobile */
  .standings-table {
    font-size: 0.8rem !important;
    margin-top: 1.5cm !important; /* Increased from 0.5cm to move mobile tables 1cm lower */
  }
  
  .standings-table th {
    font-size: 1.0rem !important; /* Smaller headers */
    padding: 4px 2px !important;
  }
  
  .standings-table td {
    font-size: 0.9rem !important;
    padding: 4px 2px !important;
  }
  
  .position-header {
    font-size: 1.2rem !important;
  }
  
  .position-cell {
    font-size: 1.0rem !important;
  }
  
  .stats-header {
    font-size: 1.2rem !important;
  }
  
  .stats-cell {
    font-size: 0.9rem !important;
  }
  
  .points-cell {
    font-size: 1.0rem !important;
  }
  
  .team-name-cell {
    font-size: 0.9rem !important;
    max-width: 120px !important;
  }
  
  /* Featured team mobile override - same size as other teams */
  .featured-team-row .position-cell {
    font-size: 1.0rem !important;
  }
  
  .featured-team-row .team-name-cell {
    font-size: 0.9rem !important;
    max-width: 120px !important;
  }
  
  .featured-team-row .stats-cell {
    font-size: 0.9rem !important;
  }
  
  .featured-team-row .points-cell {
    font-size: 1.0rem !important;
  }
  
  /* Form circles smaller on mobile */
  .form-circle {
    font-size: 1.0rem !important;
    width: 16px !important;
    height: 16px !important;
    line-height: 12px !important;
  }
  
  /* Footer adjustments */
  .tv-footer {
    padding: 4px 8px !important;
  }
  
  .screen-number {
    font-size: 0.9rem !important;
  }
  
  .footer-branding span {
    font-size: 0.8rem !important; /* Smaller font to fit on one line */
  }
  
  /* Show only mobile footer on mobile devices */
  .desktop-footer {
    display: none !important;
  }
  
  .mobile-footer {
    display: inline !important;
  }
  
  
  /* Slide padding adjustments */
  .slide-item,
  .carousel-item {
    padding: 15px 10px 40px 10px !important;
  }
  
  /* Mobile matches container specific height adjustment */
  .mobile-matches-container {
    height: calc(100vh - 95px) !important; /* Optimized for mobile: viewport minus header (50px) minus footer (42px) minus gap (3px) */
    max-height: calc(100vh - 95px) !important;
  }
  
  /* Logo adjustments for mobile - halved size */
  .slide-item::before,
  .carousel-item::before {
    width: 30px !important;
    height: 30px !important;
    top: 5px !important;
    left: 5px !important;
  }
  
  .slide-item::after,
  .carousel-item::after {
    width: 60px !important;
    height: 60px !important;
    top: -10px !important;
    right: 5px !important;
  }
  
  /* Team logo mobile sizing */
  .team-logo {
    width: 16px !important;
    height: 16px !important;
    margin-right: 4px !important;
  }
  
  /* Larger team logo mobile sizing (1.3x of 16px = 21px) */
  .team-logo-large {
    width: 21px !important;
    height: 21px !important;
    margin-right: 5px !important;
  }
  
  /* Larger team logo mobile sizing positioned after name */
  .team-logo-large-after {
    width: 21px !important;
    height: 21px !important;
    margin-left: 5px !important;
  }
}

/* Tablet responsive adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
  .standings-table {
    font-size: 1.1rem !important;
  }
  
  .standings-table th {
    font-size: 2.0rem !important;
  }
  
  .team-name-cell {
    font-size: 1.6rem !important;
    max-width: 200px !important;
  }
}

/* === COLUMBIA MATCHES SLIDE SCALING === */
/* Scale Columbia matches 1.2x larger on laptop and TV (not mobile) */
@media (min-width: 769px) {
  .columbia-matches-slide {
    transform: scale(1.2);
    transform-origin: center center;
    /* Adjust positioning to prevent overflow */
    margin: -5% auto;
  }
  
  /* Ensure content doesn't get cut off */
  .columbia-matches-slide .match-container,
  .columbia-matches-slide .matches-grid,
  .columbia-matches-slide .table-responsive {
    font-size: 1rem; /* Base size, will be scaled by transform */
  }
  
  /* Fine-tune spacing for scaled content */
  .columbia-matches-slide .match-row {
    margin-bottom: 0.8rem;
  }
}