body {
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  background: linear-gradient(120deg, #f1f8ff 0%, #e9fbf7 100%);
  margin: 0;
  min-height: 100vh;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: url('/img/background_texture.svg') repeat;
  opacity: 0.02;
  pointer-events: none;
  z-index: -1;
}

header {
  background: #fff;
  padding: 1.5rem 0 1rem;
  text-align: center;
  box-shadow: 0 4px 28px -6px rgba(50,90,160,0.08);
  position: sticky;
  top: 0;
  z-index: 100;
}

header h1 {
  font-family: 'Nunito', 'Inter', Arial, sans-serif;
  font-weight: 800;
  color: #2b3652;
  font-size: 1.8rem;
  letter-spacing: -1px;
  margin: 0;
}

.dashboard {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.hero-section {
  text-align: center;
  margin-bottom: 3rem;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 900;
  margin: 0 0 1rem 0;
  color: #2b3652;
}

.hero-title .accent {
  background: linear-gradient(90deg,#62e7c1,#3282ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  color: #428f95;
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0;
}

.calculator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.calc-widget {
  background: #fff;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(60,120,180,0.08);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
  cursor: pointer;
  will-change: transform;
  user-select: none;
}

.calc-widget:hover,
.calc-widget:focus-within {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(60,120,180,0.16);
}

.calc-widget h3 {
  margin: 0 0 1rem 0;
  font-size: 1.3rem;
  font-weight: 700;
  color: #389072;
  font-family: 'Nunito', Arial, sans-serif;
  user-select: none;
}

.widget-form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.widget-form input,
.widget-form select {
  padding: 0.7rem 1rem;
  border-radius: 8px;
  border: 1px solid #d1e2fb;
  font-size: 1rem;
  background: #f7fafc;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  box-sizing: border-box;
}

.widget-form input:focus,
.widget-form select:focus {
  outline: 3px solid #2563eb; /* Blue focus for accessibility */
  outline-offset: 2px;
  border-color: #62e7c1;
  box-shadow: 0 0 6px rgba(98, 231, 193, 0.5);
}

.widget-form button {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  background: linear-gradient(90deg, #62e7c1 25%, #3282ff 100%);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 8px 15px rgba(50,130,230,0.3);
  will-change: background-color;
}

.widget-form button:hover,
.widget-form button:focus {
  background: linear-gradient(90deg, #3282ff 25%, #62e7c1 100%);
  box-shadow: 0 10px 25px rgba(50,130,230,0.45);
}

.widget-form button:active {
  transform: scale(0.97);
  box-shadow: 0 6px 15px rgba(50,120,200,0.4) inset;
}

.widget-result {
  min-height: 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: #167e5e;
  padding: 0.6rem 1rem;
  background: #e6fffa;
  border-radius: 6px;
  border-left: 4px solid #62e7c1;
  box-shadow: 0 2px 5px rgba(98, 231, 193, 0.2);
  display: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.widget-result:not(:empty) {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* Validation error styles */
input.error,
select.error {
  border-color: #dc2626; /* Red */
  background-color: #fee2e2;
}

.validation-message {
  color: #dc2626;
  font-size: 0.85rem;
  margin-top: -0.5rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

/* Navigation styles */
.navbar {
  background-color: #fff;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.05);
  position: sticky;
  top: 0;
  z-index: 200;
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.nav-logo {
  font-weight: 900;
  font-size: 1.5rem;
  color: #2563eb;
  text-decoration: none;
  user-select: none;
}

.nav-menu {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex: 1 1 auto;
}

.nav-menu li.active,
.nav-menu li.active .nav-link {
  color: #2563eb; /* Highlight active */
  font-weight: 700;
}

.nav-link {
  color: #334155;
  text-decoration: none;
  font-weight: 600;
  position: relative;
  padding: 0.25rem 0;
  user-select: none;
  transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link:focus {
  color: #2563eb;
  outline: none;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  user-select: none;
}

.hamburger,
.hamburger::before,
.hamburger::after {
  width: 25px;
  height: 3px;
  background-color: #2563eb;
  display: block;
  position: relative;
  transition: all 0.3s linear;
  border-radius: 3px;
  user-select: none;
}

.hamburger::before,
.hamburger::after {
  content: '';
  position: absolute;
  left: 0;
}

.hamburger::before {
  top: -8px;
}

.hamburger::after {
  top: 8px;
}

.nav-search {
  margin-left: 1rem;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #d1e2fb;
  font-size: 1rem;
  max-width: 220px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  flex-grow: 1;
  user-select: none;
}

.nav-search:focus {
  outline: 3px solid #2563eb;
  outline-offset: 2px;
  border-color: #62e7c1;
  box-shadow: 0 0 6px rgba(98, 231, 193, 0.5);
}

/* Mobile styles */
@media (max-width: 768px) {
  .dashboard {
    padding: 1rem 0.5rem;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-desc {
    font-size: 1rem;
  }

  .calculator-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .calc-widget {
    padding: 1rem;
  }

  header h1 {
    font-size: 1.4rem;
  }

  .nav-toggle {
    display: block;
  }

  .nav-menu {
    width: 100%;
    flex-direction: column;
    padding: 1rem 0;
    display: none;
    box-shadow: 0 4px 8px rgb(0 0 0 / 0.1);
    background: #fff;
  }

  .nav-menu.show {
    display: flex;
  }

  .nav-menu li {
    margin-bottom: 0.75rem;
  }

  .nav-search {
    margin: 1rem 0;
    max-width: 100%;
    flex-grow: 0;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.8rem;
  }

  .calc-widget {
    padding: 0.8rem;
  }
}

/* Large desktop optimization */
@media (min-width: 1200px) {
  .calculator-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1600px) {
  .calculator-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* Footer styling */
footer {
  text-align: center;
  padding: 2rem 1rem;
  color: #666;
  font-size: 0.9rem;
}

