/* Modern variables and base styles */
:root {
  --primary-color: #e84342;
  --primary-light: rgba(232, 67, 66, 0.1);
  --secondary-color: #d63031;
  --accent-color: #ff7846;
  --danger-color: #ff4757;
  --success-color: #2ed573;
  --text-color: #fdfdfd;
  --light-text: rgba(253, 253, 253, 0.8);
  --lighter-text: rgba(253, 253, 253, 0.6);
  --background: #2d3436;
  --card-bg: rgba(0, 0, 0, 0.1);
  --border-radius: 12px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  --transition: all 0.3s ease;
  --font-family: 'Roboto', 'Segoe UI', Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--background);
  color: var(--text-color);
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* Header Styles */
.app-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.logo-container {
  display: inline-block;
  position: relative;
  margin-bottom: 0.5rem;
}

.logo-container h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
  letter-spacing: -0.5px;
}

.accent-line {
  height: 4px;
  width: 40%;
  background: var(--accent-color);
  margin: -5px auto 15px;
  border-radius: 4px;
}

.tagline {
  font-size: 1.2rem;
  color: var(--light-text);
  margin-bottom: 1.5rem;
}

.disclaimer-link-wrapper {
  font-size: 0.9rem;
  margin-left: 0.3rem;
}

.disclaimer-link-wrapper a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

.disclaimer-link-wrapper a:hover {
  text-decoration: underline;
  color: var(--secondary-color);
}

.language-selector {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 1rem 0;
}

.lang-btn {
  background: transparent;
  border: 1px solid var(--primary-light);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9rem;
}

.lang-btn.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.lang-btn:hover:not(.active) {
  background-color: var(--primary-light);
}

/* Card Styles */
.card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  margin-bottom: 2rem;
  transition: var(--transition);
}

.card:hover {
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
  transform: translateY(-5px);
}

/* Form Elements */
.form-group {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.form-group label {
  flex: 1;
  min-width: 200px;
  font-weight: 500;
  margin-right: 1rem;
}

.modern-input {
  padding: 0.8rem 1rem;
  border: 1px solid rgba(253, 253, 253, 0.2);
  border-radius: 8px;
  font-size: 1rem;
  width: 100px;
  transition: var(--transition);
  background-color: rgba(253, 253, 253, 0.05);
  color: var(--text-color);
}

.modern-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(232, 67, 66, 0.2);
  outline: none;
}

/* Toggle Switch */
.toggle-container {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  max-width: 300px; /* Constrain the total width */
}

.toggle-container label:first-child {
  flex: 0 0 auto; /* Don't grow, maintain natural width */
  min-width: auto; /* Remove the 200px minimum */
  max-width: 200px; /* Set a reasonable maximum */
  font-weight: 500;
  margin-right: 1rem;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  width: 50px; /* Use explicit width instead of right: 0 */
  height: 24px; /* Use explicit height instead of bottom: 0 */
  background-color: rgba(253, 253, 253, 0.3);
  transition: .4s;
  border-radius: 24px; /* Add border-radius here for consistency */
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
}

input:checked + .slider {
  background-color: var(--primary-color);
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--primary-color);
}

input:checked + .slider:before {
  transform: translateX(23px);
}

.slider.round {
  border-radius: 24px;
}

.slider.round:before {
  border-radius: 50%;
}

/* Button Styles */
.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
  justify-content: center;
}

.btn {
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: 150px;
}

.btn i {
  font-size: 1rem;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: darken(var(--primary-color), 10%);
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: var(--primary-light);
  color: var(--primary-color);
}

.btn-secondary:hover {
  background-color: darken(var(--primary-light), 5%);
}

.btn-danger {
  background-color: var(--danger-color);
  color: white;
}

.btn-danger:hover {
  background-color: darken(var(--danger-color), 10%);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Pulsing animation for call to action */
.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(232, 67, 66, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(232, 67, 66, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(232, 67, 66, 0);
  }
}

/* Body Visualization */
.body-visualization {
  display: flex;
  justify-content: center;
  margin: 1.5rem 0;
  min-height: 350px;
  max-width: 100%;
  overflow: hidden;
}

.body-visualization svg {
  max-height: 350px; /* Increased height */
  width: auto; /* Maintain aspect ratio */
}

/* SVG body styling */
.body-part {
  fill: rgba(253, 253, 253, 0.8);
  stroke: rgba(253, 253, 253, 0.6);
  stroke-width: 1;
  transition: fill 0.3s ease;
}

/* Active body part highlighting */
.body-part.active {
  fill: var(--primary-color);
  stroke: var(--secondary-color);
  stroke-width: 2;
  filter: drop-shadow(0 0 3px rgba(232, 67, 66, 0.6));
}

/* Make sure SVG content scales appropriately */
#body-container svg {
  max-width: 250px; /* Increased from 200px */
  height: auto; /* Maintain aspect ratio */
  display: block;
  margin: 0 auto;
}

/* Suggestion Container */
.suggestion-container {
  background-color: var(--primary-light);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-top: 1.5rem;
}

/* Footer */
.app-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(253, 253, 253, 0.1);
  flex-direction: column;
  gap: 1rem;
}

.footer-logo-link {
  display: block;
  transition: var(--transition);
}

.footer-logo-link:hover {
  transform: scale(1.05);
}

.footer-logo {
  max-width: 200px;
  height: auto;
  opacity: 0.8;
}

.footer-link {
  color: var(--light-text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.footer-link:hover {
  color: var(--primary-color);
}

.copyright {
  font-size: 0.9rem;
  color: var(--lighter-text);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
}

.modal-content {
  background-color: var(--card-bg);
  margin: 10% auto;
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  max-width: 700px;
  width: 90%;
  animation: modalFadeIn 0.3s;
}

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

.close {
  color: var(--light-text);
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover {
  color: var(--text-color);
}

/* Main content layout */
.main-content {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.timer-settings {
  flex: 0 0 350px; /* Fixed width for settings */
}

.body-display {
  flex: 1; /* Take remaining space */
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }
  
  .main-content {
    flex-direction: column;
  }
  
  .timer-settings {
    flex: none;
    width: 100%;
  }
  
  .form-group {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .form-group label {
    margin-bottom: 0.5rem;
  }
  
  .button-group {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
  }
}