:root {
  --primary: #ff6b6b;
  --primary-dark: #ee5253;
  --secondary: #10ac84;
  --text-main: #2d3436;
  --text-muted: #636e72;
  --glass: rgba(255, 255, 255, 0.95);
  --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.08);
  --transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

body {
  font-family: "Poppins", sans-serif;
  background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 2.5rem;
  background: var(--glass);
  backdrop-filter: blur(10px);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
}

header {
  text-align: center;
  margin-bottom: 3rem;
}
h1 {
  font-size: 2.5rem;
  font-weight: 700;
}
h1 span {
  color: var(--primary);
}
.tagline {
  color: var(--text-muted);
  margin-top: 0.5rem;
}
.tagline a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.search-section {
  max-width: 600px;
  margin: 0 auto 2rem;
}
.search-container {
  display: flex;
  align-items: center;
  background: white;
  padding: 6px 6px 6px 20px;
  border-radius: 50px;
  box-shadow: var(--shadow-sm);
  border: 2px solid transparent;
}
.search-container:focus-within {
  border-color: var(--primary);
}

.placeholder-wrapper {
  position: relative;
  flex: 1;
  height: 45px;
  display: flex;
  align-items: center;
}
#search-input {
  width: 100%;
  border: none;
  outline: none;
  font-size: 1rem;
  font-family: inherit;
  z-index: 2;
  background: transparent;
}
#placeholder-overlay {
  position: absolute;
  color: var(--text-muted);
  pointer-events: none;
  transition: var(--transition);
}

button#search-btn {
  background: var(--primary);
  color: white;
  padding: 12px 28px;
  border-radius: 25px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}
button#search-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.meals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 2rem;
}
.meal {
  background: white;
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid #eee;
}
.meal:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}
.meal img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}
.meal-info {
  padding: 1.2rem;
}
.meal-category {
  color: var(--secondary);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

.details-view-content {
  max-width: 800px;
  margin: 0 auto;
  animation: fadeIn 0.4s ease-out;
}
.meal-details-img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 20px;
  margin: 1.5rem 0;
}
.back-btn {
  background: #f1f2f6;
  border: none;
  padding: 10px 20px;
  border-radius: 50px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  margin-bottom: 1rem;
}
#result-heading h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text-main);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.exit-up {
  transform: translateY(-20px);
  opacity: 0;
}
.force-hidden {
  display: none;
}

@media (max-width: 600px) {
  .container {
    margin: 1rem auto;

    width: 92%;

    padding: 1.5rem 1rem;

    border-radius: 16px;
  }

  h1 {
    font-size: 1.8rem;
  }

  .search-container {
    padding: 4px 4px 4px 15px;
  }

  button#search-btn {
    padding: 10px 15px;
    font-size: 0.9rem;
  }
  #result-heading h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
  }
  @media (max-width: 600px) {
    .details-view {
      padding: 0;
      margin-top: 1rem;
    }

    .details-view-content {
      width: 100%;
      max-width: 100%;
      min-height: 80vh;
      padding: 10px;
    }

    .meal-details-img {
      width: 100%;
      height: 240px;
      object-fit: cover;
      margin: 1rem 0;
      border-radius: 12px;
    }

    .details-view-content h1 {
      font-size: 1.4rem;
      line-height: 1.2;
    }
  }
}
