@import url("https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap");

html {
  font-family: "Lato", sans-serif;
  padding: 0;
  margin: 0;
  scroll-behavior: smooth;
  overflow-x: hidden;
  margin-bottom: 30px;
}

.intro {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-image: url("assets/bg-soccer.jpeg");
  background-size: cover;
  background-position: center;
  h1 {
    font-size: 4rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.5rem;
    z-index: 1;
    line-height: 1.4;
  }
  p {
    font-size: 1.7rem;
    color: #fff;
    margin-bottom: 4rem;
    z-index: 1;
    line-height: 1.4;
  }
  .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(18, 87, 8, 0.4);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    box-sizing: border-box;
  }
  .statsbomb-image {
    position: absolute;
    top: 800px; /* adjust as needed */
    left: 40px; /* adjust as needed */
    width: 400px; /* size of overlay image */
    z-index: 10; /* higher z-index = in front */
    pointer-events: none;
  }
}

#predictBtn,
#predictBtn2 {
  position: static;
  padding: 10px 12px;
  background-color: gray;
  color: white;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  z-index: auto;
}

#predictBtn.active,
#predictBtn2.active {
  background-color: #28a745;
}

#undoBtn,
#undoBtn2 {
  position: static;
  padding: 10px 12px;
  background-color: #e74c3c;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;

  z-index: auto;
}

body {
  display: flex;
  flex-direction: column; /* stack items vertically */
  justify-content: center; /* vertical centering */
  align-items: center; /* horizontal centering */
  min-height: 100vh; /* full viewport height */
  margin: 0; /* remove default margin */
  /* padding: 20px; optional padding */
  box-sizing: border-box; /* include padding in size */
  text-align: center; /* center text inside elements */
}
#pitchCanvas,
#pitchCanvas2 {
  width: 100%;
  height: auto;
  aspect-ratio: 3/2;
  background: rgb(141, 208, 139);
}

.country-sequence {
  display: flex;
  flex-direction: column;
  width: fit-content;
  margin: auto;
  padding: 1rem;
  align-items: center;
  justify-content: center;
  background-color: #0050a020;
  color: #0050a0;
  font-weight: 600;
  line-height: 25px;
  border-radius: 8px;
}

.line {
  stroke: black;
  stroke-width: 0.2;
  fill: none;
}
.pass {
  fill: none;
}
.dribble {
  stroke: gray;
  stroke-width: 0.5;
  stroke-dasharray: 1, 1; /* 4px dash, 2px gap */
  fill: none;
}
.scrolly {
  display: flex;
  flex-direction: row;
  width: 100%;
  /* max-width: 1200px; */
  margin: 0 auto;
  position: relative;
  padding: 2rem 1rem;
}

.article {
  width: 40%;
  padding-right: 2rem;
  margin-left: 20px;
}

.step {
  margin: 0 0 80vh 0;
  padding: 2rem;
  border-left: 4px solid #ccc;
  background: #f9f9f9;
  border-radius: 8px;
  opacity: 0.2;
  transform: translateY(20px);
  transition: all 0.5s ease-in-out;
}

.step.active {
  background: #d0e7ff; /* Light Euro blue */
  border-left-color: #0050a0; /* Deep UEFA blue */
  opacity: 1;
  transform: translateY(0);
}
.graphic {
  width: 60%;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  flex-direction: column; /* stack graphic-items vertically */
  justify-content: center;
  background: #f3f3f3;
  margin-right: 20px;
}

.graphic-item {
  display: none;
  width: 100%;
  height: 100%;
  padding: 1rem;
  box-sizing: border-box;
  margin-right: 20px;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(20px);
  transition: all 1s ease-in-out;
}

.graphic-item.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transform: translateY(0);
}

/* Pitch SVGs */
#pitch1,
#pitch2,
#pitch3,
#pitch4,
#pitch5,
#pitch4Step1,
#pitch4Step2,
#pitch4Step3,
#pitch4Step4,
#pitch5Step1,
#pitch5Step2,
#pitch5Step3,
#pitch5Step4,
#pitch33{
  width: 100%;
  height: auto;
  max-height: 90vh;
  background-color: rgb(141, 208, 139);
}

/* Canvas & controls */
#main-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 20px;
}



#controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
  background-color: #f8f9fa;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  max-width: 720px;
}

