/* Define CSS variables for light mode */
:root {
  --bg-color: #ffffff;
  --text-color: #333333;
  --accent-color: #4caf50;
  --input-bg: #f5f5f5;
  --input-border: #cccccc;
}

/* Dark mode variables */
body.dark-mode {
  --bg-color: #121212;
  --text-color: #e0e0e0;
  --accent-color: #81c784;
  --input-bg: #1e1e1e;
  --input-border: #333333;
}

/* Global reset and box-sizing */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Container centering */
.container {
  width: 90%;
  max-width: 500px;
  padding: 20px;
  text-align: center;
}

/* Header styling */
header {
  margin-bottom: 20px;
}

/* Dark/Light Mode Button fixed in top right */
#toggleMode {
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: var(--accent-color);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 5px;
  cursor: pointer;
  z-index: 1000;
  transition: filter 0.3s ease;
}

#toggleMode:hover {
  filter: brightness(90%);
}

/* Form container styling */
.form-container {
  background-color: var(--input-bg);
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Form step transitions */
.form-step {
  display: none;
  flex-direction: column;
  gap: 15px;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.form-step.active {
  display: flex;
  opacity: 1;
  transform: translateX(0);
}

/* Polished inputs and selects */
input[type="text"], textarea, select {
  width: 100%;
  padding: 10px;
  background-color: var(--bg-color);
  border: 1px solid var(--input-border);
  border-radius: 4px;
  font-size: 16px;
  color: var(--text-color); 
  transition: border-color 0.3s ease;
}

textarea {
  resize: both; 
  max-width: 100%; 
  max-height: 100%; 
  overflow: auto;
}

input[type="text"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent-color);
}

/* Button styling */
button {
  padding: 10px 20px;
  font-size: medium;
  color: white;
  background-color: var(--accent-color);
  border: 2px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

button:hover {
  filter: brightness(90%);
  border: 2px solid #4caf50;
  background: #4caf50;
  color: #ffffff;
}

button:active {
  transform: scale(0.98);
}

/* Output container styling */
.output-container {
  margin-top: 20px;
  padding: 20px;
  background-color: var(--input-bg);
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  text-align: center;
}

/* Loading spinner styles */
.loading-spinner {
  border: 6px solid #f3f3f3;
  border-top: 6px solid var(--accent-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  margin: 0 auto;
  animation: spin 2s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
