:root {
  --pink-light:     #f5eee6;
  --pink-dark:      #c77a87;
  --pink-very-dark: #50393c;
  --purple-light:   #D2C1E3;
  --sky-light:      #e5eff7;
  --sky-dark:       #7793AB;
  --sky-very-dark:  #4A6379;
  --input-focus:    #0d0c0eaa;
}

/* Box-sizing rule: includes padding and border in element's total width and height */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', sans-serif;
  margin: 0;
  position: relative;
  background: white;
  /*background: linear-gradient(to left, #e9d7b500 0%, #ffffff 10%, #ffffff 90%, #e9d7b500 100%), url(Images/Backgrounds/bg_neutral_4_l.jpg) center / auto 700px;*/
  color: #333;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  min-height: 100vh;
}
/* gradient overlay covers the entire viewport */
body::before {
  content: "";
  position: fixed;       /* stays locked under your content */
  top: 0; 
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

#siteLogo {
  position: absolute; /* rel to container */
  top: calc(1.5rem + 5px); /* centered */
  left: max(calc((100vw - 800px)/2), 1rem);;
  height: 50px;
}

.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1000px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 24px rgba(0,0,0,0.08);
  padding: 2rem;
  margin-top: 2rem;
  box-shadow: 0px 0px 20px rgba(0,0,0,0.2);
}

.titleImg{
  display:block; 
  margin:auto;
  width: 80vw; 
  max-width: 350px;
  height: auto;
}

h1, h2 {
  text-align: center;
}
h3, h4 {
  margin: 0;
}
h4 {
  color: #444;
}

form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 2rem;
  align-items: end;
}

label {
  display: flex;
  flex-direction: column;
  margin-top: 0.8rem;
}
#labelSwitchMode, #labelHeightPercetile {
  grid-column: span 2;
}

input, select {
  padding: 0.4rem;
  margin-top: 0.4rem;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, select:focus {
  outline: none;
  border-color: var(sky-dark);
  box-shadow: 0 0 8px var(--input-focus);
}
input:disabled,
select:disabled {
  background: #eee;
  color: balck!important;
  cursor: default;
}

/* ---- buttons ---- */
button {
  display: block;
  padding: 0.8rem 1.6rem;
  margin: 1rem 0;
  font-size: 1rem;
  font-weight: bold;
  color: #fff;
  background: var(--sky-dark);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.3s;
}
button:hover {
  background: linear-gradient(90deg, var(--sky-very-dark), var(--sky-dark));
}
.button {
  grid-column: 1 / -1;
}

.button-secondary {  
  color: black;
  background: none;  
  padding: 0.5rem 1rem;
  border: 2px solid var(--sky-dark);
}
.button-secondary:hover { 
  color: white;
}

/* ----- adding 1 Year & sharing results ---- */
.year-control, .share-container {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}

.share-label {
  display: flex;
  flex-direction: column;
}

.share-button {
  display: inline-block;
  margin-bottom: 0;
}
.share-button a {
  color: black;
  text-decoration: none;
}
.share-button:hover a {
  color: white;
}

#babyName {
  width: 10rem;
}

/* ---- results ---- */
.chart-container {
  position: relative;
  height: 50vh;
  margin: 2rem 0;
}
canvas{
  height: 100%!important;
  width: 100%!important;
  margin: auto;
}

#labelCountryChoice {
  align-items: center;
}
.size-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 0.5rem;
}
.size-filters label {
  display: flex;
  align-items: center;
}
.size-filters input[type="checkbox"] {
  margin-right: 0.5rem;            /* space between box and text */
  width: 1.2em;                    /* slightly larger hit area */
  height: 1.2em;
  accent-color: var(--sky-very-dark);   /* Chrome/Firefox native colored checkbox */
  cursor: pointer;
  transition: transform 0.15s ease;
}
.size-filters input[type="checkbox"]:hover {
  transform: scale(1.1);
}

