/* ============================================
   Global Styles & Reset
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  background-color: #fdf2f8;
  color: #1f2937;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ============================================
   Color Variables & Utilities
   ============================================ */
:root {
  --pink-50: #fdf2f8;
  --pink-100: #fce7f3;
  --pink-200: #fbcfe8;
  --pink-300: #f9a8d4;
  --pink-400: #f472b6;
  --pink-500: #ec4899;
  --pink-600: #db2777;
  --rose-400: #fb7185;
  --rose-500: #f43f5e;
  --rose-600: #e11d48;
  --green-400: #4ade80;
  --green-500: #22c55e;
  --red-400: #f87171;
  --red-500: #ef4444;
}

/* ============================================
   Section Management
   ============================================ */
.section {
  display: none;
  min-height: 100vh;
}

.section.active {
  display: block;
}

/* ============================================
   Navbar Styles
   ============================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  padding: 1rem 2rem;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.navbar-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--rose-600);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.3s;
}

.logo:hover {
  color: var(--rose-500);
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: #374151;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
  cursor: pointer;
}

.nav-links a:hover {
  color: var(--rose-600);
}

/* ============================================
   Home Section Styles
   ============================================ */
.home-section {
  padding-top: 80px;
}

/* Hero Area */
.hero {
  position: relative;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('https://images.unsplash.com/photo-1556228578-0d85b1a4d571?w=1920&q=80');
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(251, 113, 133, 0.8), rgba(244, 63, 94, 0.6));
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  width: 100%;
  padding: 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.hero-text {
  color: white;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: bold;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
  font-size: 1.5rem;
  color: #fce7f3;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

/* Form Card */
.form-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 1.5rem;
  padding: 2rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.form-card h2 {
  font-size: 1.75rem;
  font-weight: bold;
  color: #1f2937;
  margin-bottom: 1.5rem;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid var(--pink-200);
  margin-bottom: 1.5rem;
}

.tab {
  padding: 0.75rem 1.5rem;
  background: none;
  border: none;
  font-size: 1rem;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.3s;
}

.tab.active {
  color: var(--rose-600);
  border-bottom-color: var(--rose-600);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.textarea-input {
  width: 100%;
  min-height: 120px;
  padding: 1rem;
  border: 2px solid var(--pink-200);
  border-radius: 0.75rem;
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.3s;
}

.textarea-input:focus {
  outline: none;
  border-color: var(--rose-500);
}

.photo-upload-area {
  border: 2px dashed var(--pink-300);
  border-radius: 0.75rem;
  padding: 3rem;
  text-align: center;
  background: var(--pink-50);
}

.photo-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.upload-btn {
  padding: 0.75rem 2rem;
  background: #d1d5db;
  color: #6b7280;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: not-allowed;
}

.analyze-btn {
  width: 100%;
  padding: 1rem;
  background: var(--rose-500);
  color: white;
  border: none;
  border-radius: 0.75rem;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 1.5rem;
  transition: background 0.3s;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.analyze-btn:hover {
  background: var(--rose-600);
}

.analyze-btn:disabled {
  background: #d1d5db;
  cursor: not-allowed;
}

/* ============================================
   Features Section Styles
   ============================================ */
.features-section {
  padding: 4rem 2rem;
  background: var(--pink-50);
}

.features-container {
  max-width: 1200px;
  margin: 0 auto;
}

.features-title {
  text-align: center;
  font-size: 2.5rem;
  font-weight: bold;
  color: #1f2937;
  margin-bottom: 3rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.feature-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 1.5rem;
  padding: 2rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.feature-title {
  font-size: 1.5rem;
  font-weight: bold;
  color: #1f2937;
  margin-bottom: 1rem;
}

.feature-description {
  color: #4b5563;
  line-height: 1.6;
}

/* ============================================
   Footer Styles
   ============================================ */
.footer {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--pink-200);
  padding: 2rem;
  margin-top: 2rem;
}

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

.footer-text {
  color: #4b5563;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.footer-subtext {
  color: #6b7280;
  font-size: 0.75rem;
}

/* ============================================
   Result Section Styles
   ============================================ */
.result-section {
  padding: 100px 2rem 2rem;
  background: var(--pink-50);
}

.result-container {
  max-width: 900px;
  margin: 0 auto;
}

.ingredients-display {
  margin-bottom: 2rem;
}

.ingredients-display h2 {
  font-size: 1.75rem;
  font-weight: bold;
  color: #1f2937;
  margin-bottom: 1rem;
}

.ingredient-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ingredient-chip {
  padding: 0.5rem 1rem;
  background: var(--pink-100);
  color: var(--rose-700);
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
}

.result-card {
  border-radius: 1.5rem;
  padding: 3rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  color: white;
}

.result-card.safe {
  background: linear-gradient(135deg, var(--green-400), var(--green-500));
}

.result-card.danger {
  background: linear-gradient(135deg, var(--red-400), var(--red-500));
}

.result-title {
  font-size: 2.5rem;
  font-weight: bold;
  text-align: center;
  margin-bottom: 1.5rem;
}

.risk-score {
  text-align: center;
  margin-bottom: 2rem;
}

.risk-score-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  padding: 0.5rem 1.5rem;
  border-radius: 9999px;
  font-weight: 600;
}

.result-summary {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  color: #1f2937;
}

.result-summary h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.result-summary p {
  line-height: 1.8;
}

.got-it-btn {
  display: block;
  width: 200px;
  margin: 2rem auto 0;
  padding: 1rem 2rem;
  background: rgba(255, 255, 255, 0.9);
  color: #1f2937;
  border: none;
  border-radius: 0.75rem;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.got-it-btn:hover {
  background: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.loading-state {
  text-align: center;
  padding: 3rem;
}

.loading-spinner {
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid white;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ============================================
   About Section Styles
   ============================================ */
.about-section {
  padding: 100px 2rem 2rem;
  background: var(--pink-50);
  min-height: 100vh;
}

.about-hero {
  position: relative;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 3rem;
}

.about-hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('https://images.unsplash.com/photo-1598440947619-2c35fc9aa908?w=1920&q=80');
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.about-hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(251, 113, 133, 0.4), rgba(244, 63, 94, 0.3));
  z-index: 1;
}

.about-hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
}

.about-hero-title {
  font-size: 3.5rem;
  font-weight: bold;
  color: white;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.about-container {
  max-width: 800px;
  margin: 0 auto;
}

.about-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 1.5rem;
  padding: 3rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.about-card h2 {
  font-size: 2rem;
  font-weight: bold;
  color: #1f2937;
  margin-bottom: 1.5rem;
}

.about-card p {
  font-size: 1.1rem;
  color: #4b5563;
  line-height: 1.8;
  margin-bottom: 2rem;
}

.team-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid var(--pink-200);
}

.team-section h3 {
  font-size: 1.5rem;
  font-weight: bold;
  color: #1f2937;
  margin-bottom: 1.5rem;
}

.team-member {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem;
  background: var(--pink-50);
  border-radius: 0.75rem;
  margin-bottom: 1.5rem;
  transition: transform 0.3s, box-shadow 0.3s;
}

.team-member:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.team-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink-400), var(--rose-500));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  font-weight: bold;
  flex-shrink: 0;
}

