/* Custom design system for Simulytics Redesign */

/* Reset & Variables */
:root {
  --font-primary: 'Martian Mono', monospace;
  
  /* Color Palette - HSL Derived Premium Dark Theme */
  --bg-primary: HSL(224, 25%, 10%); /* Note: Overridden dynamically by layouts in head style tag using brandColor config */
  --bg-secondary: HSL(224, 20%, 14%);
  --bg-card: HSL(224, 18%, 18%);
  
  --primary: HSL(217, 92%, 60%);
  --primary-hover: HSL(217, 92%, 55%);
  --accent: HSL(38, 95%, 55%); /* Amber Spark */
  --accent-hover: HSL(38, 95%, 50%);
  
  --text-primary: HSL(220, 25%, 97%);
  --text-secondary: HSL(220, 15%, 72%);
  --text-muted: HSL(220, 10%, 55%);
  
  --border-color: HSL(224, 15%, 22%);
  --border-focus: HSL(217, 92%, 60%);
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --max-width: 1200px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
}
body {
  overflow-x: clip;
  font-family: var(--font-primary);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Fallback Container classes (EJS templates use .container-fluid) */
.container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 24px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

.main-header {
  border-bottom: 1px solid var(--border-color) !important;
  position: sticky;
  top: 0;
  z-index: 1050 !important;
}

.main-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(14, 18, 28, 0.85) !important;
  backdrop-filter: blur(12px);
  z-index: -1;
  pointer-events: none;
}

.logo-text {
  font-family: var(--font-primary);
  font-weight: 800 !important;
  letter-spacing: -0.5px;
}

.navbar-nav .nav-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary) !important;
  padding: 8px 16px !important;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  text-align: center;
}

.navbar-nav .nav-link:hover, 
.navbar-nav .nav-link.active {
  background-color: #ffffff !important;
  color: #000000 !important;
}

/* Offcanvas Mobile Menu overrides */
.offcanvas {
  background-color: rgba(14, 18, 28, 0.98) !important;
  backdrop-filter: blur(16px);
  border-left: 1px solid var(--border-color) !important;
}

/* Custom Design Token Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  gap: 8px;
}

.btn-primary {
  background-color: var(--primary) !important;
  color: white !important;
}

.btn-primary:hover {
  background-color: var(--primary-hover) !important;
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: transparent !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color) !important;
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.05) !important;
  border-color: var(--text-secondary) !important;
}

.btn-lg {
  padding: 14px 28px !important;
  font-size: 16px !important;
  border-radius: var(--radius-md) !important;
}

/* Main Layout */
.main-content {
  background-color: #ffffff;
  flex: 1;
  width: 100%;
  max-width: 100%;
}

/* Hero Section */
.hero-section {
  background-color: #ffffff;
  padding: 96px 0 64px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-section .hero-title {
  color: HSL(224, 25%, 10%);
}

.hero-section .hero-subtitle {
  color: HSL(224, 15%, 35%);
}

.hero-section .btn-secondary {
  color: HSL(224, 25%, 10%) !important;
  border-color: HSL(224, 15%, 30%) !important;
}

.hero-section .btn-secondary:hover {
  background-color: rgba(0, 0, 0, 0.05) !important;
}

.hero-badge {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  background-color: rgba(38, 110, 245, 0.1) !important;
  color: var(--primary) !important;
  border: 1px solid rgba(38, 110, 245, 0.2) !important;
}

.hero-title {
  font-size: 56px;
  font-weight: 850;
  letter-spacing: -2px;
}

.hero-title .highlight {
  color: var(--accent);
}

/* Error Section */
.error-section {
  padding: 120px 0;
  text-align: center;
}

.error-section .error-title {
  color: HSL(224, 25%, 10%);
}

.error-section .error-subtitle {
  color: HSL(224, 15%, 35%);
}

.error-section .btn-secondary {
  color: HSL(224, 25%, 10%) !important;
  border-color: HSL(224, 15%, 30%) !important;
}

.error-section .btn-secondary:hover {
  background-color: rgba(0, 0, 0, 0.05) !important;
}

.error-badge {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  background-color: rgba(245, 38, 38, 0.1) !important;
  color: #ff4a4a !important;
  border: 1px solid rgba(245, 38, 38, 0.2) !important;
}

.error-title {
  font-size: 40px;
  font-weight: 800;
}

/* Footer Styles */
.main-footer {
  background-color: rgba(10, 13, 20, 0.95);
  border-top: 1px solid var(--border-color);
}

/* Responsive Breakpoints */
@media (max-width: 992px) {
  .navbar-nav {
    width: 100%;
    padding: 16px 0;
    gap: 16px !important;
  }
  .navbar-nav .nav-link {
    width: 100% !important;
    text-align: left !important;
    padding: 12px 16px !important;
  }
  .w-100-mobile {
    width: 100% !important;
  }
  .w-100-mobile-btn {
    width: 100% !important;
    margin-left: 0 !important;
    padding: 12px 20px !important;
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 26px;
    letter-spacing: -0.5px;
  }
}

/* Logo Grid Layout Styles */
.logo-grid {
  display: grid;
  gap: 0.5rem;
  grid-auto-flow: dense;
  grid-auto-rows: 100px;
  grid-template-columns: repeat(2, 1fr);
}

.logo-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  overflow: hidden;
  padding: 0.5rem 0.5rem 0;
  transition: var(--transition);
  position: relative;
}

