:root {
  /* Primary Colors */
  --color-primary: #7ec243; /* Green main */
  --color-primary-dark: #2b7539; /* Dark green */
  --color-primary-light: #a8d17e; /* Optional light green */

  --color-bg-dark: #1f1f1f;
  --color-bg-light: #f3f7f3;
  --color-bg-input-dark: #111;
  --color-bg-input-light: #fff;

  --color-border-dark: rgba(255, 255, 255, 0.1);
  --color-border-light: #e5e5e5;
  --color-border-card-dark: rgba(255, 255, 255, 0.08);
  --color-border-card-light: rgba(0, 0, 0, 0.06);

  --color-text-dark: #ddd;
  --color-text-light: #333;
  --color-text-muted-dark: #aaa;
  --color-text-muted-light: #555;
  --color-text-white: #fff;

  --color-error: red;

  /* Other reusable */
  --radius-card: 18px;
  --radius-input: 10px;
  --radius-btn: 8px;

  --font-base: system-ui;
  --font-title: 24px;
  --font-card-title: 18px;
  --font-value: 22px;
  --font-unit: 12px;

  /* Shadows */
  --shadow-card: 0 6px 16px rgba(0, 0, 0, 0.25);
  --shadow-hover: 0 8px 18px rgba(0, 0, 0, 0.146);
}

body {
  background-color: #232323;
  margin-top: 50px;
}
/* Wrapper */
.scalc-wrapper * {
  box-sizing: border-box;
}

.scalc-wrapper {
  padding: 40px 20px;
  border-radius: 12px;
  border: 1px solid var(--color-border-dark);
  background: linear-gradient(135deg, #000000, var(--color-bg-dark));
  font-family: system-ui;
  max-width: 700px;
  margin: auto;
}

/* Light mode */

.scalc-wrapper.scalc-light {
  background: linear-gradient(135deg, var(--color-bg-light), #f3f7f3);
  border: 1px solid var(--color-border-light);
}

/* Header */

.scalc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.scalc-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--color-primary);
  margin: 0;
}

/* Toggle */

.theme-switch {
  display: inline-block;
  cursor: pointer;
}

.theme-switch input {
  display: none; /* hide the checkbox */
}

.slider {
  font-size: 24px; /* size of sun/moon icon */
  display: inline-block;
}

.icon {
  pointer-events: none; /* so click goes to checkbox */
}

img#theme-icon {
  width: 25px;
  height: 25px;
  transition: filter 0.3s;
}

#theme-icon.moon {
  filter: invert(100%) brightness(200%);
}

#theme-icon.sun {
  filter: none;
}

/* Field */

.scalc-field {
  margin-bottom: 25px;
}

.scalc-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 10px;
  color: var(--color-text-dark);
}

.scalc-light .scalc-label {
  color: var(--color-text-light);
}

/* Info tooltip */

.scalc-info {
  position: relative;
  background: #2b7539;
  color: white;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  border-radius: 50%;
  cursor: pointer;
}

.scalc-tooltip {
  position: absolute;
  bottom: 130%;
  left: 100%;
  transform: translateX(-50%);
  background: #222222a8;
  color: #fff;
  width: 200px;
  padding: 8px 10px;
  font-size: 12px;
  border-radius: 6px;
  white-space: wrap;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
}

.scalc-info:hover .scalc-tooltip {
  opacity: 1;
}

/* Premium Segmented Gender Selector */

.scalc-radio-group {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #444;
  background: #111;
  margin-bottom: 24px;
}

/* sliding highlight */

