body {
  padding-top: 1rem;
  padding-bottom: 2rem;
  font-family: 'Arial', sans-serif;
}

/* Loading screen styling */
#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #f8f9fa;
  z-index: 9999;
}

.spinner-border {
  width: 3rem;
  height: 3rem;
}

.screen {
  min-height: 80vh;
  padding: 1rem;
}

.form-range {
  cursor: pointer;
}

/* Make sure form labels stand out */
.form-label {
  font-weight: 500;
  margin-bottom: 0.5rem;
}

/* Improve spacing and readability */
.mb-4 {
  margin-bottom: 2rem !important;
}

/* Make cards more attractive */
.card {
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Make result values stand out */
.display-6 {
  font-weight: bold;
  color: #0d6efd;
}

/* Button styling */
.btn-primary {
  padding: 0.5rem 1.5rem;
}

/* Sound test button styling */
#test-sound {
  font-size: 0.85rem;
  padding: 0.3rem 0.7rem;
}

/* Display for selected activity in post-survey */
#post-q2-display {
  padding: 0.375rem 0.75rem;
  font-weight: 500;
  background-color: #f8f9fa;
}

/* Make the comparison sections visually distinct */
.border-top {
  border-top: 1px solid #dee2e6 !important;
  padding-top: 1.5rem;
}

.mt-4 {
  margin-top: 1.8rem !important;
}

/* Timer styling */
#timer-display {
  font-size: 3rem;
  font-weight: bold;
  color: #198754;
}

#timer-duration {
  max-width: 120px;
  margin: 0 auto 10px;
  text-align: center;
}

/* Login/Register styling */
#login-screen, #register-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  width: 100%;
}

/* Card styling for auth screens */
.screen .card {
  border-radius: 0.75rem;
  border: none;
}

.screen .card-body {
  padding: 2.5rem;
}

/* Form control styling */
.form-control-lg {
  font-size: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
}

.form-control-lg:focus {
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

.btn-lg {
  padding: 0.75rem 1rem;
  font-size: 1.1rem;
  border-radius: 0.5rem;
}

/* Shadow styling */
.shadow {
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.08) !important;
}

/* Form validation styling */
.form-control.is-invalid {
  border-color: #dc3545;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right calc(0.375em + 0.1875rem) center;
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-valid {
  border-color: #198754;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right calc(0.375em + 0.1875rem) center;
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* Email validation helper text */
.invalid-feedback {
  display: none;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  color: #dc3545;
}

.is-invalid ~ .invalid-feedback {
  display: block;
}

/* Mobile optimization */
@media (max-width: 576px) {
  h1 {
    font-size: 1.8rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  .display-6 {
    font-size: 1.5rem;
  }
  
  #timer-display {
    font-size: 2.5rem;
  }
  
  .screen .card-body {
    padding: 1.5rem;
  }
  
  /* Improve button spacing on mobile */
  .btn {
    margin-bottom: 0.5rem;
  }
  
  /* Better form control sizing on mobile */
  .form-control {
    font-size: 16px; /* Prevents iOS zoom on focus */
  }
}

/* Additional breakpoint for small phones */
@media (max-width: 400px) {
  .screen .card-body {
    padding: 1.25rem;
  }
  
  .form-control-lg, .btn-lg {
    font-size: 0.95rem;
    padding: 0.6rem 0.8rem;
  }
}

/* User info display styling */
#user-info {
  font-size: 0.9rem;
  color: #6c757d;
}

#user-email {
  font-weight: 500;
  max-width: 150px;
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

@media (max-width: 576px) {
  #user-email {
    max-width: 100px;
  }
}
