@import url('https://fonts.googleapis.com/css2?family=Onest:wght@400;500;600&family=Unbounded:wght@400;600;700;800&display=swap');

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

@layer base {
  :root {
    /* NeuroBoss Design System (DESIGN.md) */
    --bg-primary: #FFFFFF;
    --bg-surface: #F8F9FA;
    --bg-sidebar: #1A1A2E;
    --accent: #FF8C42;
    --accent-hover: #E67A35;
    --text-primary: #333333;
    --text-secondary: #666666;
    --success: #28A745;
    --warning: #FFC107;
    --error: #DC3545;
    --border: #E5E7EB;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
    --radius-xl: 16px;
    --radius-full: 9999px;
    --text-on-accent: #FFFFFF;
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    /* Legacy aliases */
    --color-primary: var(--accent);
    --color-bg-main: var(--bg-primary);
    --color-bg-sec: var(--bg-surface);
    --color-text-main: var(--text-primary);
    --color-text-sec: var(--text-secondary);
  }

  body {
    background-color: var(--bg-surface);
    color: var(--text-primary);
  }
}

@layer utilities {
  .font-unbounded {
    font-family: 'Unbounded', sans-serif;
  }
  .font-onest {
    font-family: 'Onest', sans-serif;
  }
  .shadow-card {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  }
}

/* Markdown Styles */
.markdown-body p {
  margin-bottom: 0.75rem;
}
.markdown-body p:last-child {
  margin-bottom: 0;
}
.markdown-body strong {
  font-weight: 600;
}
.markdown-body ul {
  list-style-type: disc;
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
}
.markdown-body ol {
  list-style-type: decimal;
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
}
.markdown-body code {
  background-color: rgba(0,0,0,0.05);
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
  font-family: monospace;
  font-size: 0.875em;
}
.markdown-body pre {
  background-color: #1a1a2e;
  color: #fff;
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin-bottom: 1rem;
}
.markdown-body pre code {
  background-color: transparent;
  padding: 0;
  color: inherit;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #0F0F1A;
    --bg-surface: #1A1A2E;
    --text-primary: #E5E7EB;
    --text-secondary: #9CA3AF;
    --border: #374151;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.4);
  }
  body { background-color: #0F0F1A; color: #E5E7EB; }
  .shadow-card { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); }
}

/* Mobile */
@media (max-width: 768px) {
  /* Hide sidebar + file explorer on mobile */
  aside { display: none !important; }

  /* Chat input fixed at bottom */
  .p-4.bg-white.border-t {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 30;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  }

  /* Chat scroll area: pad bottom for fixed input */
  #chat-messages, .flex-1.overflow-y-auto {
    padding-bottom: 140px;
  }

  /* Quick actions: horizontal scroll */
  .quick-actions {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  /* Full-width chat bubbles */
  .max-w-3xl, .max-w-4xl { max-width: 100% !important; }
}