table {
  width: 100%;
  border-collapse: collapse;
  color: var(--sky-very-dark);
}

th, td {
  padding: 0.8rem;
  text-align: center;
  border-bottom: 1px solid #eee;
}

th {
  background: var(--sky-light);
}

.summary-block {
  text-align: center;
  margin-top: 30px;
  margin-bottom: 20px;
  color: var(--sky-very-dark);
}

#seasonTable {
  margin-top: 1rem;
}

/* ---- articles ---- */
article dt {
  margin-top: 1rem;
  font-weight: bold;
}
article dd {
  margin-left: 0rem;
}

.imgArticle {  
  display:block; 
  margin:auto;
  width: 70vw; 
  max-width: 300px;
  max-height: 40vh;
  height: auto;
}

.toggle-intro-btn {
  display: flex;
  margin: 1rem auto;
}

/* ---------- Custom Thick Slider Styling ---------- */
#modeSlider {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  touch-action: pan-x;
  width: 100px;               /* overall length */
  height: 30px;               /* thick track */
  margin: 0;
  padding: 0;
  background: #f8f8f8;        /* very light track fill */
  border: 2px solid #e0e0e0;  /* subtle border around track */
  border-radius: 36px;         /* half of track height + border */
  cursor: pointer;  
  margin-top: 0.4rem;
}

/* Remove default focus outline */
#modeSlider:focus {
  outline: none;
}

/* WebKit Track */
#modeSlider::-webkit-slider-runnable-track {
  width: 100%;
  height: 30px;
  background: inherit;
  border: inherit;
  border-radius: inherit;
}

/* WebKit Thumb */
#modeSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
          appearance: none;
  width: 30px;
  height: 30px;
  background: white;
  border: 2px solid var(--sky-dark);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* Thumb Hover & Active States */
#modeSlider:hover::-webkit-slider-thumb {
  transform: scale(1.1);
  box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}
#modeSlider:active::-webkit-slider-thumb {
  transform: scale(1.05);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Firefox Track */
#modeSlider::-moz-range-track {
  width: 100%;
  height: 18px;
  background: #f8f8f8;
  border: 2px solid #e0e0e0;
  border-radius: 9px;
}

/* Firefox Thumb */
#modeSlider::-moz-range-thumb {
  width: 30px;
  height: 30px;
  background: white;
  border: 2px solid var(--sky-dark);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
#modeSlider:hover::-moz-range-thumb {
  transform: scale(1.1);
  box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}
#modeSlider:active::-moz-range-thumb {
  transform: scale(1.05);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.mode-selector {
  display: flex;
  align-items: center;
  margin: auto;
}

#modeLabel {
  align-self: center;
  margin: auto 20px;
}

/* ---------- Top Menu ---------- */
/* Top Navigation Menu */
#menu-placeholder {
  height: 80px; /* Height of the menu to prevent layout shift */
}

.top-menu {
  position: sticky;
  top: 0;
  z-index: 1000;
}

.menu-bar {
  display: flex;
  height: 80px;
  justify-content: center;
  align-items: center;
  gap: 3rem;
  list-style: none;
}

.menu-label {
  color: black;
  font-weight: 500;
  cursor: pointer;
  padding: 3px 2px;
  transition: background 0.3s ease;
}
.menu-label:hover {
  border-bottom: 2px solid black;
}

/* Submenu Dropdown */
.submenu {
  position: fixed;
  top: 60px;
  left: 0;
  width: 100vw;
  background: white;
  list-style: none;
  padding: 2rem 0rem;
  margin-top: 1rem;
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
}
.menu-item:hover .submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.submenu li a {
  display: block;
  padding: 0.6rem 0rem;
  color: black;
  text-decoration: none;
  transition: background 0.2s ease;
}
.submenu li a:hover {
  text-decoration: underline;
}

