/* ==========================
   COLOR VARIABLES (THEME)
   ========================== */
:root {
  --color-bg: #969696;
  --color-text: #333333;
  --color-text-light: #ffffff;
  --color-text-muted: #666666;
  --color-text-secondary: #000000;
  --color-primary: #04aaff;
  --color-primary-dark: #0288d1;
  --color-primary-darker: #003d7a;
  --color-secondary: #28a745;
  --color-secondary-dark: #218838;
  --color-danger: #a80000;
  --color-danger-dark: #530000;
  --color-border: #d1d5db;
  --color-border-light: #ccc;
  --color-nav-bg: #3a3939;
  --color-nav-secondary-bg: #555454;
  --color-text-light: #ffffff;
  --color-nav-link: #ddd;
  --color-nav-link-hover: #04aaff;
  --color-nav-link-active: #0288d1;
  --color-button-bg: var(--color-primary);
  --color-button-hover-bg: var(--color-primary-dark);
  --color-button-text: var(--color-text-light);
  --color-button-alt-bg: #575757;
  --color-button-alt-hover-bg: var(--color-primary-dark);
}

/* ==========================
   GLOBAL / COMMON STYLES
   ========================== */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  text-align: center;
  overflow-y: auto;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover, a:focus {
  text-decoration: underline;
  outline: none;
}

button, .button {
  font-family: Arial, sans-serif;
  font-weight: 600;
  background-color: var(--color-button-bg);
  color: var(--color-button-text);
  border: none;
  border-radius: 6px;
  /*padding: 0.6rem 1.4rem;*/
  font-size: 1.1rem;
  cursor: pointer;
  transition: background-color 0.25s ease;
}

button:hover, .button:hover {
  background-color: var(--color-button-hover-bg);
}

button:focus, .button:focus {
  outline: 3px solid #04aaff;
  outline-offset: 2px;
}

button:disabled, .button:disabled {
  background-color: var(--color-button-alt-bg);
  cursor: not-allowed;
}

footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100vw;
  background-color: var(--color-nav-bg);
  color: var(--color-text-light);
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  text-align: center;
  user-select: none;
}

h1 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

label {
  display: block;
  margin-top: 1rem;
}

p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
}

select,
input {
  width: 20vw;
  padding: 0.75rem 0 0.75rem 0;
  margin-top: 0.25rem;
  font-size: 1rem;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
}

input#amount {
  text-align: center;
}

input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
  -webkit-appearance: none;
  margin: 0; 
}

input[type=number] {
  -moz-appearance: textfield;
}
#app {
  flex-direction: column;
}

/* ===========================
   NAVIGATION BAR WITH HAMBURGER MENU
   =========================== */

nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  background-color: var(--color-nav-bg);
  color: var(--color-text-light);
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  z-index: 1000;
  box-sizing: border-box;
  font-size: 1rem;
  user-select: none;
}

nav .nav-container {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 1rem; /* ensures breathing room */
  width: 100%;
  box-sizing: border-box;
}

/* Logo */
nav .logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--color-text-light);
}

.logo img {
  max-height: 40px; /* Or whatever fits your nav height */
  width: auto;
  display: block;
}

/* Nav links - desktop */
nav ul {
  list-style: none;
  display: flex;
  align-items: center; /* Vertical centering */
  gap: 1.5rem;
  margin: 0.5rem;
  padding: 0;
}

