@layer base, components, utilities;

@layer base {
  :root {
    /* Day Version (Light Mode) */
    --bg-color: oklch(0.97 0.01 240);
    --container-bg: oklch(1 0 0);
    --text-color: oklch(0.25 0.02 240);
    --primary-color: oklch(0.6 0.18 250);
    --secondary-color: oklch(0.65 0.2 150);
    --secondary-hover: oklch(0.55 0.18 150);
    --border-color: oklch(0.9 0.02 240);
    --shadow-color: rgba(0, 0, 0, 0.08);
    --card-shadow: 0 12px 24px -8px var(--shadow-color), 0 4px 12px -4px var(--shadow-color);
    
    /* Texture */
    --bg-texture: none;
  }

  [data-theme="dark"] {
    /* Night Version (Dark Mode) */
    --bg-color: oklch(0.18 0.03 240);
    --container-bg: oklch(0.25 0.04 240);
    --text-color: oklch(0.95 0.01 240);
    --primary-color: oklch(0.75 0.12 210);
    --secondary-color: oklch(0.7 0.15 160);
    --secondary-hover: oklch(0.6 0.14 160);
    --border-color: oklch(0.35 0.04 240);
    --shadow-color: rgba(0, 0, 0, 0.4);
    --card-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.6), 0 0 20px rgba(56, 189, 248, 0.1);
    
    /* Texture - Subtle noise */
    --bg-texture: 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)'/%3E%3C/svg%3E");
  }

  body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    text-align: center;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow-x: hidden;
  }

  body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.04;
    pointer-events: none;
    background-image: var(--bg-texture);
    z-index: -1;
  }
}

@layer components {
  #litter-detector {
      margin-top: 2rem;
      padding: 3rem;
      border: 1px solid var(--border-color);
      border-radius: 24px;
      background-color: var(--container-bg);
      box-shadow: var(--card-shadow);
      max-width: 640px;
      width: 90%;
      transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
      position: relative;
      overflow: hidden;
  }

  #litter-detector h2 {
    margin-top: 0;
    color: var(--primary-color);
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
  }

  #litter-detector p {
    color: var(--text-color);
    opacity: 0.8;
    font-size: 1.1rem;
    margin-bottom: 2rem;
  }

  #status-message {
    margin: 1rem 0;
    font-weight: 600;
    font-size: 1.1rem;
    height: 1.5rem;
    transition: all 0.3s ease;
  }

  /* Theme Toggle Button Styles */
  .theme-toggle {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: var(--container-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: var(--card-shadow);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
  }

  .theme-toggle:hover {
    transform: rotate(20deg) scale(1.1);
    border-color: var(--primary-color);
  }
}

@layer utilities {
  .glow {
    box-shadow: 0 0 20px var(--primary-color);
  }
}