.scalc-radio-slider {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  background: linear-gradient(
    135deg,
    var(--color-primary-dark),
    var(--color-primary)
  );
  border-radius: 8px;
  transition: 0.35s cubic-bezier(0.4, 0.2, 0.2, 1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

/* radio labels */

.scalc-radio {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  color: var(--color-text-muted-dark);
  z-index: 2;
  transition: color 0.25s ease;
}

/* hide input */

.scalc-radio input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* selected text */

.scalc-radio:has(input:checked) {
  color: var(--color-text-white);
}

/* hover */

.scalc-radio:hover {
  color: var(--color-text-white);
}

.scalc-light .scalc-radio-group {
  background: #f5f7f5;
  border: 1px solid #dcdcdc;
}

.scalc-light .scalc-radio {
  color: var(--color-text-muted-light);
}

.scalc-light .scalc-radio:has(input:checked) {
  color: #fff;
}

/* Input */

.scalc-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid #444;
  background: #111;
  color: #fff;
  font-size: 15px;
  outline: none;
  transition: 0.3s;
  display: block;
}

.scalc-light .scalc-input {
  background: #fff;
  color: #333;
  border: 1px solid #ccc;
}

.scalc-input:focus {
  border-color: #7ec243;
  box-shadow: 0 0 0 2px rgba(126, 194, 67, 0.2);
}

/* Remove number input arrows */

.scalc-input::-webkit-outer-spin-button,
.scalc-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.scalc-input[type="number"] {
  -moz-appearance: textfield;
}

/* Base Button */
.scalc-btn {
  padding: 12px 20px; /* a bit more horizontal padding */
  border: none;
  border-radius: var(--radius-btn);
  background: var(--color-primary-dark);
  color: var(--color-text-white);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s;
  display: inline-block; /* allow side-by-side layout */
  text-align: center;
}

/* Hover effect */
.scalc-btn:hover,
.scalc-btn:focus {
  background: var(--color-primary);
  transform: translateY(-1px);
}

/* Save Data button specific style */
.scalc-save-btn {
  background: var(
    --color-primary-dark
  ); /* slightly different green for distinction */
}

.scalc-save-btn:hover,
.scalc-save-btn:focus {
  background: var(--color-primary);
}

/* Container for Calculate + Save buttons side by side */
.scalc-calc-save-wrapper {
  display: flex;
  justify-content: space-between; /* Calculate left, Save right */
  gap: 10px; /* spacing between buttons */
  margin-top: 20px;
}

/* SBC RESULT CARD */

.scalc-result-card {
  position: relative;
  margin-top: 10px;
  padding: 22px;
  border-radius: var(--radius-card);

  background: rgba(30, 30, 30, 0.55);
  backdrop-filter: blur(14px);

  border: 1px solid var(--color-border-card-dark);
  overflow: hidden;

  transition:
    transform 0.35s ease,
    box-shadow 0.35s ease;
}

/* hover lift */

.scalc-result-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

/* card content */

.scalc-card-content {
  position: relative;
  z-index: 2;
  text-align: center;
}

/* image */

.scalc-result-image {
  width: 110px;
  height: 110px;
  margin: 0 auto 14px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  border: 2px solid #7ec243;
}

.scalc-result-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* image glow */

/* .scalc-result-image::after {
  content: "";
  position: absolute;
  inset: -4px;
  background: linear-gradient(135deg, #2b7539, #7ec243);
  filter: blur(14px);
  opacity: 0.35;
  z-index: -1;
  border-radius: 50%;
} */

/* title */

.scalc-result-title {
  font-size: 18px;
  margin-bottom: 6px;
  font-weight: 600;
  color: var(--color-primary);
}

/* value */

.measure-number {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text-white);
}

.measure-unit {
  font-size: 12px;
  margin-left: 4px;
  opacity: 0.8;
  color: var(--color-text-white);
}

.scalc-result-value {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 4px;
}

/* shine animation */

.scalc-card-shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;

  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.08),
    transparent
  );

  animation: scalc-shine 8s infinite;
}

@keyframes scalc-shine {
  to {
    left: 200%;
  }
}

/* gradient border */