nav ul li {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Nav links - desktop */
nav ul li a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 6px;
  font-size: 1.2rem;
  color: var(--color-light, #ddd);
  text-decoration: none; /* Ensure no underline */
  border-radius: 6px;
  transition: background-color 0.3s, color 0.3s;
}

nav ul li a i {
  pointer-events: none;
}

/* Tooltip */
nav ul li a::after {
  content: attr(aria-label);
  position: absolute;
  bottom: -1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--color-nav-bg);
  color: var(--color-text-light);
  padding: 2px 6px;
  font-size: 0.75rem;
  border-radius: 3px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

nav ul li a:hover::after,
nav ul li a:focus::after {
  opacity: 1;
  pointer-events: auto;
}

nav ul li a:hover,
nav ul li a:focus {
  background-color: var(--color-accent-hover, #04aaff);
  color: var(--color-lightest, #fff);
  text-decoration: none; /* Explicitly disable underline on hover */
}

nav ul li a.active {
  background-color: var(--color-primary-active, #0288d1);
  color: #fff;
}

#logout a:hover {
  background-color: var(--color-danger);
  color: var(--color-lightest, #fff);
  text-decoration: none; /* Explicitly disable underline on hover */
}

/* Hamburger icon button */
.nav-toggle {
  display: none; /* Hidden by default */
}

.nav-toggle:focus {
  outline: 2px solid var(--color-nav-link-hover);
}

.nav-toggle span {
  width: 28px;
  height: 3px;
  background-color: var(--color-text-light);
  border-radius: 2px;
  transition: all 0.3s linear;
  position: relative;
  transform-origin: 1px;
}

/* MOBILE STYLES */
@media (max-width: 768px) {
    .nav-toggle {
      background: none;
      border: none;
      cursor: pointer;
      padding: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--color-lightest, #fff);
      font-size: 1.5rem;
      z-index: 1100;
    }


  nav ul {
    position: fixed;
    top: 32px; /* height of nav bar approx */
    background-color: var(--color-nav-secondary-bg);
    width: 100vw;
    flex-direction: row;
    justify-content: center;
    padding-top: 1rem;
    padding-bottom: 1rem;
    gap: 1.5rem;
    transform: translateY(-100%);
    transition: transform 0.3s ease-in-out;
   
    visibility: hidden;
    opacity: 0;
    z-index: 1000;
  }

  nav ul.open {
    transform: translateY(0);
    visibility: visible;
    opacity: 1;
  }

  nav ul li a {
    font-size: 1.25rem;
    
  }

  /* Show hamburger button */
  .nav-toggle {
    display: flex;
  }
  .nav-toggle .fa-xmark {
    display: none;
  }
  .nav-toggle.open .fa-bars {
    display: none;
  }
  
}

/* ==========================
   LOGO
   ========================== */
#logo-main {
  max-width: 30vw;
  position: absolute;
  z-index: 1;
  fill: #d1d2d3;
}

.logo-container {
  display: flex;
  height: 100vh;
  justify-content: center;
  align-items: center;
}

.a, .b, .c {
  stroke: #5c5c5c;
}

.d {
  fill: grey;
}

#logo-chest, #logo-wing, #logo-stomach {
  fill: var(--color-bg);
}

/* ==========================
   EXERCISE
   ========================== */
.workout-container {
  margin-top: 5rem;
  padding: 2rem;
  text-align: center;
  user-select: none;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

#section-name {
  font-size: 3rem;
  color: var(--color-text-light);
  margin-bottom: 2rem;
}

#exercise-name {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 1.5rem;
}

#exercise-reps {
  font-size: 1.5rem;
  color: var(--color-text-light);
  margin-bottom: 1.5rem;
}

#exercise-desc {
  font-size: 1.2rem;
  color: var(--color-text-secondary);
  padding: 0 2rem;
}

.buttons-container {
  margin-top: 5rem;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

#back-button, #skip-button {
  padding: 1rem 2rem;
  font-size: 1rem;
  background-color: var(--color-button-alt-bg);
  color: var(--color-button-text);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: background 0.3s;
}

#back-button:hover, #skip-button:hover {
  background-color: var(--color-primary-dark);
}

#restart-button {
  padding: 1rem 2rem;
  font-size: 1rem;
  background-color: var(--color-danger);
  color: var(--color-button-text);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: background 0.3s;
}

#restart-button:hover {
  background-color: var(--color-danger-dark);
}

#workout-summary {
  margin: 2rem auto;
  max-width: 600px;
  padding: 1rem;
  background-color: #f0f0f0;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  text-align: center;
}

#summary-text {
  width: 90%;
  height: 200px;
  padding: 1rem;
  font-family: monospace;
  font-size: 1rem;
  resize: none;
  border: 1px solid var(--color-border-light);
  border-radius: 6px;
  margin-bottom: 1rem;
}

#copy-summary {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  background-color: var(--color-secondary);
  color: var(--color-button-text);
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

#copy-summary:hover {
  background-color: var(--color-secondary-dark);
}

/* ==========================
   TOOLS
   ========================== */
.tools-container {
  margin-top: 5rem;
  display: flex;
  height: 100vh;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.level {
  background: var(--color-bg);
  border: 4px solid var(--color-text-light);
  border-radius: 40px;
  position: relative;
  overflow: hidden;
}

.horizontal {
  width: 90vw;
  height: 40px;
  margin: 10px;
}

.vertical {
  width: 40px;
  height: 90vw;
  margin: 10px;
}

.bubble {
  background: var(--color-text-light);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--color-bg);
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(0, 0);
}