.logo-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px) scale(1.02);
  z-index: 10;
}

.logo-image-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
  width: 100%;
  height: auto;
  overflow: hidden;
  margin-bottom: 0.25rem;
}

.team-logo-img {
  display: block;
  max-height: 100%;
  object-fit: contain;
  width: auto;
  max-width: 80%;
  transition: var(--transition);
}

.team-name-text {
  font-size: 13px;
  font-weight: 400;
  padding-bottom: 0.5rem;
  text-align: center;
  width: 100%;
}

/* Utility classes for text contrast */
.text-dark-contrast {
  color: #1f2937;
} /* Dark text */
.text-light-contrast {
  color: #f3f4f6;
} /* Light text */

/* Custom Team Colors (Replacing Tailwind color utilities) */
.bg-red-700-custom {
  background-color: #b91c1c;
}
.bg-blue-600-custom {
  background-color: #2563eb;
}
.bg-orange-500-custom {
  background-color: #f97316;
}
.bg-orange-600-custom {
  background-color: #ea580c;
}
.bg-yellow-600-custom {
  background-color: #ca8a04;
}
.bg-brown-600-custom {
  background-color: #895129;
}
.bg-blue-900-custom {
  background-color: #1e3a8a;
}
.bg-blue-500-custom {
  background-color: #3b82f6;
}
.bg-blue-700-custom {
  background-color: #1d4ed8;
}
.bg-gray-900-custom {
  background-color: #a4adae;
}
.bg-yellow-400-custom {
  background-color: #facc15;
}
.bg-teal-500-custom {
  background-color: #14b8a6;
}
.bg-purple-700-custom {
  background-color: #7c3aed;
}
.bg-blue-800-custom {
  background-color: #1e40af;
}
.bg-yellow-700-custom {
  background-color: #a16207;
}
.bg-green-700-custom {
  background-color: #047857;
}
.bg-green-800-custom {
  background-color: #065f46;
}
.bg-red-800-custom {
  background-color: #fdb414;
}
.bg-gold-800-custom {
  background-color: #b3925a;
}
.bg-purple-800-custom {
  background-color: #6b21a8;
}
.bg-teal-600-custom {
  background-color: #0d9488;
}
.bg-red-600-custom {
  background-color: #dc2626;
}


/* Grid Spanning Adjustments across Viewports */
@media (min-width: 576px) and (max-width: 992px) {
  .logo-grid {
    gap: 0.75rem;
    grid-auto-rows: 120px;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}

@media (min-width: 992px) {
  .logo-grid {
    gap: 1rem;
    grid-auto-rows: 90px;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  }
  .span-col-2 {
    grid-column: span 2;
  }
  .span-row-2 {
    grid-row: span 2;
  }
  .span-col-3 {
    grid-column: span 3;
  }
}

.hero-title-dashboard {
    font-size: 36px;
    font-weight: 850;
    letter-spacing: -2px;
}
.hero-title-dashboard .highlight {
    color: var(--accent);
}

/* ---------------------------------------------------- */
/* VIBRANT TEAM THEMED CARD STYLE                       */
/* ---------------------------------------------------- */
.style-vibrant {
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  border: 1px solid #e9ecef;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}
.style-vibrant:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
  border-color: #3b82f6;
}
.style-vibrant .gradient-accent-bar {
  height: 6px;
  width: 100%;
}
.style-vibrant .card-header {
  background: transparent;
  border-bottom: 0;
  padding: 10px 14px 2px;
}
.style-vibrant .date-text {
  color: #6c757d;
  font-weight: 700;
  font-size: 13px;
}
.style-vibrant .table td {
  border-bottom: 0;
  padding: 4px 6px;
}
.style-vibrant .odds-btn {
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 5px 8px;
  width: 100%;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  transition: all 0.1s ease;
}
.style-vibrant .odds-btn:hover {
  background-color: #e9ecef;
}
.style-vibrant .odds-label {
  font-size: 10px;
  color: #8c96a3;
  font-weight: 600;
  text-transform: uppercase;
  display: block;
  margin-bottom: 2px;
}
.style-vibrant .btn-simulate-square {
  border: 1px solid #dee2e6;
  background: #f8f9fa;
  color: #212529;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0;
}
.style-vibrant .btn-simulate-square:hover {
  background-color: #e9ecef;
}

/* Modal Report Summary Formatting */
.sportsbook-report h2 {
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-primary);
  margin-bottom: 12px;
  color: #212529;
  border-left: 4px solid var(--accent);
  padding-left: 8px;
}
.sportsbook-report h3 {
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-primary);
  margin-top: 20px;
  margin-bottom: 10px;
  color: #212529;
}
.sportsbook-report ul {
  padding-left: 20px;
  font-size: 13px;
  color: #495057;
  margin-bottom: 16px;
}
.sportsbook-report li {
  margin-bottom: 6px;
}

