@layer base, components, utilities;

@layer base {
  :root {
    --primary-color: #ff7043;
    --primary-light: #ff8a65;
    --primary-dark: #e64a19;
    --secondary-color: #fbc02d;
    --accent-color: #ff5252;
    --bg-color: #fffaf0;
    --text-color: #3e2723;
    --card-bg: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.1);
    
    /* Modern Colors (Baseline) */
    --vibrant-orange: oklch(0.7 0.2 45);
    --vibrant-yellow: oklch(0.85 0.15 85);
  }

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

  body {
    font-family: 'Gowun Dodum', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
  }

  .noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: url('https://www.transparenttextures.com/patterns/p6.png');
    opacity: 0.05;
    z-index: 1000;
  }

  h1, h2, h3 {
    font-family: 'Jua', sans-serif;
  }
}

@layer components {
  header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 3rem 1rem;
    text-align: center;
    clip-path: ellipse(150% 100% at 50% 0%);
    box-shadow: 0 4px 20px var(--shadow-color);
  }

  header h1 {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
  }

  main {
    max-width: 800px;
    margin: -2rem auto 2rem;
    padding: 0 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
  }

  #recommender {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 
      0 10px 30px -10px var(--shadow-color),
      0 20px 40px -20px var(--shadow-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    border: 1px solid rgba(0,0,0,0.05);
  }

  .primary-button {
    background: var(--vibrant-orange);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.5rem;
    font-family: 'Jua', sans-serif;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 0 var(--primary-dark);
    position: relative;
    top: 0;
  }

  .primary-button:hover {
    transform: scale(1.05);
    background: var(--primary-light);
  }

  .primary-button:active {
    top: 5px;
    box-shadow: 0 5px 0 var(--primary-dark);
  }

  footer {
    text-align: center;
    padding: 2rem;
    font-size: 0.9rem;
    opacity: 0.7;
  }

  /* Custom Element Styles */
  category-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
  }

  .category-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--primary-color);
    border-radius: 20px;
    background: transparent;
    color: var(--primary-color);
    font-family: 'Gowun Dodum', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .category-btn.active {
    background: var(--primary-color);
    color: white;
  }

  food-roulette {
    width: 100%;
    height: 120px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #fdf2f2;
    border-radius: 12px;
    border: 4px dashed var(--secondary-color);
    position: relative;
  }

  .roulette-inner {
    display: flex;
    flex-direction: column;
    transition: transform 0.1s ease-out;
    text-align: center;
  }

  .roulette-item {
    height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
  }

  .roulette-item .food-name {
    font-family: 'Jua', sans-serif;
    font-size: 2rem;
  }

  food-card {
    display: none;
    background: var(--card-bg);
    border-radius: 24px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 10px 20px var(--shadow-color);
    animation: slideUp 0.5s ease-out;
  }

  food-card.visible {
    display: block;
  }

  .food-result-header {
    font-size: 1.2rem;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
  }

  .food-result-name {
    font-size: 3rem;
    font-family: 'Jua', sans-serif;
    color: var(--text-color);
    margin-bottom: 1rem;
  }

  .tag-container {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
  }

  .tag {
    background: #fff3e0;
    color: #e65100;
    padding: 0.2rem 0.8rem;
    border-radius: 12px;
    font-size: 0.9rem;
  }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@layer utilities {
  .text-center { text-align: center; }
}

@media (max-width: 600px) {
  header h1 { font-size: 2.5rem; }
  .primary-button { font-size: 1.2rem; padding: 0.8rem 2rem; }
}
