:root{
    --bg-color-1: purple;
}

/* ===========================
   GLOBAL BASE
   =========================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding-right: 5rem;
  padding-left: 5rem;
  font-family: "Segoe UI", Arial, sans-serif;
  background: #f2f2f2;
  color: #1a1a1a;
}


/* ===========================
   HEADINGS
   =========================== */
h1, h2 {
  font-weight: 900;
  color: #2a75bb;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-shadow: 0 2px 0 #ffffff;
}

h1 {
  font-size: 2.4rem;
  margin-bottom: 0.5rem;
}

h2 {
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}


/* ===========================
   FORM WRAPPER
   =========================== */
form {
  background: #ffffff;
  padding: 1.5rem;
  border-radius: 18px;
  border: 4px solid #2a75bb;
  box-shadow: 0 6px 0 #1b4f7a;
  margin-top: 1.5rem;
}


/* ===========================
   INPUTS & SELECTS
   =========================== */
label {
  font-weight: 700;
  display: inline;
  margin-bottom: 0.25rem;
}

input[type="text"],
input[type="number"],
select {
  padding: 0.35rem;
  border-radius: 10px;
  border: 2px solid #cccccc;
  font-size: 1rem;
  margin-bottom: 0.25rem;
  background: #ffffff;
  text-align: center;
}

input[type="text"]{
  width: fit-content; /* shrink to content */ 
  min-width: 120px; /* never get smaller than this */ 
  max-width: 100%; /* but allow expansion */ 
  white-space: nowrap; /* prevents wrapping */
}

input:disabled,
select:disabled {
  background: #e6e6e6;
  cursor: not-allowed;
}

.fill-out{
  border: 2px solid #2a75bb !important;
  box-shadow: 0px 0px 7px #2a75bb;
}

/* ===========================
   BUTTONS — Pokémon Style
   =========================== */
button,
input[type="submit"] {
  background: #ffcb05;
  color: #1b4f7a;
  border: 3px solid #1b4f7a;
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  box-shadow: 0 4px 0 #1b4f7a;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

input[type="submit"] {
  padding: 1.2rem 2.8rem;
  font-weight: 1000;
  font-size: larger;
}

.calculate {
  width: 100%;
  text-align: center;
  margin-top: 5rem;
  margin-bottom: 2rem;
}

button:hover,
input[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #1b4f7a;
}

button:active,
input[type="submit"]:active {
  transform: translateY(1px);
  box-shadow: 0 2px 0 #1b4f7a;
}

.removeBtn {
  padding: 0.6rem 0.9rem;   /* Circle shaped as much as possible */
}

/* .removeBtn:hover {
  background: #ff1605;
} */


/* ===========================
   TABLES
   =========================== */
.table-container {
  overflow-x: auto;
  margin-top: 1rem;
  margin-bottom: 1rem;
  width: 100%;
  -webkit-overflow-scrolling: touch; /* smooth scrolling on iOS */
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  border: 3px solid #2a75bb;
}

th {
  background: #2a75bb;
  color: #ffffff;
  padding: 0.75rem;
  font-size: 1rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap; /* prevents text wrapping inside cells */
  border-right: 1px solid #ffcb05;
  border-left: 1px solid #ffcb05;
}

td {
  padding: 0.75rem;
  border: 1px solid #dddddd;
  vertical-align: center;
  white-space: nowrap; /* prevents text wrapping inside cells */
}

tr:nth-child(even) {
  background: #f8f8f8;
}


/* ===========================
   SEARCH DROPDOWN LISTS
   =========================== */
.search-container {
  position: relative;
  display: inline;
}

.results-list {
  position: fixed;      
  z-index: 9999;        /* <-- ensures it floats above all content */
  top: 100%;
  left: 0;
  right: 0;
  margin: 0;
  padding: 0;
  background: #ffffff;
  border: 2px solid #2a75bb;
  border-top: none;
  max-height: 300px;
  overflow-y: auto;
  list-style: none;
  z-index: 20;
  display: none;
  border-radius: 0 0 10px 10px;
}

.results-list.active {
  display: block;
}

.results-list li {
  padding: 0.5rem;
  cursor: pointer;
  font-weight: 600;
}

.results-list li:hover {
  background: #ffcb05;
  color: #1b4f7a;
}



/* ===========================
   WIDTH UTILITIES
   =========================== */

.w75 {
  width: 75px;
  display: inline-block;
}

.w82 {
  width: 82.61px;
  display: inline-block;
}

.fixed-width {
  width: 90px;
  display: inline-block;
}

.hidden {
  display: none;
}

.smaller-txt{
  font-size: small;
}



/* ===========================
   FOOTER
   =========================== */
footer {
  margin-top: 10rem;
  text-align: center;
  padding: 1rem;
  background: #2a75bb;
  color: #ffffff;
  border-top: 4px solid #ffcb05;
  border-radius: 12px;
  font-weight: 700;
}


/* ===========================
   Full‑screen dimmed overlay
   =========================== */
#loadingOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.103); /* dim everything */
  backdrop-filter: blur(1px);    /*   optional blur */
  display: none;                   /* hidden by default */
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* 3‑dot loader */
.loading-dots {
  display: flex;
  gap: 10px;
}

.loading-dots span {
  width: 14px;
  height: 14px;
  background: #ffcb05;          /* Pokémon yellow */
  border-radius: 50%;
  animation: bounce 0.6s infinite alternate;
}

/* Delay each dot */
.loading-dots span:nth-child(2) {
  animation-delay: 0.2s;
}
.loading-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

/* Animation */
@keyframes bounce {
  from {
    transform: translateY(0);
    /* opacity: 0.5; */
  }
  to {
    transform: translateY(-10px);
    /* opacity: 1; */
  }
}



/* ===========================
   RESPONSIVE BEHAVIOR
   =========================== */
@media (max-width: 768px) {
  form {
    padding: 1rem;
  }
  body {
    padding-right: 0.5rem;
    padding-left: 0.5rem;
  }
}