.scalc-card-border {
  position: absolute;
  inset: 0;
  border-radius: 18px;

  border: 2px solid transparent;

  background: linear-gradient(135deg, #2b7539, #7ec243) border-box;

  -webkit-mask:
    linear-gradient(#fff 0 0) padding-box,
    linear-gradient(#fff 0 0);

  -webkit-mask-composite: destination-out;
  mask-composite: exclude;

  opacity: 0;
  transition: opacity 0.35s ease;
}

.scalc-result-card:hover .scalc-card-border {
  opacity: 1;
}

/* glow */

.scalc-card-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #2b7539, #7ec243);
  opacity: 0;
  filter: blur(26px);
  border-radius: 18px;
  transition: opacity 0.35s ease;
}

.scalc-result-card:hover .scalc-card-glow {
  opacity: 0.08;
}

/* Light mode card */

.scalc-light .scalc-result-card {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.scalc-light .scalc-result-value {
  color: var(--color-text-dark);
}
.scalc-light .measure-number {
  color: var(--color-text-light);
}

.scalc-light .measure-unit {
  color: var(--color-text-light);
}

/* Slider Wrapper */
.scalc-slider-wrapper {
  position: relative;
  overflow: hidden;
  margin: 10px 0px;
}

/* Slider Track */
.scalc-slider-track {
  display: flex;
  gap: 20px;
  transition: transform 0.5s ease-in-out;
}

/* Show 3 cards at a time */
/* Desktop (3 cards) */
.scalc-result-card {
  flex: 0 0 calc((100% - 40px) / 3); /* 3 cards with gap 20px */
}

/* Slider Arrows */
.scalc-slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(30, 30, 30, 0.5);
  border: none;
  color: #7ec243;
  font-size: 30px;
  padding: 12px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  transition: all 0.25s ease;
}

.scalc-slider-arrow:hover {
  background: rgba(30, 30, 30, 0.8);
}

.scalc-slider-prev {
  left: 10px;
}

.scalc-slider-next {
  right: 10px;
}

/* Light mode arrows */
.scalc-light .scalc-slider-arrow {
  background: rgba(255, 255, 255, 0.5);
  color: #2b7539;
}

.scalc-light .scalc-slider-arrow:hover {
  background: rgba(255, 255, 255, 0.8);
}

.scalc-slider-controls {
  display: flex;
  justify-content: space-between; /* left & right alignment */
  margin-top: 20px;
  padding: 0px; /* optional: some horizontal padding */
}

.scalc-btn-indec {
  background-color: #2b7539;
  color: white;
  border: none;
  padding: 10px 20px;
  font-size: 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s;
}

.scalc-btn-indec:hover {
  background-color: #7ec243 !important;
}

/* Default (dark mode) */
#scalc-wrapper #wrist-display,
.scalc-wrapper #wrist-display {
  font-weight: 600;
  margin-top: 10px;
  font-size: 20px;
  margin-bottom: 15px;
  color: var(--color-text-dark); /* dark mode text */
}

/* Light mode override */
.scalc-wrapper.scalc-light #wrist-display {
  color: var(--color-text-light); /* light mode text */
}

/* Optional: highlight when input is empty */
.scalc-input.error {
  border: 2px solid var(--color-error);
  animation: shake 0.2s;
}

@keyframes shake {
  0% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-3px);
  }
  50% {
    transform: translateX(3px);
  }
  75% {
    transform: translateX(-3px);
  }
  100% {
    transform: translateX(0);
  }
}

.hidden-on-load {
  visibility: hidden; /* hides visually but keeps layout for JS */
  height: 0;
  overflow: hidden; /* collapse content */
  opacity: 0;
  pointer-events: none; /* prevent accidental interaction */
  transition: all 0.3s ease; /* optional smooth reveal */
}

.scalc-user-counter {
  font-size: 14px;
  color: #2b7539;
  font-weight: 700;
  white-space: nowrap;
}
.user-count {
  font-size: 20px;
  color: #fff;
  font-weight: 700;
}
.scalc-theme-toggle {
  display: none;
}
.scalc-light .scalc-user-counter .user-count {
  color: #000;
}

/*Tab Screen*/

@media (max-width: 1024px) {
  /*Card Start*/
  /* Tablet (3 cards) */
  .scalc-result-card {
    flex: 0 0 calc((100% - 40px) / 3);
    padding: 18px;
  }

  img#theme-icon {
    width: 20px;
    height: 20px;
  }

  .scalc-result-image {
    width: 90px;
    height: 90px;
    margin: 0 auto 10px;
  }

  .scalc-result-title {
    font-size: 14px;
    margin-bottom: 0px;
    margin-top: 0px;
  }

  .scalc-result-value {
    margin-top: 10px;
    margin-bottom: 0px;
  }

  .measure-number {
    font-size: 20px;
  }

  .measure-unit {
    font-size: 12px;
  }
  /*Card End*/

  .scalc-title {
    font-size: 22px;
  }

  .scalc-label {
    font-size: 14px;
  }

  .scalc-radio {
    font-size: 14px;
  }

  .scalc-radio-group {
    margin-bottom: 15px;
  }

  .scalc-input {
    padding: 12px 16px;
    font-size: 14px;
  }

  .scalc-field {
    margin-bottom: 15px;
  }

  .scalc-calc-save-wrapper {
    margin-top: 15px;
  }

  .scalc-btn,
  .scalc-btn-indec {
    padding: 8px 18px;
    font-size: 14px;
  }

  #scalc-wrapper #wrist-display,
  .scalc-wrapper #wrist-display {
    font-size: 18px;
  }

  .scalc-slider-arrow {
    font-size: 18px;
    padding: 10px;
  }
}

