/* 

1. navbar
2. hero section
3. overall styles
4. unit styles
5. medal tally styles
6. detailed stats styles

*/
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", sans-serif;
}

body {
  background-color: #f2f1fd;
  color: #111;
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 40px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  position: relative;
  z-index: 10;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.nav-title {
  font-weight: 700;
  font-size: 1.4rem;
  color: #333;
}

.nav-title .highlight {
  color: #5B0000;
}

/* Nav Links */
.nav-links {
  display: flex;
  list-style: none;
  gap: 24px;
  margin-left: auto;
}

.nav-links a {
  text-decoration: none;
  color: #333;
  font-size: 0.95rem;
  transition: color 0.3s;
}

.nav-links a.active {
  color: #5B0000;
  font-weight: 600;
}

.nav-links a:hover {
  color: #5B0000;
}

/* Hamburger Button */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 22px;
  height: 16px;
  cursor: pointer;
}

.menu-toggle span {
  height: 3px;
  background: #333;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.menu-toggle.open span:nth-child(1) {
  transform: rotate(45deg) translate(4px, 4px);
}

.menu-toggle.open span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.open span:nth-child(3) {
  transform: rotate(-45deg) translate(4px, -4px);
}

/* Hero Section */
.hero {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 80px 40px;
}

.hero-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 60px;
  max-width: 1200px;
  width: 100%;
  flex-wrap: wrap;
}

.text-section {
  flex: 1 1 400px;
}

.text-section h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 24px;
  line-height: 1.1;
}

.text-section p {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 32px;
  color: #333;
}

.btn {
  background-color: #5B0000;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease;
}

.btn:hover {
  background-color: #5B0000;
}

/* Image Section */
.image-section {
  flex: 1 1 400px;
  display: flex;
  justify-content: center;
}

.image-section img {
  width: 450px;           /* fixed square width */
  height: 450px;          /* fixed square height */
  border-radius: 12px;
  object-fit: cover;      /* ensures it stays neatly cropped */
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}
.image-section img:hover {
  transform: scale(1.03);
}

/* Responsive Navbar */
@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  .nav-brand {
    gap: 8px;
  }
  
  .nav-logo {
    width: 32px;
    height: 32px;
  }
  
  .nav-title {
    font-size: 1.2rem;
  }

  .image-section img {
    width: 250px;
    height: 250px;
  }

  .nav-links {
    position: absolute;
    top: 64px;
    left: 0;
    width: 100%;
    background: white;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    display: none;
  }

  .nav-links.active {
    display: flex;
  }
}

/* Responsive Hero */
@media (max-width: 900px) {
  .hero-content {
    flex-direction: column;
    text-align: center;
  }

  .text-section h1 {
    font-size: 2.4rem;
  }

  .image-section img {
    margin-top: 24px;
  }
}

/* OVERALL STYLES */

.overall-section {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 60px 20px;
  background-color: #fff; /* matches your site background */
}

.overall-card {
  background-color: #ffe6ee; /* soft pink */
  border-radius: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1100px;
  width: 100%;
  padding: 40px 60px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.overall-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #111;
  margin-bottom: 10px;
}

.overall-content h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: #111;
  margin-bottom: 16px;
}

.overall-content p {
  color: #444;
  line-height: 1.6;
  max-width: 600px;
}

.overall-icon img {
  width: 100px;
  height: 100px;
  opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
  .overall-card {
    flex-direction: column;
    text-align: center;
    padding: 30px 20px;
  }

  .overall-icon {
    margin-top: 20px;
  }

  .overall-icon img {
    width: 60px;
    height: 60px;
  }
}

/*END OVERALL STYLE*/


/* UNIT STYLE */

/* Units Section */
.units-section {
  /* make background edge-to-edge */
  width: 100%;
  padding: 80px 0; /* vertical spacing only; horizontal handled by inner container */
  background-color: #fff;
  box-sizing: border-box;
  /* remove centering constraints so background stretches full width */
  /* max-width: 1200px; */
  /* margin: 0 auto; */
}

/* inner wrapper to keep cards/content centered like before */
.units-section .units-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 60px; /* preserves previous horizontal spacing */
  box-sizing: border-box;
}

.section-header {
  text-align: center;
  margin-bottom: 50px;
}

.section-header h2 {
  font-size: 2rem;
  font-weight: 700;
  color: #111;
  margin-bottom: 10px;
}

.section-header p {
  color: #555;
  font-size: 1rem;
}

/* Cards Grid */
.unit-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px; /* smaller, even spacing between columns and rows */
  justify-items: stretch; /* make cards stretch evenly */
  align-items: start;
}

/* Card Style */
.unit-card {
  border: 1px solid #dcdcdc;
  border-radius: 12px;
  padding: 24px;
  width: 100%; /* full width of grid cell */
  background: transparent;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.unit-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}

.unit-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: #111;
}

/* Medal Summary */
.medal-summary {
  display: flex;
  justify-content: space-between;
  gap: 16px; /* spacing between medal boxes */
  margin-bottom: 24px;
}