#controls select,
#controls button {
  padding: 0.5rem 0.8rem;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-color);
  background-color: white;
  cursor: pointer;
  min-width: 120px;
  transition: all 0.2s ease;
}

#controls button {
  cursor: pointer;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  transition: background 0.3s ease;
}

#controls button:hover {
  background: #004d40;
}

.spinner {
  margin-top: 1rem;
  width: 40px;
  height: 40px;
  border: 5px solid #ccc;
  border-top: 5px solid #00796b;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}

/* Pitch3 container */
#pitch3-container {
  width: 100%;
  text-align: center;
  padding: 1rem;
}

#pitch3-container div > button {
  padding: 0.5rem 0.8rem;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-color);
  background-color: white;
  cursor: pointer;
  min-width: 120px;
  transition: all 0.2s ease;
}

#pitch3-container div > button:hover {
  background-color: #007bff;
  color: white;
}

/* Heatmap placeholder */
#heatmap {
  width: 90%;
  height: 500px;
  background: #f3f3f3;
  display: flex;
  align-items: center;
  justify-content: center;
}
.player {
  width: 100%;
  max-width: 1120px; /* max width to match your JS size */
  margin: 0 auto; /* center horizontally */
  aspect-ratio: 16 / 9; /* maintain 16:9 aspect ratio */
  position: relative;
  background: #000; /* black background behind video */
  overflow: hidden;
  border-radius: 8px; /* optional rounded corners */
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

#yt-player iframe,
#yt-player {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important; /* fill container */
  height: 100% !important; /* fill container */
  border: none;
  border-radius: 8px; /* match container */
  pointer-events: auto; /* allow interactions */
}
.title {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: 3rem; /* Big and bold */
  font-weight: 700;
  color: #1a1a1a;
  text-align: center;
  margin-bottom: 0.3em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
}

.subtitle {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: 1.5rem;
  font-weight: 400;
  color: #555;
  text-align: center;
  margin-top: 0;
  margin-bottom: 2rem;
  font-style: italic;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.4;
}

.percent-text {
  font-size: 24px;
  font-weight: bold;
  text-anchor: middle;
  dominant-baseline: middle;
  fill: #333;
}
#prediction-container {
  width: 60%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #f9f9f9;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 16px 0;
  gap: 4px;
}
#prediction-container > * {
  margin-left: 10 !important;
  margin-right: 0 !important;
  flex-shrink: 0; /* prevent shrinking */
  max-width: none; /* no max width */
}

#prediction-container > *:first-child {
  margin-left: 0;
  padding-left: 0;
}
#predictionResult {
  width: 50%;
  font-size: 1.5rem;
  font-weight: bold;
  text-align: center;
  margin-left: 10px;
}
#chart-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  /* align-items: center; */
  justify-content: center;
  gap: 1rem;
}
#graphic-item-4 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
#bar-chart {
  /* Allow them to grow equally */
  width: 100%;
  min-height: 400px;
  min-width: 400px;
  margin-top: 4rem; /* Ensures visibility on load */
}

#bar-chart svg {
  padding: 2rem 1rem;
}

.arc path:hover {
  opacity: 0.8;
  stroke: #333;
  stroke-width: 2.5px;
  cursor: pointer;
}

/* Pie Slice Clicked */
.arc path.active {
  stroke: #000;
  stroke-width: 3px;
  opacity: 1;
  filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.3));
}
#pie-legend {
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* left-align legend text */
  gap: 8px;
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  max-width: 300px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  margin-left: auto;
  margin-right: auto;
  align-items: center;
}

.legend-item {
  display: flex;
  align-items: center;
  font-size: 14px;
  color: #333;
}

.legend-swatch {
  width: 16px;
  height: 16px;
  margin-right: 10px;
  border-radius: 3px;
  flex-shrink: 0;
  border: 1px solid #ccc;
}
#pitch1,
#pitch2 {
  max-width: 850px;
}
#pitch4,
#pitch4Step1,
#pitch4Step2,
#pitch4Step3,
#pitch4Step4 {
  max-width: 700px;
}
#pitch5,
#pitch5Step1,
#pitch5Step2,
#pitch5Step3,
#pitch5Step4 {
  max-width: 700px;
}
#toggle-heatmapStep1,
#toggle-heatmapStep2,
#toggle-heatmapStep3,
#toggle-heatmapStep4 {
  margin-bottom: 2rem;
  margin-top: 2rem;
}
.legend-item text {
  cursor: pointer;
  transition: fill 0.2s, font-weight 0.2s;
}