.team-info {
  flex: 1;
}

.team-info h4 {
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.25rem;
  font-size: 1.25rem;
}

.team-role {
  font-size: 0.875rem;
  color: var(--rose-600);
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.team-bio {
  font-size: 0.95rem;
  color: #4b5563;
  line-height: 1.6;
  margin: 0;
}

.social-media-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid var(--pink-200);
}

.social-media-section h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.5rem;
}

.social-media-section p {
  font-size: 0.95rem;
  color: #6b7280;
  margin-bottom: 1.5rem;
}

.social-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background: var(--pink-50);
  border: 2px solid var(--pink-200);
  border-radius: 0.75rem;
  text-decoration: none;
  color: #1f2937;
  transition: all 0.3s;
  font-weight: 500;
}

.social-link:hover {
  background: var(--pink-100);
  border-color: var(--rose-400);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.social-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.social-icon svg {
  width: 100%;
  height: 100%;
}

.instagram-icon {
  color: #E4405F;
}

.xiaohongshu-icon {
  color: #FF2442;
}

.social-text {
  font-size: 1rem;
  color: #1f2937;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
  .hero-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .hero-subtitle {
    font-size: 1.25rem;
  }

  .navbar-content {
    padding: 0 1rem;
  }

  .logo {
    font-size: 1.25rem;
  }

  .nav-links {
    gap: 1rem;
  }

  .result-title {
    font-size: 2rem;
  }

  .about-hero-title {
    font-size: 2.5rem;
  }

  .social-links {
    flex-direction: column;
  }

  .social-link {
    width: 100%;
    justify-content: center;
  }

  .features-title {
    font-size: 2rem;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .team-member {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }

  .team-avatar {
    margin-bottom: 0.5rem;
  }
}
