:root {
  --primary-color: #2c3e50;
  --secondary-color: #3498db;
  --hover-color: #2980b9;
  --background-light: #f0f2f5;
  --background-dark: #e0e2e5;
  --card-background: #ffffff;
  --text-color: #333333;
  --heading-color: #2c3e50;
  --border-color: #e0e0e0;
  --success-color: #28a745;
  --success-hover: #218838;
  --clear-color: #6c757d;
  --clear-hover: #5a6268;
}

body {
  font-family: 'Inter', sans-serif; /* Modern font */
  padding: 2rem 1rem;
  background: linear-gradient(135deg, var(--background-light) 0%, var(--background-dark) 100%); /* Subtle gradient */
  min-height: 100vh;
  color: var(--text-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.container {
  max-width: 800px;
  background: var(--card-background);
  border-radius: 20px; /* More rounded corners */
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); /* Softer, larger shadow */
  padding: 2.5rem; /* Increased padding */
  margin-top: 2rem;
  margin-bottom: 2rem;
  width: 100%;
}

h1 {
  color: var(--heading-color);
  font-weight: 700;
  text-align: center;
  margin-bottom: 2.5rem !important; /* More space below heading */
  font-size: 2.5rem;
}

.input-group {
  margin-bottom: 1.5rem;
}

.form-control {
  border-radius: 10px; /* Rounded input fields */
  border: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  transition: all 0.3s ease;
}

.form-control:focus {
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 0.25rem rgba(52, 152, 219, 0.25); /* Bootstrap-like focus */
}

.button-group {
  margin-bottom: 2rem; /* Space below button group */
}

.btn {
  border-radius: 10px; /* Rounded buttons */
  padding: 0.75rem 1.5rem;
  transition: all 0.3s ease; /* Smooth transitions for all buttons */
  font-weight: 600;
}

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

.btn-primary:hover {
  background-color: var(--hover-color);
  transform: translateY(-2px); /* More pronounced hover effect */
  box-shadow: 0 4px 10px rgba(52, 152, 219, 0.3);
}

.btn-success {
  background-color: var(--success-color);
  border: none;
}

.btn-success:hover {
  background-color: var(--success-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(40, 167, 69, 0.3);
}

.btn-outline-secondary {
  color: var(--clear-color);
  border-color: var(--clear-color);
}

.btn-outline-secondary:hover {
  background-color: var(--clear-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(108, 117, 125, 0.3);
}

.result-box {
  background: var(--background-light); /* Lighter background for result box */
  border-radius: 15px; /* Consistent rounding */
  border: 1px solid var(--border-color);
  margin-top: 2rem; /* More space above */
  padding: 1.5rem;
  animation: fadeIn 0.6s ease-out; /* Slightly longer, smoother animation */
}

#output {
  min-height: 120px; /* Slightly taller output */
  background-color: var(--card-background); /* White background for output text */
  border: 1px solid var(--border-color);
}

.audio-controls {
  display: flex;
  gap: 1.5rem; /* More space between controls */
  align-items: center;
  margin-top: 1.5rem;
}

audio {
  flex-grow: 1;
  max-width: 400px;
}

@media (max-width: 768px) {
  .container {
    padding: 1.5rem;
  }

  .audio-controls {
    flex-direction: column;
    align-items: stretch;
  }

  audio {
    width: 100%;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px); /* Fade in from slightly lower */
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.loading {
  position: relative;
  pointer-events: none;
}

.loading::after {
  content: "";
  position: absolute;
  right: 1rem;
  top: 50%;
  width: 1.25rem;
  height: 1.25rem;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  transform: translateY(-50%);
}

@keyframes spin {
  to {
    transform: translateY(-50%) rotate(360deg);
  }
}

.footer {
  background-color: rgba(255, 255, 255, 0.8); /* Lighter, more modern footer background */
  backdrop-filter: blur(8px); /* Stronger blur effect */
  position: relative;
  z-index: 100;
  width: 100%;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05); /* Subtle shadow above footer */
}

.footer .container {
  padding: 1rem;
  max-width: 800px;
  background: transparent; /* Remove background from footer container */
  box-shadow: none; /* Remove shadow from footer container */
  margin: 0 auto; /* Center footer content */
}

.footer .d-flex {
  gap: 1.5rem !important; /* More space in footer links */
}

@media (max-width: 768px) {
  .footer .d-flex {
    flex-direction: column;
    gap: 0.75rem !important;
  }

  .footer span.separator {
    display: none;
  }

  .footer a {
    width: 100%;
    justify-content: center;
    padding: 0.75rem;
    border-radius: 8px;
    background-color: rgba(240, 242, 245, 0.9); /* Match body background */
  }
}

/* Custom styles for icons and text within buttons/links */
.btn i, .link-primary i, .link-success i {
  margin-right: 0.5rem;
}

.link-primary {
  color: var(--secondary-color) !important;
}

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

.link-success {
  color: var(--success-color) !important;
}

.link-success:hover {
  color: var(--success-hover) !important;
}
