@import "tailwindcss";

/* ============================================
   PicoBot Theme — Dark (default)
   ============================================ */
:root {
  /* Core colors */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a25;
  --bg-hover: #252535;

  /* Accent colors */
  --accent-cyan: #00f0ff;
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;

  /* Text colors */
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --text-accent: var(--accent-cyan);

  /* Border */
  --border-color: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(0, 240, 255, 0.3);

  /* Overlay — for hover / subtle surface effects */
  --overlay-hover:      rgba(255, 255, 255, 0.05);
  --overlay-subtle:     rgba(255, 255, 255, 0.10);
  --overlay-medium:     rgba(255, 255, 255, 0.20);
  --overlay-dim:        rgba(0, 0, 0, 0.20);
  --overlay-dim-strong: rgba(0, 0, 0, 0.30);
  --overlay-dim-heavy:  rgba(0, 0, 0, 0.40);
  --overlay-code:       rgba(0, 0, 0, 0.30);

  /* Shadows */
  --shadow-glow-sm:     rgba(0, 240, 255, 0.12);
  --shadow-glow:        rgba(0, 240, 255, 0.20);
  --shadow-glow-strong: rgba(0, 240, 255, 0.30);
  --shadow-glow-soft:   rgba(0, 240, 255, 0.50);

  /* Focus ring */
  --focus-ring:         rgba(0, 240, 255, 0.20);

  /* Selection / code highlight */
  --selection-bg:       rgba(0, 240, 255, 0.30);

  /* Divider */
  --divider-color:      rgba(255, 255, 255, 0.20);

  color-scheme: dark;
}

/* ============================================
   PicoBot Theme — Light
   ============================================ */
html.light {
  /* Backgrounds */
  --bg-primary:    #f5f5f7;
  --bg-secondary:  #ffffff;
  --bg-tertiary:   #ebecf0;
  --bg-hover:      #dfe0e5;

  /* Accents — slightly darker for readability on white */
  --accent-cyan:    #008899;
  --accent-blue:    #2563eb;
  --accent-purple:  #7c3aed;
  --accent-green:   #059669;
  --accent-amber:   #d97706;

  /* Text */
  --text-primary:   #1a1a2e;
  --text-secondary: #52525b;
  --text-muted:     #a1a1aa;
  --text-accent:    var(--accent-cyan);

  /* Borders */
  --border-color:   rgba(0, 0, 0, 0.08);
  --border-accent:  rgba(0, 136, 153, 0.30);

  /* Overlays */
  --overlay-hover:      rgba(0, 0, 0, 0.04);
  --overlay-subtle:     rgba(0, 0, 0, 0.06);
  --overlay-medium:     rgba(0, 0, 0, 0.10);
  --overlay-dim:        rgba(0, 0, 0, 0.04);
  --overlay-dim-strong: rgba(0, 0, 0, 0.06);
  --overlay-dim-heavy:  rgba(0, 0, 0, 0.08);
  --overlay-code:       rgba(0, 0, 0, 0.06);

  /* Shadows — softer */
  --shadow-glow-sm:     rgba(0, 136, 153, 0.10);
  --shadow-glow:        rgba(0, 136, 153, 0.15);
  --shadow-glow-strong: rgba(0, 136, 153, 0.22);
  --shadow-glow-soft:   rgba(0, 136, 153, 0.35);

  /* Focus ring */
  --focus-ring:         rgba(0, 136, 153, 0.20);

  /* Selection / code highlight */
  --selection-bg:       rgba(0, 136, 153, 0.20);

  /* Divider */
  --divider-color:      rgba(0, 0, 0, 0.10);

  color-scheme: light;
}

/* ============================================
   Smooth theme transition
   ============================================ */
html.theme-transitioning *,
html.theme-transitioning *::before,
html.theme-transitioning *::after {
  transition: background-color 0.3s ease,
              color 0.3s ease,
              border-color 0.3s ease,
              box-shadow 0.3s ease,
              text-shadow 0.3s ease !important;
}

/* ============================================
   Custom scrollbar
   ============================================ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-blue);
}

/* Hide scrollbar utility */
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

/* ============================================
   Base styles
   ============================================ */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'SF Mono', 'Fira Code', 'JetBrains Mono', monospace;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
}

/* ============================================
   Custom selection
   ============================================ */
::selection {
  background: var(--selection-bg);
  color: var(--text-primary);
}

/* ============================================
   Glowing text effect
   ============================================ */
.glow-text {
  text-shadow: 0 0 10px var(--shadow-glow-soft),
               0 0 20px var(--shadow-glow-strong),
               0 0 30px var(--shadow-glow-sm);
}

/* ============================================
   Gradient border
   ============================================ */
.gradient-border {
  position: relative;
}

.gradient-border::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

/* ============================================
   Animations
   ============================================ */
@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 5px var(--accent-cyan),
                0 0 10px var(--accent-cyan),
                0 0 20px var(--accent-cyan);
  }
  50% {
    box-shadow: 0 0 10px var(--accent-cyan),
                0 0 20px var(--accent-cyan),
                0 0 40px var(--accent-cyan);
  }
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes typing-dot {
  0%, 60%, 100% { transform: translateY(0); }
  30%           { transform: translateY(-4px); }
}

@keyframes scale-in {
  0%   { opacity: 0; transform: scale(0.5); }
  50%  { transform: scale(1.1); }
  100% { opacity: 1; transform: scale(1); }
}

.animate-slide-in { animation: slide-in 0.3s ease-out; }
.animate-fade-in  { animation: fade-in 0.2s ease-out; }
.animate-scale-in { animation: scale-in 0.3s ease-out; }

@keyframes thinking-reveal {
  from { max-height: 0; opacity: 0; }
  to   { max-height: 300px; opacity: 1; }
}

.animate-thinking-reveal { animation: thinking-reveal 0.25s ease-out; }

.typing-indicator span {
  animation: typing-dot 1.4s infinite;
  display: inline-block;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

/* ============================================
   Markdown list — kill extra spacing from loose-list <p> wrappers
   list-inside + block <p> pushes marker and content apart.
   Use list-outside so the marker sits outside the <p> flow.
   ============================================ */
.markdown-content li > p {
  margin: 0;
}

/* ============================================
   Code block styling
   ============================================ */
pre {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  overflow-x: auto;
}

code {
  font-family: 'SF Mono', 'Fira Code', 'JetBrains Mono', monospace;
  font-size: 0.9em;
}

/* ============================================
   Focus styles
   ============================================ */
input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px var(--focus-ring);
}

/* ============================================
   Button hover effects
   ============================================ */
button {
  transition: all 0.2s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button:active:not(:disabled) {
  transform: translateY(0);
}

/* ============================================
   Link styles
   ============================================ */
a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: all 0.2s;
}

a:hover {
  text-shadow: 0 0 8px var(--accent-cyan);
}