.output {
  margin-top: 10px;
  margin-bottom: 10vh;
  font-size: 3.5rem;
  color: var(--color-text-light);
  text-align: center;
}

/* ==========================
  CURRENCY
   ========================== */
.currency-container {
  margin-top: 5rem;
  padding: 2rem;
  text-align: center;
  user-select: none;
  height: 90vh;
  min-width: 60vw;
  display: flex;
  flex-direction: column;
}

.currency-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.currency-option img {
  width: 20px;
  height: 15px;
  object-fit: cover;
}

#result {
  margin-bottom: 1.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text-secondary);
}

.flags {
  display: flex;
  justify-content: center;
  gap: 4rem; /* increased gap between columns */
  margin-bottom: 2rem;
}
.column {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.flag-button {
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 0.5rem;
  background: transparent;
  transition: 0.2s;
  width: 12vw; /* Responsive width */
  max-width: 100px;
  min-width: 75px;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flag-button:hover {
  background-color: #e0e7ff;
}

.flag-button.selected {
  border-color: #2563eb;
  background-color: #e0f2fe;
}

.flag-button img {
  aspect-ratio: 4 / 3; /* Keeps a consistent ratio */
  width: 200%;
  height: auto;
  object-fit: fill;
  border-radius: 0.25rem;
  display: block;
}

#amount {
  width: 60%;
  max-width: 400px;
  min-width: 200px;
  margin: 1.5rem auto;
  display: block;
  text-align: center;
  padding: 0.75rem;
  font-size: 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
}

.column-label {
  font-size: 1.25rem;
  font-weight: bold;
  color: white;
  margin-bottom: 1rem;
  text-align: center;
}

/* Chrome, Safari, Edge, Opera */
input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
  -webkit-appearance: none;
  margin: 0; 
}

/* Firefox */
input[type=number] {
  -moz-appearance: textfield;
}

.add-currency-container {
  width: 100%;
  text-align: center;
  margin-top: 2rem;
}

#add-currency-button {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s;
}


#add-currency-button:hover {
  background-color: #0056b3;
}

/* ==========================
   PERCENTAGE CALCULATOR PAGE
   ========================== */
.calculator {
  padding: 20px;
  width: 100%;
  max-width: 400px;
}
.calculator-section {
  margin-bottom: 20px;
}
.calculator-section h2 {
  color: #333;
  font-size: 1.2em;
}

.calculator-section input {
  width: 100%;
  padding: 10px;
  margin: 10px 0;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  text-align: center;
}

.calculator-section button {
  height: 100%;
  width: 75%;
  padding: 10px;
  background-color: var(--color-primary-dark);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.calculator-section button:hover {
  background-color: var(--color-primary-darker);
}

.calc-section input[type="number"],
.calc-section input[type="text"] {
  width: 100%;
  max-width: 300px;
  padding: 0.6rem;
  margin-top: 0.5rem;
  font-size: 1rem;
  border: 1px solid var(--color-border-light);
  border-radius: 6px;
  box-sizing: border-box;

  /* Center input text */
  text-align: center;

  /* Ensure mobile browsers respect centering */
  -webkit-text-align: center;
  -moz-text-align-last: center;
  text-align-last: center;
}

/* Placeholder centering */
.calc-section input::placeholder {
  text-align: center;
  -webkit-text-align: center;
  -moz-text-align-last: center;
  text-align-last: center;
  color: #999;
  opacity: 1;
}

/* Remove spin buttons in mobile Chrome / Safari */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type=number] {
  -moz-appearance: textfield; /* Firefox */
}

/* === Converter Page Styles === */
/* Keep menu visible at top */
.icon-menu {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
  }

.icon-menu button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  font-size: 1rem;
  border-radius: 10px;
  background: var(--color-primary-dark);
  cursor: pointer;
  width: 20vw;
  height: 20vw;
  max-width: 140px;
  max-height: 140px;
  min-width: 100px;
  min-height: 100px;
  
}

.icon-menu button i {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.icon-menu button:hover {
  background-color: var(--color-primary-darker);
  color: #fff;
  transform: scale(1.05);
}

/* UNIT GRID */
.unit-grid {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.unit-grid button {
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  cursor: pointer;
  width: 100%;
}

.unit-grid button.active {
  background-color: var(--color-primary);
  color: white;
}

.hidden {
  display: none;
}

#resultBox .button {
  width: 20vw;
  height: 20vw;
  max-width: 140px;
  max-height: 140px;
  min-width: 100px;
  min-height: 100px;
}
