@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  :root {
    --gb-bg-h: #1d2021;
    --gb-bg: #282828;
    --gb-bg-s: #3c3836;
    --gb-bg-t: #504945;
    --gb-bg-f: #32302f;
    --gb-fg: #ebdbb2;
    --gb-fg-s: #d5c4a1;
    --gb-fg-t: #bdae93;
    --gb-fg-f: #a89984;
    --gb-red: #fb4934;
    --gb-green: #b8bb26;
    --gb-yellow: #fabd2f;
    --gb-blue: #83a598;
    --gb-purple: #d3869b;
    --gb-aqua: #8ec07c;
    --gb-orange: #fe8019;
    --gb-gray: #928374;
    --gb-border: #665c54;
  }

  /* Light mode overrides */
  .light {
    --gb-bg-h: #f9f5d7;
    --gb-bg: #fbf1c7;
    --gb-bg-s: #ebdbb2;
    --gb-bg-t: #d5c4a1;
    --gb-bg-f: #bdae93;
    --gb-fg: #282828;
    --gb-fg-s: #3c3836;
    --gb-fg-t: #504945;
    --gb-fg-f: #7c6f64;
    --gb-border: #a89984;
  }

  html, body, #root {
    @apply h-full w-full bg-gb-bg text-gb-fg font-mono;
    font-size: 14px;
    line-height: 1.4;
  }

  /* ponytail: safe-area env() can't go in @apply, handle in Layout.tsx inline styles */

  * {
    box-sizing: border-box;
  }

  /* Thin themed scrollbar for chat area */
  *::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }
  *::-webkit-scrollbar-track {
    background: var(--gb-bg);
  }
  *::-webkit-scrollbar-thumb {
    background: var(--gb-bg-t);
    border-radius: 3px;
  }
  *::-webkit-scrollbar-thumb:hover {
    background: var(--gb-fg-f);
  }

  input, textarea, button {
    @apply bg-gb-bg-s text-gb-fg font-mono border outline-none;
    border-color: var(--gb-border);
  }

  input:focus, textarea:focus, button:focus {
    @apply border-gb-fg-t;
  }
}

@layer components {
  .terminal-border {
    border-style: solid;
    border-color: var(--gb-border);
    border-width: 1px;
  }

  .terminal-button {
    @apply px-2 py-1 bg-gb-bg-s text-gb-fg border hover:bg-gb-bg-t hover:text-gb-orange transition-colors;
    border-color: var(--gb-border);
  }

  .terminal-input {
    @apply px-2 py-1 bg-gb-bg-s text-gb-fg border w-full;
    border-color: var(--gb-border);
  }

  .terminal-active {
    @apply text-gb-orange bg-gb-bg-t;
  }

  .terminal-mention {
    background-color: rgba(142, 192, 124, 0.12);
    color: var(--gb-aqua);
  }
}