/* Full-Screen Offcanvas end layout */
.offcanvas-end.w-100 {
  max-width: 100vw !important;
  border-left: 0 !important;
}

/* Ensure offcanvas panels and backdrops sit above the sticky navbar (z-index 1050) */
.offcanvas {
  z-index: 1060 !important;
}
.offcanvas-backdrop {
  z-index: 1055 !important;
}

/* Prevent viewport double scrollbars when any offcanvas is active */
html:has(.offcanvas.show),
body:has(.offcanvas.show) {
  overflow: hidden !important;
}

/* Simulation Dashboard Card Titles font size */
.dashboard-card-title {
  font-size: 13px !important;
}

/* Global full-screen loading spinner overlay */
.page-loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #0f172a; /* Premium dark slate background */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999; /* Higher than headers/modals/offcanvas */
  opacity: 1;
  transition: opacity 0.4s ease-in-out;
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Injury Report Modal Styles */
.injury-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  background-color: #f1f5f9;
  border-bottom: 2px solid #e2e8f0;
}
.player-name {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
}
.injury-desc {
  font-size: 13px;
  color: #64748b;
  line-height: 1.4;
  margin-top: 2px;
}
.injury-type {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  color: #475569;
}
.badge-status {
  font-size: 10px;
  font-weight: bold;
  text-transform: uppercase;
  border-radius: 4px;
  padding: 4px 8px;
}
.badge-out {
  background-color: #ef4444;
  color: #ffffff;
}
.badge-ir {
  background-color: #991b1b;
  color: #ffffff;
}
.badge-questionable {
  background-color: #eab308;
  color: #0f172a;
}
.badge-doubtful {
  background-color: #f97316;
  color: #ffffff;
}
.badge-pup {
  background-color: #64748b;
  color: #ffffff;
}

/* Offcanvas Sub-Navigation Links (Rounded Style) */
.nav-link-item {
  color: #ffc107 !important; /* warning gold */
  text-decoration: none;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm, 6px);
  border: 1px solid transparent;
  transition: all 0.2s ease;
  display: inline-block;
}
.nav-link-item:hover {
  color: #ffffff !important;
  background-color: rgba(255, 193, 7, 0.15);
  border-color: #ffc107;
}
.nav-link-item.active {
  color: #0f172a !important; /* dark contrast color matching offcanvas bg */
  background-color: #ffc107 !important;
  border-color: #ffc107;
}

/* Hide scrollbar for header quick nav in mobile viewports */
#modalQuickNav::-webkit-scrollbar {
  display: none;
}
#modalQuickNav {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Projected Sportsbook Odds Win State */
.style-vibrant .odds-btn.projected-win {
  background-color: rgba(25, 135, 84, 0.12) !important; /* soft green bg tint */
  border-color: #198754 !important; /* solid green border */
  color: #198754 !important; /* success text */
}
.style-vibrant .odds-btn.projected-win .odds-label {
  color: #146c43 !important; /* dark success green for contrast */
}

/* Dynamic Help Offcanvas Styling Overrides */
#helpOffcanvas.offcanvas-end {
  width: 100%;
}
@media (min-width: 768px) {
  #helpOffcanvas.offcanvas-end {
    width: 25%;
    min-width: 320px;
    max-width: 420px;
  }
}

/* Custom Simulations CSS - Mobile-First Target Dimensions */
@media (max-width: 767.98px) {
  .form-select, 
  .form-control, 
  textarea.form-control {
    font-size: 16px !important; /* Prevents auto-zoom scaling on touch screens */
  }
}

.custom-stat-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 8px;
  border-bottom: 1px solid #dee2e6;
  background-color: #ffffff;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

@media (min-width: 576px) {
  .custom-stat-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }
}

.custom-checkbox-wrapper {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-grow: 1;
}

.custom-stat-values {
  font-size: 12px;
  color: var(--text-secondary);
}

.custom-stat-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--accent);
}

.custom-stat-weight-select {
  width: 100%;
  height: 40px;
  font-size: 14px;
  background-color: #ffffff;
  color: #212529;
  border: 1px solid #dee2e6;
  border-radius: var(--radius-sm);
  padding: 0 8px;
}

@media (min-width: 576px) {
  .custom-stat-weight-select {
    width: 180px;
  }
}

.custom-stat-delete-btn {
  height: 40px;
  width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dc3545;
  color: #dc3545;
  background: transparent;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.custom-stat-delete-btn:hover {
  background-color: #dc3545;
  color: white;
}

/* Complaints Masonry Styles */
.complaints-masonry {
  column-count: 1;
  column-gap: 1.5rem;
}
@media (min-width: 768px) {
  .complaints-masonry {
    column-count: 2;
  }
}
@media (min-width: 992px) {
  .complaints-masonry {
    column-count: 3;
  }
}
.complaint-card {
  display: inline-block;
  width: 100%;
  margin-bottom: 1.5rem;
  break-inside: avoid;
}

