/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Outfit", sans-serif;
  background-color: #f4f4f9;
  margin: 0;
  padding: 0;
}

/* Navbar */
.navbar {
  background-color: #000;
  padding: 10px 0;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
}

.navbar-links {
  list-style: none;
  display: flex;
  gap: 30px;
  align-items: center;
  white-space: nowrap;
}

.navbar-links li {
  display: inline-block;
}

.navbar-links a {
  color: white;
  text-decoration: none;
  font-size: 0.8rem;
  line-height: 1;
  padding: 6px 4px;
  display: inline-block;
}

.navbar-links a:hover {
  color: #aac1e6;
}

@media (max-width: 560px) {
  .navbar-links {
    gap: 16px;
  }
  .navbar-links a {
    font-size: 0.8rem;
    padding: 6px 2px;
  }
}

/* Responsive Navbar */
@media (max-width: 450px) {
  .navbar-links {
    gap: 16px;
  }
  .navbar-links a {
    font-size: 0.7rem;
    padding: 6px 2px;
  }
}

@media (max-width: 400px) {
  .navbar-links {
    gap: 16px;
  }
  .navbar-links a {
    font-size: 0.6rem;
    padding: 6px 2px;
  }
}


@media (max-width: 360px) {
  .navbar-links {
    gap: 12px;
  }
  .navbar-links a {
    font-size: 0.575rem;
    padding: 6px 2px;
  }
}

/* Shared Button Styles */
button,
#submit-form,
.pythagbutton {
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
  font-family: "Outfit", sans-serif;
}

/* Converter Button */
.pythagbutton {
  display: block;
  margin: 20px auto;
  background-color: #cf3b33;
  color: white;
  padding: 12px;
  font-size: 14px;
}

.pythagbutton:hover {
  background: #a31e17;
  transform: translateY(-2px);
}

.pythagbutton:active {
  transform: translateY(0);
}

/* Submit Button */
.submit-form {
  display: block;
  width: 100%;
  padding: 10px;
  margin-top: 10px;
  font-size: 1rem;
  background: #000;
  color: white;
  font-weight: 500;
}

.submit-form:hover {
  background: #222;
  transform: translateY(-2px);
}

.submit-form:active {
  transform: translateY(0);
}

/* Form Container */
.contact-form {
  max-width: 600px;
  margin: 15px auto 10px;
  padding: 15px;
  background: #f9f9f9;
  border-radius: 15px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

/* Form Title */
.contact-form h2 {
  text-align: center;
  margin-bottom: 20px;
  font-size: 1.9rem;
  font-weight: 600;
  color: #222;
}

/* Input, Textarea & Select */
.form-control {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #ccc;
  border-radius: 10px;
  font-size: 1rem;
  background-color: #fff;
  transition: border 0.3s ease, box-shadow 0.3s ease;
}

textarea.form-control {
  resize: none;
}

/* Shared Focus Styles */
input[type='number']:focus,
textarea:focus,
.form-control:focus {
  border-color: #aac1e6;
  box-shadow: 0 0 0 3px rgba(170, 193, 230, 0.35);
  outline: none;
  font-size: 16px;
  /* Safari-specific fixes to prevent resizing on focus */
  -webkit-appearance: none;
  appearance: none;
  transform: translateZ(0);
}

/* Separate focus style for selects (handled in .unit-select:focus) */

/* Labels */
.form-label,
.input-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  color: #444;
}

/* Explanation Text */
.explanation {
  margin: 20px;
}

/* Input Container for Converters */
.input-container {
  max-width: 400px;
  margin: 20px auto;
  padding: 20px;
}

/* Input Groups */
.input-group {
  margin-bottom: 15px;
}

.input-group label {
  font-size: 16px;
  width: 80px;
}

/* Number Inputs */
input[type='number'] {
  width: 150px;
  padding: 8px 12px;
  border: 2px solid #ddd;
  border-radius: 8px;
  /* Safari-specific fixes to prevent resizing on focus */
  -webkit-appearance: none;
  appearance: none;
  font-size: 16px;
  transform: translateZ(0);
}

/* Result Text */
.result {
  margin-top: 20px;
  font-size: 1rem;
}

.conversion,
.input-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

/* Consistent width for select and input elements */
.unit-select,
.unit-input {
  width: 160px;
  padding: 10px;
  font-size: 16px; /* iOS Safari fix: prevent zoom */
  border-radius: 8px;
  border: 1px solid #ccc;
  font-family: "Outfit", sans-serif;
  box-sizing: border-box;
}

/* Enhanced dropdown styling */
.unit-select {
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 8px center;
  background-repeat: no-repeat;
  background-size: 16px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  pointer-events: auto;
  cursor: pointer;
  transition: border-color 0.3s ease, background-color 0.3s ease;
  -webkit-tap-highlight-color: transparent; /* Remove iOS tap highlight */
  padding-right: 32px;
  touch-action: manipulation;
}

.unit-select:hover {
  border-color: #aac1e6;
  background-color: #f8f9ff;
}

.unit-select:focus {
  border-color: #aac1e6;
  box-shadow: 0 0 0 3px rgba(170, 193, 230, 0.35);
  outline: none;
  background-color: #fff;
}

/* Style dropdown options */
.unit-select option {
  padding: 8px 12px;
  font-family: "Outfit", sans-serif;
  color: #333;
  background-color: #fff;
}

.unit-select option:hover {
  background-color: #f0f0f0;
}

.unit-input[disabled] {
  background-color: #f0f0f0;
  color: #666;
}

.to-label {
  font-size: 1rem;
  font-weight: 500;
  color: #333;
}

.button-wrapper {
  text-align: center;
  margin-top: 10px;
}

.convert-button:active {
  transform: translateY(0);
}

/* Hide number input steppers/spinners */
/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
input[type=number] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.exampleimage {
  display: block;
  margin: 20px auto 0;
}

.disclaimer {
  margin: 20px;
}

section {
  max-width: 1000px;
  margin: 20px auto 20px;
  background: #fff;
  padding-top: 20px;
  padding-left: 20px;
  padding-right: 20px;
  padding-bottom: 1px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

label {
  display: block;
  margin: 10px 0 5px;
  font-weight: bold;
}

select {
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 1rem;
  width: 100%;
  max-width: 200px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
}

th, td {
  text-align: center;
  padding: 8px;
  border: 1px solid #ccc;
}

th {
  background-color: #cf3b33;
  color: white;
}

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

@media (max-width: 600px) {
  table, th, td {
    font-size: 0.8rem;
  }
}
.card-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  padding: 20px;
}

/* Card link wrapper - makes entire card clickable */
.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.3s ease;
}

.card-link:hover {
  transform: translateY(-5px);
}

/* 🔹 Individual card styling */
.card {
  background: #fff;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  transition: 0.3s;
  border-radius: 5px;
  width: 300px;
  margin: 10px;
  cursor: pointer;
}

/* Hover effect */
.card:hover {
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

/* Inner content padding */
.container {
  padding: 16px;
}

/* Rounded image corners */
.card img {
  border-radius: 5px 5px 0 0;
}

/* Responsive Image */
.responsive-image {
  max-width: 100%;
  height: auto;
  display: block;
}