.legend-item text:hover {
  fill: #007acc; /* A blue hover color */
  font-weight: bold; /* Emphasize on hover */
  text-decoration: underline;
}
.legend-item:hover rect {
  stroke: #333;
  stroke-width: 2px;
}
#pie-containers {
  width: 100%;
  display: flex;
  flex-direction: row;
  gap: 1rem;
  justify-content: space-around;
  align-items: center;
  margin-bottom: 1rem;
  margin-left: 1rem;
}
#slider-container {
  margin: 2rem;
}

#slider-container svg {
  padding: 0.5rem;
}

.toggle-heatmap {
  padding: 0.5rem 0.8rem;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 0.9rem;
  color: white;
  background-color: #007bff;
  cursor: pointer;
  min-width: 120px;
  transition: all 0.2s ease;
}

.diagonal-container {
  display: block;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  width: 100%;
  height: 100%;
  gap: 1rem;
}

.chart-top-left {
  grid-column: 1;
  grid-row: 1;
}

.chart-bottom-right {
  grid-column: 2;
  grid-row: 2;
}
.into-paragraph {
  width: 60%;
  margin-left: auto;
  margin-right: auto;
  font-size: 1.2rem;
  font-weight: 400;
  color: #555;
  text-align: center;
  margin-top: 0;
  margin-bottom: 2rem;
  font-style: italic;
}
#controls-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1rem;
}

.animation-controls {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  margin-bottom: 1rem;
}

.animation-controls button {
  padding: 8px 16px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.bin-label {
  font-size: 1.5px;
  text-anchor: middle;
  dominant-baseline: central; /* 👈 Key for vertical centering */
  fill: white;
  pointer-events: none;
}
#graphic-item-14 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
#graphic-item-14 h2 {
  font-size: 2rem;
  font-weight: 600;
  text-align: center;
  margin-top: 0;
  margin-bottom: 2rem;
}
#graphic-item-14 > * {
  margin: 4px 0; /* Reduce vertical spacing */
}
#bar-chart-legend {
  margin-bottom: 1rem;
  font-family: sans-serif;
  margin-top: 2rem;
}

.legend-title {
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.stage-button {
  margin: 0 5px 5px 0;
  padding: 6px 12px;
  background-color: #e0e0e0;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.stage-button.active {
  background-color: #0032a0; /* UEFA Blue */
  color: white;
}

#tooltip {
  position: absolute;
  background-color: #333;
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  max-width: 200px;
  z-index: 1000;
}

.conclusion {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  background-color: #d0e7ff;
  border: 1px solid #0050a0;
  border-radius: 20px;
  padding: 12px 16px;
  margin: 16px 0;
  gap: 4px;
}
.conclusion h2 {
  width: 70%;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
#legendStep1,
#legendStep2,
#legendStep3,
#legendStep4,
#legend {
  all: unset;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 2rem;
}

#nameInput {
  padding: 0.5rem 0.8rem;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-color);
  background-color: white;
  cursor: text;
  min-width: 120px;
  transition: all 0.2s ease;
}

#submitBtn {
  padding: 0.5rem 0.8rem;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 0.9rem;
  color: white;
  background-color: #007bff;
  cursor: pointer;
  min-width: 120px;
  transition: all 0.2s ease;
}

.name-div {
  display: none;
  align-items: center;
  margin-bottom: 1rem;
  gap: 0.5rem;
}

#prediction-container2 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.footer {
  width: 100%;
  background-color: #f8f9fa;
  padding: 1rem;
  text-align: center;
  font-size: 0.9rem;
  color: #555;
  position: relative;

  display: flex;
  flex-direction: column;
  align-items: center;
}

.footer p {
  max-width: 60%;
}

#learning-commentary {
  display: block;
  background-color: #f5f7fa;
  color: #333;
  padding: 0.5em 1em;
  margin: 1em;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  border: 1px solid #e0e0e0;
  font-family: 'Segoe UI', sans-serif;
  width: 40em;
}
