:root {
  /* Beauty Haul Color Palette */
  --color-blush-pink: #F2A7BB;
  --color-cream: #FDF6F0;
  --color-nude-rose: #C4818F;
  --color-deep-mauve: #6A4C54;
  --color-white: #ffffff;
  --color-black: #2d2426;

  /* UI Tokens */
  --bg-primary: var(--color-cream);
  --text-primary: var(--color-black);
  --text-secondary: var(--color-deep-mauve);
  --accent-color: var(--color-nude-rose);

  /* Radii & Shadows */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  --shadow-sm: 0 4px 6px -1px rgba(196, 129, 143, 0.1), 0 2px 4px -1px rgba(196, 129, 143, 0.06);
  --shadow-md: 0 10px 15px -3px rgba(196, 129, 143, 0.15), 0 4px 6px -2px rgba(196, 129, 143, 0.05);
  --shadow-glow: 0 0 25px rgba(242, 167, 187, 0.6);

  /* Font Families */
  --font-main: 'Outfit', sans-serif;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-smoothing: antialiased;
}

/* Glassmorphism utility */
.glass-panel {
  background: rgba(253, 246, 240, 0.7);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-lg);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text-secondary);
  font-weight: 600;
  line-height: 1.2;
}

h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

h2 {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

p {
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* Animations */
@keyframes pulseGlow {
  0% {
    box-shadow: 0 0 15px rgba(242, 167, 187, 0.4);
  }

  50% {
    box-shadow: 0 0 35px rgba(242, 167, 187, 0.8);
  }

  100% {
    box-shadow: 0 0 15px rgba(242, 167, 187, 0.4);
  }
}

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

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

.animate-fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}

/* Layout utilities */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  width: 100%;
}

.header {
  text-align: center;
  padding: 3rem 0 2rem;
}

.header .logo {
  font-size: 3.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--color-nude-rose), var(--color-blush-pink));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  letter-spacing: -1px;
}

.header p {
  color: var(--text-secondary);
  font-size: 1.2rem;
  opacity: 0.8;
}

/* Main Grid */
.main-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 900px) {
  .main-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-content {
  width: 90%;
  max-width: 500px;
  padding: 2rem;
  background: var(--color-white);
}

.modal-content h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-deep-mauve);
}

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

.input-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-primary);
}

.input-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(196, 129, 143, 0.4);
  font-family: var(--font-main);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.input-group input:focus {
  border-color: var(--color-nude-rose);
}

/* Camera Container */
.camera-container {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  border: 4px solid transparent;
}

.camera-container.is-detecting {
  border-color: var(--color-blush-pink);
  animation: pulseGlow 2s infinite;
}

#webcam-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#webcam-container canvas {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
}

.detection-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.detected-product {
  font-size: 1.8rem;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.confidence-score {
  font-size: 1.2rem;
  font-weight: 500;
  background: var(--color-blush-pink);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  color: var(--text-primary);
}

/* Info Panel */
.info-panel {
  padding: 2rem;
  height: 100%;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  color: var(--color-nude-rose);
  opacity: 0.7;
}

/* Info Sections */
.info-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(196, 129, 143, 0.2);
}

.info-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.info-section-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-deep-mauve);
  margin-bottom: 1rem;
  font-size: 1.2rem;
  font-weight: 600;
}

.info-section-header svg {
  color: var(--color-nude-rose);
}

.info-content ul,
.info-content ol {
  padding-left: 1.2rem;
}

.info-content li {
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  background: var(--color-cream);
  border: 1px solid var(--color-blush-pink);
  color: var(--color-deep-mauve);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 500;
}

.loading-spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid var(--color-cream);
  border-top: 4px solid var(--color-nude-rose);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 2rem auto;
}

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

  100% {
    transform: rotate(360deg);
  }
}

.start-button {
  background: var(--color-nude-rose);
  color: white;
  border: none;
  padding: 1rem 2rem;
  font-size: 1.2rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 auto;
}

.start-button:hover {
  background: var(--color-deep-mauve);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.start-button:active {
  transform: translateY(0);
}