:root {
  --bg-color: #f8f9fa;
  --text-color: #333;
  --primary-color: #ff6b6b;
  --secondary-color: #4ecdc4;
  --card-bg: #ffffff;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  --header-height: 70px;
  --border-radius: 20px;
}

[data-theme='dark'] {
  --bg-color: #1a1a1a;
  --text-color: #f8f9fa;
  --primary-color: #ff8787;
  --secondary-color: #63e6be;
  --card-bg: #2d2d2d;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

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

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.7;
  transition: background-color 0.3s, color 0.3s;
  overflow-x: hidden;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Navigation */
.main-nav {
  height: var(--header-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background-color: var(--bg-color);
  z-index: 1000;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary-color);
}

.main-nav ul {
  display: flex;
  list-style: none;
  gap: 1.5rem;
}

.main-nav a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 600;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.main-nav a:hover {
  color: var(--primary-color);
}

#theme-toggle {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: bold;
  cursor: pointer;
  font-size: 0.8rem;
}

/* Hero Section */
.hero {
  padding: 100px 0 60px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2.2rem, 6vw, 4rem);
  margin-bottom: 1.5rem;
  line-height: 1.2;
  font-weight: 800;
}

.hero p {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  opacity: 0.8;
  max-width: 700px;
  margin: 0 auto;
}

/* Sections General */
section {
  padding: 80px 0;
  width: 100%;
}

h2 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
  font-weight: 800;
}

.section-desc {
  text-align: center;
  margin-bottom: 4rem;
  opacity: 0.7;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  font-size: 1.1rem;
}

/* Recommend Card */
.recommend-section .card {
  background: var(--card-bg);
  padding: 60px 40px;
  border-radius: 30px;
  box-shadow: var(--shadow);
  text-align: center;
  max-width: 550px;
  margin: 0 auto;
}

#menu-display {
  margin-bottom: 30px;
}

.emoji {
  font-size: 5rem;
  display: block;
  margin-bottom: 15px;
}

#menu-name {
  font-size: 2.2rem;
  color: var(--primary-color);
  font-weight: 800;
}

/* Menu Grid Explorer */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2rem;
}

.menu-card {
  background: var(--card-bg);
  padding: 30px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.menu-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.menu-card-header {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 1.2rem;
}

.card-emoji {
  font-size: 2.5rem;
}

.menu-card h3 {
  font-size: 1.5rem;
  font-weight: 700;
}

.menu-desc {
  font-weight: 700;
  margin-bottom: 1.2rem;
  color: var(--primary-color);
  font-size: 1.05rem;
}

.menu-details {
  font-size: 0.95rem;
  opacity: 0.9;
  border-top: 1px solid rgba(0,0,0,0.08);
  padding-top: 1.2rem;
  margin-top: auto;
}

.menu-details p {
  margin-bottom: 0.8rem;
}

/* Knowledge Section */
.knowledge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.knowledge-card {
  background: var(--card-bg);
  padding: 35px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  border-left: 5px solid var(--secondary-color);
}

.knowledge-card h3 {
  margin-bottom: 1rem;
  font-size: 1.3rem;
  color: var(--secondary-color);
}

/* About Section */
.info-section {
  background-color: var(--card-bg);
  border-radius: 30px;
  margin: 60px 0;
  padding: 80px 40px;
  box-shadow: var(--shadow);
}

.info-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.info-content p {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  opacity: 0.9;
}

/* Buttons */
.main-btn, .submit-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 18px 36px;
  border-radius: 15px;
  font-size: 1.2rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}

.main-btn:hover, .submit-btn:hover {
  opacity: 0.9;
  transform: scale(1.03);
}

/* Contact Form */
.contact-section form {
  max-width: 600px;
  margin: 0 auto;
  background: var(--card-bg);
  padding: 40px;
  border-radius: 25px;
  box-shadow: var(--shadow);
}

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

label {
  display: block;
  margin-bottom: 10px;
  font-weight: 700;
  font-size: 0.95rem;
}

input, textarea {
  width: 100%;
  padding: 14px;
  border: 2px solid rgba(0,0,0,0.05);
  border-radius: 10px;
  background: var(--bg-color);
  color: var(--text-color);
  font-size: 1rem;
  transition: border-color 0.2s;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* Footer */
footer {
  padding: 80px 0;
  text-align: center;
  border-top: 1px solid rgba(0,0,0,0.05);
  opacity: 0.8;
}

.footer-links {
  margin-top: 20px;
}

.footer-links a {
  margin: 0 15px;
  text-decoration: none;
  color: var(--text-color);
  font-size: 0.9rem;
  opacity: 0.7;
  font-weight: 600;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.6);
  backdrop-filter: blur(5px);
}

.modal-content {
  background-color: var(--card-bg);
  margin: 5% auto;
  padding: 40px;
  border-radius: 24px;
  width: 90%;
  max-width: 600px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.close {
  position: absolute;
  right: 20px;
  top: 15px;
  font-size: 24px;
  cursor: pointer;
  opacity: 0.5;
}

/* Result Modal Specific */
.result-card {
  max-width: 700px;
  text-align: left;
}

.result-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 15px;
}

.large-emoji {
  font-size: 4rem;
}

.result-section {
  margin-bottom: 25px;
}

.result-section h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: var(--primary-color);
}

.nutrient-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  list-style: none;
}

.nutrient-list li {
  background: var(--bg-color);
  padding: 10px;
  border-radius: 10px;
  font-size: 0.95rem;
}

/* Animation */
@keyframes popIn {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.pop-animation {
  animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .main-nav ul {
    display: none;
  }
  .hero h1 {
    font-size: 2.5rem;
  }
  .nutrient-list {
    grid-template-columns: 1fr;
  }
}
