/* style.css - Modern professional design */
:root {
  --primary-color: #ff6b6b;
  --primary-dark: #ee5253;
  --secondary-color: #48dbfb;
  --success-color: #1dd1a1;
  --danger-color: #ff6b81;
  --text-color: #2f3542;
  --light-text: #57606f;
  --border-color: #dfe4ea;
  --background-light: #f1f2f6;
  --box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  --transition: all 0.3s ease;
  --card-bg: #ffffff;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--background-light);
  color: var(--text-color);
  line-height: 1.6;
  background-image: linear-gradient(45deg, #f8f9fa 25%, transparent 25%), 
                    linear-gradient(-45deg, #f8f9fa 25%, transparent 25%), 
                    linear-gradient(45deg, transparent 75%, #f8f9fa 75%), 
                    linear-gradient(-45deg, transparent 75%, #f8f9fa 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.container {
  width: 92%;
  max-width: 700px;
  margin: 40px auto;
  background: var(--card-bg);
  border-radius: 16px;
  padding: 35px;
  box-shadow: var(--box-shadow);
  position: relative;
  overflow: hidden;
}

.container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 25px;
  font-size: 32px;
  color: var(--primary-color);
  font-weight: 700;
  gap: 10px;
}

.logo i {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 38px;
}

h1 {
  text-align: center;
  color: var(--text-color);
  margin-bottom: 30px;
  font-weight: 600;
  font-size: 28px;
}

h2 {
  color: var(--primary-color);
  margin-bottom: 25px;
  font-weight: 500;
  font-size: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
}

h2 i {
  color: var(--primary-color);
}

.form-step {
  display: none;
  opacity: 0;
  transform: translateY(15px);
  transition: var(--transition);
}

.form-step.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
  animation: fadeSlideIn 0.5s ease;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.input-group {
  margin: 25px 0;
}

.input-group label {
  display: block;
  margin-bottom: 10px;
  font-weight: 500;
  color: var(--text-color);
}

.radio-group, .checkbox-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 15px;
  margin-bottom: 15px;
}

.ingredient-options label, .diet-options label {
  display: flex;
  align-items: center;
  padding: 15px;
  background-color: #fff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  transition: var(--transition);
  cursor: pointer;
  font-weight: normal;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.ingredient-options span, .diet-options span {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.ingredient-options i, .diet-options i {
  color: var(--primary-color);
  font-size: 18px;
}

.ingredient-options label:hover, .diet-options label:hover {
  background-color: rgba(255, 107, 107, 0.05);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.radio-group input[type="radio"]:checked + span,
.checkbox-group input[type="checkbox"]:checked + span {
  color: var(--primary-color);
  font-weight: 500;
}

.radio-group input[type="radio"]:checked + span i,
.checkbox-group input[type="checkbox"]:checked + span i {
  color: var(--primary-dark);
}

.radio-group input[type="radio"],
.checkbox-group input[type="checkbox"] {
  margin-right: 10px;
  cursor: pointer;
  accent-color: var(--primary-color);
  width: 18px;
  height: 18px;
}

select, input[type="number"], input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  font-size: 16px;
  color: var(--text-color);
  background-color: #fff;
  transition: var(--transition);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
  -webkit-appearance: none;
  appearance: none;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ff6b6b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 16px;
  padding-right: 45px;
}

select:focus, input[type="number"]:focus, input[type="text"]:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.2);
}

.slider-container {
  margin: 15px 0 30px;
}

.slider-container .slider {
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  background: #e0e0e0;
  border-radius: 5px;
  outline: none;
}

.slider-container .slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  border: 2px solid #fff;
}

.slider-container .slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.slider-value {
  text-align: center;
  margin-top: 10px;
  font-weight: 600;
  color: var(--primary-color);
  font-size: 18px;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  color: var(--light-text);
  font-size: 14px;
}

.button-group {
  display: flex;
  justify-content: space-between;
  margin-top: 35px;
}

button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 14px 28px;
  font-size: 16px;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

button:hover {
  background-color: var(--primary-dark);
  box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
  transform: translateY(-2px);
}

button:active {
  transform: translateY(0);
}

.prev-btn {
  background-color: white;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.prev-btn:hover {
  background-color: rgba(255, 107, 107, 0.05);
  box-shadow: 0 5px 15px rgba(255, 107, 107, 0.1);
}

.submit-btn {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.submit-btn:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
}

.error-message {
  color: var(--danger-color);
  font-size: 14px;
  margin-top: 8px;
  display: none;
  font-weight: 500;
}

select.error,
input.error {
  border-color: var(--danger-color) !important;
  background-color: rgba(255, 107, 129, 0.05);
}

input.error + .error-message,
select.error ~ .error-message {
  display: block;
  animation: shake 0.82s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* Progress indicator */
.progress-container {
  margin: 0 auto 40px;
  max-width: 400px;
}

.progress-bar {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin-bottom: 30px;
  max-width: 100%;
}

.progress-bar::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  height: 4px;
  width: 100%;
  background-color: var(--border-color);
  z-index: 0;
  border-radius: 4px;
}

.progress-bar .progress {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  height: 4px;
  width: 0;
  background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
  z-index: 1;
  transition: width 0.3s ease;
  border-radius: 4px;
}

.step-indicator {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background-color: white;
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  position: relative;
  z-index: 2;
  transition: var(--transition);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.step-indicator.active {
  border-color: var(--primary-color);
  background-color: var(--primary-color);
  color: white;
  box-shadow: 0 0 0 5px rgba(255, 107, 107, 0.2);
}

.step-indicator.completed {
  border-color: var(--primary-color);
  background-color: var(--primary-color);
  color: white;
}

/* Recipe results styles */
.recipe-card {
  border: none;
  margin: 25px 0;
  padding: 25px;
  border-radius: 16px;
  background: white;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.recipe-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
}

.recipe-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.recipe-card h2 {
  margin: 0 0 15px;
  color: var(--text-color);
  font-size: 24px;
  padding-left: 15px;
}

.recipe-card p {
  margin: 15px 0;
  color: var(--light-text);
  line-height: 1.7;
  font-size: 16px;
  padding-left: 15px;
}

.recipe-card a {
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  margin-top: 15px;
  transition: var(--transition);
  padding-left: 15px;
  position: relative;
}

.recipe-card a::after {
  content: "→";
  margin-left: 8px;
  transition: transform 0.3s ease;
  display: inline-block;
}

.recipe-card a:hover {
  color: var(--primary-dark);
}

.recipe-card a:hover::after {
  transform: translateX(5px);
}

/* Loading spinner */
.spinner {
  display: none;
  margin: 30px auto;
  text-align: center;
}

.spinner p {
  margin-bottom: 20px;
  color: var(--primary-color);
  font-weight: 500;
  font-size: 18px;
}

.spinner.visible {
  display: block;
}

.spinner .dots {
  display: inline-block;
  position: relative;
  width: 80px;
  height: 30px;
}

.spinner .dots div {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary-color);
  animation: spinner 1.2s linear infinite;
}

.spinner .dots div:nth-child(1) {
  top: 6px;
  left: 8px;
  animation-delay: 0s;
}

.spinner .dots div:nth-child(2) {
  top: 6px;
  left: 32px;
  animation-delay: -0.4s;
}

.spinner .dots div:nth-child(3) {
  top: 6px;
  left: 56px;
  animation-delay: -0.8s;
}

@keyframes spinner {
  0%, 100% {
    opacity: 1;
    transform: scale(1.2);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.8);
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .container {
    width: 95%;
    padding: 25px;
    margin: 20px auto;
    border-radius: 20px;
  }
  
  h1 {
    font-size: 24px;
  }
  
  h2 {
    font-size: 20px;
  }
  
  button {
    padding: 12px 22px;
    font-size: 15px;
  }
  
  .radio-group, .checkbox-group {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .container {
    width: 100%;
    border-radius: 0;
    margin: 0;
    min-height: 100vh;
    padding: 20px;
  }
  
  .button-group {
    flex-direction: column-reverse;
    gap: 15px;
  }
  
  button {
    width: 100%;
    justify-content: center;
  }
  
  .progress-container {
    max-width: 90%;
  }
  
  .step-indicator {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }
/* Additional styles for the results page */

.search-summary {
  margin: 30px 0;
}

.summary-card {
  background-color: rgba(72, 219, 251, 0.1);
  border-radius: 12px;
  padding: 20px;
  border-left: 4px solid var(--secondary-color);
}

.summary-card h3 {
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
  font-size: 18px;
}

.summary-card h3 i {
  color: var(--secondary-color);
}

.summary-card ul {
  list-style: none;
  padding: 0;
}

.summary-card li {
  margin: 8px 0;
  color: var(--light-text);
}

.summary-card li strong {
  color: var(--text-color);
  margin-right: 5px;
}

.results-count {
  margin: 20px 0;
  text-align: center;
  color: var(--light-text);
  font-size: 16px;
}

.recipe-card {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.recipe-card.animated {
  opacity: 1;
  transform: translateY(0);
}

.recipe-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin: 15px 0;
  padding-left: 15px;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--light-text);
  background-color: var(--background-light);
  padding: 5px 10px;
  border-radius: 20px;
}

.meta-item i {
  color: var(--primary-color);
}

.view-recipe {
  display: inline-block;
  padding: 10px 20px;
  background-color: var(--primary-color);
  color: white !important;
  border-radius: 30px;
  font-weight: 500;
  text-decoration: none;
  margin-top: 15px;
  margin-left: 15px;
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.2);
  transition: all 0.3s ease;
}

.view-recipe::after {
  content: "\f061";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  margin-left: 8px;
  transition: transform 0.3s ease;
  display: inline-block;
}

.view-recipe:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.3);
  color: white;
}

.view-recipe:hover::after {
  transform: translateX(5px);
}

.no-results {
  text-align: center;
  margin: 40px 0;
}

.no-results-card {
  background-color: white;
  border-radius: 16px;
  padding: 30px;
  box-shadow: var(--box-shadow);
}

.no-results i {
  font-size: 48px;
  color: var(--light-text);
  margin-bottom: 20px;
}

.no-results h3 {
  font-size: 24px;
  color: var(--text-color);
  margin-bottom: 15px;
}

.no-results p {
  color: var(--light-text);
}

.error-card {
  background-color: rgba(234, 67, 53, 0.1);
  border-radius: 12px;
  padding: 30px;
  text-align: center;
}

.error-card i {
  font-size: 48px;
  color: var(--danger-color);
  margin-bottom: 20px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background-color: var(--secondary-color);
  color: white;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.back-btn:hover {
  background-color: #20c4f4;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(72, 219, 251, 0.3);
}

.footer {
  margin-top: 50px;
  text-align: center;
  color: var(--light-text);
  font-size: 14px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}