@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --secondary: #f59e0b;
  --accent: #ec4899;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-accent: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  
  --radius: 0.5rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: var(--gray-800);
  overflow-x: hidden;
}

/* Navigation */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--gray-200);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--gray-600);
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
  background: var(--gray-100);
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 6rem 2rem 2rem;
}

/* Hero Section */
.hero-section {
  position: relative;
  text-align: center;
  padding: 4rem 0 6rem;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  color: white;
}

.gradient-text {
  background: linear-gradient(135deg, #fbbf24, #f59e0b, #d97706);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 3rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Search Container */
.search-container {
  max-width: 700px;
  margin: 0 auto;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: white;
  border-radius: var(--radius-xl);
  padding: 0.5rem;
  box-shadow: var(--shadow-xl);
  margin-bottom: 1.5rem;
}

.search-icon {
  position: absolute;
  left: 1.5rem;
  color: var(--gray-400);
  font-size: 1.25rem;
  z-index: 1;
}

.search-control {
  flex: 1;
  border: none;
  outline: none;
  padding: 1rem 1rem 1rem 3.5rem;
  font-size: 1.1rem;
  background: transparent;
  color: var(--gray-700);
}

.search-control::placeholder {
  color: var(--gray-400);
}

.search-btn {
  background: var(--gradient-primary);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: var(--radius-lg);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.search-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.search-suggestions {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.suggestion-label {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}

.suggestion-tag {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  backdrop-filter: blur(10px);
}

.suggestion-tag:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

/* Floating Cards */
.floating-cards { 
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.floating-card {
  position: absolute;
  background: var(--gradient-primary);
  padding: 1rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
 
  font-weight: 600;
  color: var(--gray-100);
  animation: float 2s ease-in-out infinite;
}

.floating-card img {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  object-fit: cover;
}

.card-1 {
  top: 20%;
  animation-delay: 0s;
}

.card-2 {
  top: 35%;
  right: 1%;
  animation-delay: 2s;
}

.card-3 {
  bottom: 20%;
  left: 5%;
  animation-delay: 4s;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}

/* Results Section */
.results-section {
  background: white;
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-xl);
  margin-top: 2rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.title {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--gray-800);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.title i {
  color: var(--primary);
}

.results-filter {
  display: flex;
  gap: 0.5rem;
}

.filter-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--gray-300);
  background: white;
  color: var(--gray-600);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Loading Animation */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  padding: 4rem 2rem;
}

.loading-animation {
  position: relative;
}

.cooking-pot {
  font-size: 3rem;
  color: var(--primary);
  animation: bounce 2s infinite;
}

.loading-dots {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.loading-dots span {
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

.loading-text {
  font-size: 1.125rem;
  color: var(--gray-600);
  font-weight: 500;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* Recipe Grid */
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

.meal-item {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid var(--gray-200);
}

.meal-item:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
}

.meal-img {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.meal-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.meal-item:hover .meal-img img {
  transform: scale(1.1);
}

.meal-name {
  padding: 1.5rem;
}

.meal-name h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 1rem;
  line-height: 1.4;
}

.recipe-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--gradient-primary);
  color: white;
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  transition: var(--transition);
  font-size: 0.875rem;
}

.recipe-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Recipe Modal */
.recipe-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  display: none;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
}

.meal-details {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
}

.meal-details::-webkit-scrollbar {
  width: 6px;
}

.meal-details::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 3px;
}

.showRecipe {
  display: block;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translate(-50%, -60%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

.recipe-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--gray-100);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  z-index: 1;
}

.recipe-close-btn:hover {
  background: var(--gray-200);
  transform: scale(1.1);
}

.meal-details-content {
  padding: 2rem;
}

.recipe-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 1rem;
}

.recipe-category {
  display: inline-block;
  background: var(--gradient-primary);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-weight: 600;
  margin-bottom: 2rem;
}

.recipe-instruct {
  margin: 2rem 0;
}

.recipe-instruct h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 1rem;
}

.recipe-instruct p {
  line-height: 1.7;
  color: var(--gray-600);
  margin-bottom: 1rem;
}

.recipe-ingredients {
  margin: 2rem 0;
}

.recipe-ingredients h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 1rem;
}

.recipe-ingredients ul {
  list-style: none;
  display: grid;
  gap: 0.5rem;
}

.recipe-ingredients li {
  background: var(--gray-50);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border-left: 4px solid var(--primary);
  color: var(--gray-700);
}

.recipe-meal-img {
  text-align: center;
  margin: 2rem 0;
}

.recipe-meal-img img {
  width: 200px;
  height: 200px;
  border-radius: 20%;
  object-fit: cover;
  border: 4px solid var(--gray-400);
}

.recipe-link {
  text-align: center;
  margin: 2rem 0;
}

.recipe-link a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--gradient-secondary);
  color: white;
  text-decoration: none;
  padding: 1rem 2rem;
  border-radius: var(--radius);
  font-weight: 600;
  transition: var(--transition);
}

.recipe-link a:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.notFound {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  color: var(--gray-600);
  font-size: 1.125rem;
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  border: 2px dashed var(--gray-300);
}

/* Background Elements */
.bg-elements {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: -1;
}

.bg-circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  animation: float 8s ease-in-out infinite;
}

.circle-1 {
  width: 200px;
  height: 200px;
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}

.circle-2 {
  width: 150px;
  height: 150px;
  top: 60%;
  right: 10%;
  animation-delay: 3s;
}

.circle-3 {
  width: 100px;
  height: 100px;
  bottom: 20%;
  left: 20%;
  animation-delay: 6s;
}

/* Responsive Design */
@media (max-width: 768px) {
  .nav-container {
    padding: 1rem;
  }
  
  .nav-links {
    gap: 1rem;
  }
  
  .nav-link span {
    display: none;
  }
  
  .container {
    padding: 5rem 1rem 2rem;
  }
  
  .hero-section {
    padding: 2rem 0 4rem;
  }
  
  .search-wrapper {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }
  
  .search-control {
    padding: 1rem;
    text-align: center;
  }
  
  .search-icon {
    display: none;
  }
  
  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .recipe-grid {
    grid-template-columns: 1fr;
  }
  
  .floating-cards {
    display: none;
  }
  
  .meal-details {
    width: 95%;
    max-height: 95vh;
  }
  
  .meal-details-content {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2rem;
  }
  
  .search-suggestions {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .results-section {
    padding: 1rem;
    margin-top: 1rem;
  }
}
