@layer base, layout, components, utilities;

@layer base {
  :root {
    /* Colors (OKLCH) */
    --bg-color: oklch(100% 0 0);
    --surface-color: oklch(98% 0.01 230);
    --primary-color: oklch(75% 0.15 230);
    --primary-glow: oklch(75% 0.15 230 / 20%);
    --text-color: oklch(25% 0.02 230);
    --text-muted: oklch(50% 0.02 230);
    --border-color: oklch(90% 0.01 230);
    
    /* Shadows */
    --shadow-sm: 0 2px 4px oklch(0% 0 0 / 5%);
    --shadow-md: 0 8px 16px oklch(0% 0 0 / 8%), 0 2px 4px oklch(0% 0 0 / 4%);
    --shadow-lg: 0 16px 32px oklch(0% 0 0 / 12%), 0 4px 8px oklch(0% 0 0 / 6%);
    
    /* Spacing & Radii */
    --radius-md: 12px;
    --radius-lg: 20px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    
    /* Font */
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  }

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

  body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow: hidden; /* App handles scrolling internally */
  }

  /* Subtle Grain Texture Overlay */
  body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.02;
    z-index: 9999;
    background-image: 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");
  }
}

@layer layout {
  .app-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: 100vh;
    background-color: var(--bg-color);
  }

  @media (max-width: 768px) {
    .app-container {
      grid-template-columns: 1fr;
    }
  }
}

@layer components {
  /* Scrollbar Styling */
  ::-webkit-scrollbar {
    width: 6px;
  }
  ::-webkit-scrollbar-track {
    background: transparent;
  }
  ::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
  }
  ::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
  }
}