/* Mobile*/
@media (max-width: 768px) {
  /* Mobile (2 cards) */
  .scalc-result-card {
    flex: 0 0 calc((100% - 20px) / 2);
    padding: 18px;
  }

  .scalc-result-image {
    width: 90px;
    height: 90px;
    margin: 0 auto 10px;
  }

  .scalc-result-title {
    font-size: 14px;
    margin-bottom: 0px;
    margin-top: 0px;
  }

  .scalc-result-value {
    margin-top: 10px;
    margin-bottom: 0px;
  }

  .measure-number {
    font-size: 18px;
  }

  .measure-unit {
    font-size: 10px;
  }
  /*Card End*/

  .scalc-title {
    font-size: 20px;
  }

  .scalc-label {
    font-size: 12px;
  }

  .scalc-radio {
    font-size: 12px;
  }

  .scalc-radio-group {
    margin-bottom: 15px;
  }

  .scalc-input {
    padding: 12px 16px;
    font-size: 12px;
  }

  .scalc-btn,
  .scalc-btn-indec {
    padding: 8px 18px;
    font-size: 12px;
  }

  #scalc-wrapper #wrist-display,
  .scalc-wrapper #wrist-display {
    font-size: 16px;
  }

  .scalc-field {
    margin-bottom: 15px;
  }
  img#theme-icon {
    width: 20px;
    height: 20px;
  }

  .scalc-calc-save-wrapper {
    margin-top: 15px;
  }

  .scalc-slider-arrow {
    font-size: 18px;
    padding: 10px;
  }

  .user-count {
    font-size: 16px;
  }

  .scalc-user-counter {
    font-size: 10px;
  }
}

/* Make buttons responsive on small screens */
@media (max-width: 480) {
  /* Very small phones (1 card) */
  .scalc-result-card {
    flex: 0 0 100%;
    padding: 15px;
  }

  .scalc-result-image {
    width: 70px;
    height: 70px;
    margin: 0 auto 10px;
  }

  .scalc-result-title {
    font-size: 14px;
    margin-bottom: 0px;
    margin-top: 0px;
  }

  .scalc-result-value {
    margin-top: 5px;
    margin-bottom: 0px;
    gap: 2px;
  }

  .measure-number {
    font-size: 16px;
  }

  .measure-unit {
    font-size: 10px;
  }

  /*Card End*/

  .scalc-title {
    font-size: 18px;
  }

  .scalc-label {
    font-size: 12px;
  }

  .scalc-radio {
    font-size: 12px;
  }

  /* .scalc-calc-save-wrapper {
    flex-direction: column;
  }

  .scalc-btn {
    width: 100%; 
  } */

  .scalc-radio-group {
    margin-bottom: 15px;
  }

  .scalc-input {
    padding: 12px 16px;
    font-size: 12px;
  }

  .scalc-field {
    margin-bottom: 15px;
  }

  .scalc-calc-save-wrapper {
    margin-top: 15px;
  }

  img#theme-icon {
    width: 18px;
    height: 18px;
  }

  .scalc-btn,
  .scalc-btn-indec {
    padding: 8px 18px;
    font-size: 12px;
  }

  #scalc-wrapper #wrist-display,
  .scalc-wrapper #wrist-display {
    font-size: 14px;
  }

  .scalc-slider-arrow {
    font-size: 18px;
    padding: 10px;
  }

  .user-count {
    font-size: 16px;
  }

  .scalc-user-counter {
    font-size: 10px;
  }
}

button:focus,
button:focus-visible {
  outline: none; /* removes the default outline */
  box-shadow: none; /* removes any focus ring shadow */
  /* background: none; removes any background change on focus */
}

/* Remove pink background on focus and hover */
.scalc-btn-indec:focus,
.scalc-btn-indec:focus-visible,
.scalc-btn-indec:hover,
.scalc-slider-arrow:focus,
.scalc-slider-arrow:focus-visible,
.scalc-slider-arrow:hover {
  /* background-color: inherit !important; keep your normal/hover background */
  outline: none !important; /* remove pink outline */
  box-shadow: none !important; /* remove Chrome pink glow */
}

button#decrease-btn:focus,
button#increase-btn:focus {
  background-color: #7ec243;
}

button.scalc-slider-arrow.scalc-slider-next:focus,
button.scalc-slider-arrow.scalc-slider-prev:focus {
  background-color: inherit;
}
