/* Adapted to match main site theme with purple gradient and cleaner design */
:root {
  --primary: #3498db;
  --primary-dark: #2980b9;
  --dark: #2c3e50;
  --light: #ecf0f1;
  --text: #34495e;
  --border: #e0e0e0;
  --shadow: rgba(0, 0, 0, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
  color: var(--text);
}

/* Added back button styles to match site theme */
.back-button {
  position: fixed;
  top: 20px;
  left: 20px;
  background: white;
  color: var(--primary);
  padding: 12px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s;
  z-index: 1000;
}

.back-button:hover {
  background: var(--primary);
  color: white;
  transform: translateX(-3px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.container {
  max-width: 700px;
  margin: 0 auto;
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  padding: 40px;
  animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h1 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 5px;
  color: var(--dark);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

h1 i {
  color: var(--primary);
}

.subtitle {
  text-align: center;
  color: #7f8c8d;
  margin-bottom: 30px;
  font-size: 1rem;
}

.card {
  background: #f8f9fa;
  padding: 25px;
  margin-top: 20px;
  border-radius: 12px;
  border: 2px solid var(--border);
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: 0 4px 12px var(--shadow);
}

.card h2 {
  color: var(--dark);
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card h2 i {
  color: var(--primary);
}

/* Added input-group for better spacing */
.input-group {
  margin-bottom: 20px;
}

.input-group:last-child {
  margin-bottom: 0;
}

label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.95rem;
  color: var(--dark);
  font-weight: 600;
}

input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 5px;
  background: linear-gradient(to right, var(--primary), var(--primary-dark));
  outline: none;
  -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  border: 3px solid var(--primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  border: 3px solid var(--primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

select {
  width: 100%;
  padding: 12px 15px;
  font-size: 1rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: white;
  color: var(--dark);
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

select:hover {
  border-color: var(--primary);
}

select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.value {
  text-align: center;
  margin-top: 8px;
  font-size: 1.1rem;
  color: var(--primary);
  font-weight: 600;
}

.results-card {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

/* Updated result-row styles */
.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.result-row:last-child {
  border-bottom: none;
}

.result-row span {
  color: #7f8c8d;
}

.result-row strong {
  color: var(--dark);
  font-size: 1.05rem;
}

.result-row.highlight {
  background: linear-gradient(135deg, #ffd54f 0%, #ffb300 100%);
  color: var(--dark);
  padding: 15px 20px;
  border-radius: 10px;
  margin-top: 15px;
  font-size: 1.1rem;
  font-weight: bold;
  border: none;
  box-shadow: 0 4px 12px rgba(255, 179, 0, 0.3);
}

.result-row.highlight span,
.result-row.highlight strong {
  color: var(--dark);
}

.result-row.weight {
  background: linear-gradient(135deg, #ff5252 0%, #e53935 100%);
  color: white;
  padding: 15px 20px;
  border-radius: 10px;
  margin-top: 15px;
  font-size: 1.1rem;
  font-weight: bold;
  border: none;
  box-shadow: 0 4px 12px rgba(229, 57, 53, 0.3);
}

.result-row.weight span,
.result-row.weight strong {
  color: white;
}

/* Added resistance row styles */
.result-row.resistance {
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  color: white;
  padding: 15px 20px;
  border-radius: 10px;
  margin-top: 15px;
  font-size: 1.1rem;
  font-weight: bold;
  border: none;
  box-shadow: 0 4px 12px rgba(41, 128, 185, 0.3);
}

.result-row.resistance span,
.result-row.resistance strong {
  color: white;
}

footer {
  text-align: center;
  padding-top: 25px;
  margin-top: 30px;
  border-top: 1px solid var(--border);
  color: #95a5a6;
  font-size: 0.9rem;
}

footer p {
  margin: 5px 0;
}

@media (max-width: 768px) {
  /* Made back button responsive */
  .back-button {
    position: static;
    margin-bottom: 15px;
    justify-content: center;
  }

  .container {
    padding: 25px;
  }

  h1 {
    font-size: 1.5rem;
  }

  .card {
    padding: 20px;
  }

  .card h2 {
    font-size: 1.2rem;
  }

  .result-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .result-row.highlight,
  .result-row.weight,
  .result-row.resistance {
    font-size: 1rem;
    padding: 12px 15px;
  }
}

/* Added toast notification styles for live save feedback */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: white;
  color: var(--dark);
  padding: 15px 25px;
  border-radius: 10px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  font-size: 0.95rem;
  font-weight: 500;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 4px solid var(--primary);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.success {
  border-left-color: #27ae60;
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
}

.toast.error {
  border-left-color: #e74c3c;
  background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
}

.toast.warning {
  border-left-color: #f39c12;
  background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
}

@media (max-width: 768px) {
  .toast {
    bottom: 20px;
    right: 20px;
    left: 20px;
    font-size: 0.9rem;
    padding: 12px 20px;
  }
}