.icon img {
  width: 20px;
  height: 20px;
  vertical-align: middle;
  margin-right: 0.5rem;
}

.menu-burger {
  display: none;
}

/* ---------- Footer ---------- */
#footer-placeholder {
  width: 100%;
  margin-top: 2rem;
  z-index: 500;
}

/* Footer wrapper */
.site-footer {
  width: 100%;  
  background: var(--sky-very-dark);
  color: white;
  padding: 2rem 1rem;
}

/* Centered content, locked to same max-width */
.footer-container {
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
}

/* Footer navigation links */
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-nav a {
  color: white;
  text-decoration: none;
  padding: 0.25rem 0.5rem;
}
.footer-nav a:hover {
  text-decoration: underline
}

/* Footer informational text */
.footer-info p {
  margin: 0;
  line-height: 1.4;
}

/* ---------- Responsive Design ---------- */
@media (max-width: 600px) {
  .menu-burger {
    display: block;
    position: fixed;
    top: 1rem;
    right: 1rem;
    height: 60px;
    width: 60px;
    background: linear-gradient(90deg, var(--sky-very-dark), var(--sky-dark));
    color: white;
    border: none;
    border-radius: 50%;
    padding: 0.5rem;
    z-index: 1100;
    font-size: 1.25rem;
  }
  .shown {
    display: flex!important;
  }

  /* -- logo -- */
  #siteLogo {
    left: 30vw;
    width: 40vw;
  }

  /* menu position */
  .top-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
  }
  /* menu layout */ 
  .menu-bar {
    display: none;
    margin: 0;
    padding-top: 2rem;
    height: auto;
    align-items: flex-start;
    flex-direction: column;
    background: white;
    gap: 0; /* remove extra spacing between items */
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  }
  .menu-item {
    font-size: 1.1rem;
    padding: 1rem;
    position: relative;
  }
  .submenu {
    position: static; /* remove fixed positioning */
    width: 100%;
    top: 0;
    padding: 0.5rem 1rem;
    margin-top: 0.5rem;
    box-shadow: none;
    opacity: 0;
    visibility: hidden;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
  }
  .menu-item.active .submenu {
    opacity: 1;
    visibility: visible;
    max-height: 500px; /* enough to show all items */
  }
  .submenu li a {
    padding: 1rem 0;
  }

  .container {
    width: calc(100vw - 2rem);
    padding: 1rem;
  }
  
  #titleImg{
    width: 100%;
  }

  label {
    margin-top: 0.5rem;
    align-items: center;
  }
  #labelSwitchMode, #labelHeightPercetile {
    grid-column: span 1;
  }
  #labelSwitchMode h4 {
    text-align: center;
  }
  input, select {
    font-size: 1.05rem;
  }

  form {
    grid-template-columns: 100%;
  }

  button {
    background: linear-gradient(90deg, var(--sky-very-dark), var(--sky-dark));
  }

  .chart-container {
    height: 40vh!important;
  }

  /* Reflow table into a scrollable block */
  #seasonTableContainer {
    overflow-x: auto;
  }
  #seasonTable {
    white-space: nowrap;
  }

  /* ----- slider ---- */
  #modeSlider {
    width: 25vw;
    height: 2.5rem;
    border-radius: 2.5rem;
  }
  #modeSlider::-webkit-slider-runnable-track {
    width: 25vw;
    height: 2.5rem;
  }
  #modeSlider::-webkit-slider-thumb {
    width: 2.5rem;
    height: 2.5rem;
  }
  #modeSlider::-moz-range-track {
    width: 25vw;
    height: 2.5rem;
    border-radius: 2.5rem;
  }
  #modeSlider::-moz-range-thumb {
    width: 2.5rem;
    height: 2.5rem;
  }

  /* ----- footer ---- */
  .footer-nav {
    flex-direction: column;
    width: 100%;
    align-items: center;
  }

  .footer-nav a {
    width: 100%;
    text-align: center;
  }
}