:root {
  /* Vibrant and modern colors */
  --bg-color: #f7fafc;
  --text-primary: #1a202c;
  --text-secondary: #4a5568;
  --accent-color: #3182ce;
  --accent-hover: #2b6cb0;
  --accent-light: #ebf8ff;
  --card-bg: #ffffff;
  
  /* Shadows and depths */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-btn: 0 4px 14px 0 rgba(49, 130, 206, 0.39);

  /* Typography */
  --font-family: 'Noto Sans KR', sans-serif;
  
  /* Border radius */
  --radius-md: 0.5rem;
  --radius-lg: 1rem;
  --radius-full: 9999px;
}

[data-theme="dark"] {
  --bg-color: #1a202c;
  --text-primary: #f7fafc;
  --text-secondary: #a0aec0;
  --accent-color: #63b3ed;
  --accent-hover: #4299e1;
  --accent-light: #2d3748;
  --card-bg: #2d3748;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
  --shadow-btn: 0 4px 14px 0 rgba(99, 179, 237, 0.39);
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  /* Subtle noise texture */
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.02'/%3E%3C/svg%3E");
}

.app-container {
  background-color: var(--card-bg);
  padding: 2.5rem 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 450px;
  text-align: center;
  margin: 1rem;
}

header {
  margin-bottom: 2rem;
}

.main-title {
  font-size: 2.5rem;
  font-weight: 900;
  margin: 0 0 0.5rem 0;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 0;
}

.actions {
  margin-bottom: 2.5rem;
}

.primary-btn {
  background-color: var(--accent-color);
  color: white;
  border: none;
  padding: 1rem 1.5rem;
  font-size: 1.125rem;
  font-weight: 700;
  font-family: var(--font-family);
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  transition: all 0.2s ease-in-out;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  justify-content: center;
}

.primary-btn:hover {
  background-color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(49, 130, 206, 0.5);
}

.primary-btn:active {
  transform: translateY(0);
}

.primary-btn .icon {
  width: 20px;
  height: 20px;
  transition: transform 0.2s ease;
}

.primary-btn:hover .icon {
  transform: translateX(4px);
}

.results {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Individual recommendation item */
.food-item {
  background-color: var(--accent-light);
  color: var(--text-primary);
  padding: 1rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 1.125rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: translateY(10px);
  animation: slideIn 0.3s ease forwards;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.3s ease;
}

.food-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  background-color: var(--accent-hover);
  color: white;
}

/* Staggered animation delays */
.food-item:nth-child(1) { animation-delay: 0.05s; }
.food-item:nth-child(2) { animation-delay: 0.1s; }
.food-item:nth-child(3) { animation-delay: 0.15s; }
.food-item:nth-child(4) { animation-delay: 0.2s; }
.food-item:nth-child(5) { animation-delay: 0.25s; }

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

/* Theme Toggle Button Styles */
.theme-toggle-wrapper {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.5rem;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background-color: var(--accent-light);
  color: var(--text-primary);
}

.icon-btn svg {
  width: 24px;
  height: 24px;
}

.icon-sun {
  display: none;
}

[data-theme="dark"] .icon-sun {
  display: block;
}

[data-theme="dark"] .icon-moon {
  display: none;
}

/* Smooth transitions for theme switch */
body, .app-container, .food-item {
  transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.modal.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.modal-content {
  background-color: var(--card-bg);
  padding: 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 400px;
  text-align: center;
  position: relative;
  transform: scale(1);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal.hidden .modal-content {
  transform: scale(0.9);
}

.close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.close-btn:hover {
  color: var(--text-primary);
}

.close-btn svg {
  width: 24px;
  height: 24px;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 1.5rem 0;
  color: var(--text-primary);
}

.image-container {
  width: 100%;
  aspect-ratio: 1 / 1;
  background-color: var(--bg-color);
  border-radius: var(--radius-md);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  position: relative;
}

.image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

.image-container img.hidden {
  opacity: 0;
}

.loader {
  position: absolute;
  color: var(--text-secondary);
  font-weight: 700;
}