.medal-item {
  text-align: center;
  flex: 1;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px 10px;
}

.medal-item h4 {
  font-size: 1.3rem;
  margin: 4px 0;
  font-weight: 700;
  color: #111;
}

.medal-item p {
  font-size: 0.9rem;
  color: #666;
}

.medal-icon img {
  width: 26px;
  height: auto;
  display: block;
  margin: 0 auto 8px;
}

/* Sports Played */
.sports-played {
  margin-top: 20px;
}

.sports-played h5 {
  color: #333;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.sports-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* hidden extra tags */
.more-tags {
  display: none; /* toggled via JS */
  gap: 10px;
  margin-left: 8px;
  align-items: center;
}

/* See More now looks like a tag */
.see-more {
  /* reuse tag visual but make interactive */
  background-color: #eaeaea;
  border-radius: 50px;
  padding: 6px 14px;
  font-size: 0.9rem;
  color: #4f46e5;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  outline: none;
  border: none;
}

/* size ellipsis icon inside the see-more */
.see-more img {
  width: 16px;
  height: auto;
  display: block;
}

/* keyboard focus for accessibility */
.see-more:focus {
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
  border-radius: 50px;
}

/* keep consistent tag spacing when more-tags shown */
.sports-tags .tag,
.sports-tags .see-more {
  flex: 0 0 auto;
}

.tag {
  background-color: #eaeaea;
  border-radius: 50px;
  padding: 6px 14px;
  font-size: 0.9rem;
  color: #333;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tag img {
  width: 18px;
  height: auto;
  display: block;
}

.tag.active {
  background-color: #eef2ff;
  color: #4f46e5;
  border: 1px solid #c7d2fe;
}

/* Button */
.view-btn {
  display: block;
  width: 100%;
  margin-top: 24px;
  background-color: #6366f1;
  color: #fff;
  border: none;
  padding: 12px 0;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease;
}

.view-btn:hover {
  background-color: #4f46e5;
}

/* Responsive */
@media (max-width: 900px) {
  .unit-cards {
    grid-template-columns: 1fr;
  }

  .unit-card {
    max-width: 500px;
  }

  /* reduce inner horizontal padding on small screens */
  .units-section .units-inner {
    padding: 0 20px;
  }
}

/* END UNIT STYLE */

/* MEDAL TALLY STYLES */
.medal-tally-section {
  background-color: #fff;
  padding: 60px 20px;
  width: 100%;
}

.medal-tally-section .container {
  max-width: 1100px;
  margin: 0 auto;
  background: transparent; /* no fill */
  border-radius: 12px;
  border: 1px solid #e5e7eb; /* subtle gray border */
  padding: 24px; /* reduced padding to keep layout compact */
  box-sizing: border-box;
}

/* Outside section title (placed outside the inner .container) */
.medal-tally-section .section-title-outside {
  text-align: center;
  margin: 0 auto 18px;
  max-width: 1100px;
  padding: 0 16px;
  box-sizing: border-box;
}

.medal-tally-section .section-title-outside h1 {
  font-size: 2.25rem; /* increased size */
  font-weight: 800;
  color: #4f46e5; /* updated color */
  margin: 10px 0 4px;
}

.medal-tally-section .section-title-outside .subtitle-outside {
  font-size: 0.95rem;
  color: #6b7280;
  margin: 0;
}

.medal-tally-section h2 {
  font-size: 1.8rem;
  font-weight: 700;
  color: #222;
  margin-top: 8px;
  margin-bottom: 8px;
}

.medal-tally-section p {
  font-size: 0.95rem;
  color: #666;
  margin-bottom: 25px;
}

/* Ensure header and rows align exactly */
.medal-table {
  width: 100%;
  border-collapse: collapse;
  box-sizing: border-box;
}

.table-header, .table-row {
  display: grid;
  grid-template-columns: 2fr repeat(4, 1fr);
  align-items: center;
  padding: 12px 16px;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
}

.table-header {
  background: #f3f4f6;
  font-weight: 600;
  color: #555;
  border-radius: 8px;
}

.table-header div {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.table-header div:first-child {
  justify-content: flex-start;
}

.sort-icon {
  width: 14px;
  height: auto;
  display: inline-block;
}

.table-row {
  border-bottom: 1px solid #eee;
}

.table-row:last-child {
  border-bottom: none;
}

.table-row div {
  padding: 8px 0;
  font-size: 0.95rem;
}

.gold, .silver, .bronze, .total {
  text-align: center;
  font-weight: 600;
  border-radius: 50px;
  width: 40px;
  margin: 0 auto;
  padding: 6px 0;
  color: white;
}

.gold {
  background-color: #f4c542;
}

.silver {
  background-color: #b0b0b0;
}

.bronze {
  background-color: #a36023;
}

.total {
  background-color: #6d73f5;
}

/* MEDAL TALLY STYLE END*/

/* Unit Performance Table */

.unit-detailed-stats {
  background-color: #fff;
  padding: 60px 8%;
  border-radius: 12px;
  font-family: "Poppins", sans-serif;
}

.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 2rem;
  margin-bottom: 50px;
  /* make each grid row share available height so columns on the same row match */
  grid-auto-rows: 1fr;
  align-items: stretch;
}

/* ensure direct children fill the grid cell and use column flex layout */
.stats-container > * {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Medal summary panel */
.medal-summary {
   border: solid #ddd 1px;
  border-radius: 14px;
  padding: 1.25rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.summary-header h2 {
  font-size: 1.15rem;
  margin: 0;
  font-weight: 700;
}

#medalFilter {
  background: #f7f8fb;
  border: 1px solid #e6e8f0;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.95rem;
  color: #222;
}

/* layout for chart and counters */
.summary-body {
  display: flex;
  flex-direction: column; /* stack vertically so numbers appear below chart */
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: nowrap;
  flex: 1 1 auto;
  width: 100%;
}

/* allow the chart + counters block to expand and push footer/legend to bottom */
.chart-wrap {
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  order: 1;
}

#medalChart {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* counters */
.medal-numbers {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  width: 100%;
  order: 2;
  margin-top: 0.25rem;
}

/* make each medal item vertically stacked and centered */
.medal-numbers > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 64px;
}

.medal-numbers p {
  margin: 0;
  font-size: 0.95rem;
  color: #666;
  line-height: 1;
}

.medal-count {
  font-size: 1.6rem;
  font-weight: 700;
  color: #111;
}

/* reusable legend/dots */
.summary-legend {
  order: 3;
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  align-items: center;
  margin-top: 0.6rem;
  flex-wrap: wrap;
}

.legend-item {
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
  font-size: 0.9rem;
  color: #555;
}

.dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot.gold { background: #f9c400; }
.dot.silver { background: #c0c0c0; }
.dot.bronze { background: #b87333; }

/* Overview */
.unit-overview {
  border: solid #ddd 1px;
  border-radius: 14px;
  padding: 2rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
}

.unit-overview h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.unit-overview p {
  font-size: 0.95rem;
  color: #444;
  margin-bottom: 1.2rem;
  line-height: 1.6;
}

.unit-overview h3 {
  font-size: 1rem;
  margin-bottom: 0.6rem;
  font-weight: 600;
}

.key-sports span {
  background: #f4f4f8;
  padding: 6px 12px;
  border-radius: 20px;
  margin-right: 8px;
  font-size: 0.9rem;
  display: inline-block;
}

.view-roster {
  background-color: #6366f1;
  border: none;
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-top: 1.2rem;
  cursor: pointer;
  transition: 0.3s;
}

.view-roster:hover {
  background-color: #4f46e5;
}

/* Table Section */
.unit-performance {
  border: solid #ddd 1px;
  border-radius: 14px;
  padding: 2rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.unit-performance h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.unit-performance table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.unit-performance thead {
  background: #f8f9fd;
  font-weight: 600;
}

.unit-performance th,
.unit-performance td {
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
  font-size: 0.95rem;
}

.unit-performance tr:last-child td {
  border-bottom: none;
}

.medal {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
}

.medal.gold { background: #f9c400; color: #000; }
.medal.silver { background: #b0b0b0; color: #000; }
.medal.bronze { background: #b87333; color: #fff; }



/* Responsive: tighten spacing on small screens */
@media (max-width: 480px) {
  .medal-count {
    font-size: 1.4rem;
  }
  .chart-wrap {
    width: 140px;
    height: 140px;
    margin: 0 auto;
  }
  .summary-body {
    flex-direction: column;
    align-items: center;
  }
}

/* Responsive Design Updates */
@media (max-width: 768px) {
  .unit-detailed-stats {
    padding: 20px 16px;
  }

  .stats-container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .medal-summary, 
  .unit-overview, 
  .unit-performance {
    padding: 1rem;
  }

  .summary-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  #medalFilter {
    width: 100%;
  }

  .medal-numbers {
    gap: 0.5rem;
  }

  .medal-numbers > div {
    min-width: 50px;
  }

  .unit-overview h2 {
    font-size: 1.2rem;
  }

  .key-sports span {
    margin-bottom: 8px;
  }

  /* Make tables scrollable horizontally */
  .unit-performance {
    overflow-x: auto;
  }

  .unit-performance table {
    min-width: 500px; /* Ensure table doesn't get too squeezed */
  }

  .unit-performance th,
  .unit-performance td {
    padding: 8px 12px;
    font-size: 0.9rem;
  }

  .medal {
    padding: 3px 8px;
    font-size: 0.75rem;
  }
}

/* canvas sizing controlled by CSS (remove fixed html attrs) */
#medalChart {
  width: 160px !important;
  height: 160px !important;
  max-width: 100%;
  max-height: 100%;
  display: block;
  margin: 0 auto;
}

/* DETAILED STATS END */
