/* Landing Chat Theme - Design System */

:root {
  /* Background Colors */
  --color-primary-bg: #111827;       /* Main app background */
  --color-secondary-bg: #1B1D21;     /* Chat input, history backgrounds */
  --color-tertiary-bg: #2A2D33;      /* Message bubbles, panels */
  --color-surface-1: #1f2937;        /* Cards, elevated surfaces */
  --color-surface-2: #374151;        /* Secondary surfaces */
  --color-surface-3: #4b5563;        /* Tertiary surfaces */
  
  /* Text Colors */
  --color-text-primary: #ffffff;     /* Primary text */
  --color-text-secondary: #d1d5db;   /* Secondary text */
  --color-text-muted: #9ca3af;       /* Muted text */
  --color-text-subtle: #6b7280;      /* Very muted text */
  
  /* Interactive Colors */
  --color-accent-primary: #60a5fa;   /* Links, primary actions */
  --color-accent-primary-hover: #93c5fd; /* Primary accent hover */
  --color-user-message: #2563eb;     /* User message bubbles */
  --color-accent-secondary: #a855f7; /* Discovery panel, special features */
  --color-accent-secondary-dark: #9333ea; /* Secondary accent darker */
  --color-accent-secondary-light: #a855f7; /* Secondary accent lighter */
  
  /* Status Colors */
  --color-success: #4ade80;          /* Success states */
  --color-warning: #fb923c;          /* Warning states */
  --color-info: #facc15;             /* Info/debug elements */
  
  /* Border Colors */
  --color-border-subtle: rgba(255, 255, 255, 0.05); /* Subtle borders */
  --color-border-emphasis: rgba(255, 255, 255, 0.1); /* Emphasized borders */
  --color-border-solid: rgba(75, 85, 99, 1); /* Solid borders */
  
  /* Overlay Colors */
  --color-overlay-subtle: rgba(255, 255, 255, 0.05); /* Subtle overlays */
  --color-overlay-hover: rgba(255, 255, 255, 0.08); /* Hover overlays */
  
  /* Gradient Colors */
  --color-soft-primary: #1e3a8a;                 /* Soft primary for gradients (dark blue) */
  --color-white-rgb: 17, 24, 39;                 /* Dark background RGB values for rgba() */
  
  /* Typography */
  --font-family-sans: system-ui, -apple-system, sans-serif;
  --font-family-mono: "Source Code Pro", "SF Mono", Consolas, monospace;
  
  /* Border Radius */
  --border-radius-sm: 6px;
  --border-radius: 12px;
  --border-radius-lg: 16px;
  --border-radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 0.15s ease-out;
  --transition-normal: 0.2s ease-out;
  --transition-slow: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Shadows */
  --shadow-sm: rgba(0, 0, 0, 0.06) 0px 18px 25.8px 0px;
  --shadow-chat: rgba(0, 0, 0, 0.1) 0px 4px 6px -1px;
}

/* Dark theme overrides (can be extended for light theme later) */
[data-theme="dark"] {
  --color-app-bg: #0f172a;
  --color-app-surface: #1e293b;
  --color-app-card: #334155;
}

/* Component-specific CSS extracted from inline styles */

/* Source Code Pro Logo */
.source-code-pro-logo {
  font-family: var(--font-family-mono);
  font-optical-sizing: auto;
  font-weight: 600;
  font-style: italic;
  font-size: 29px;
}
.google-sans-code-logo {
  font-family: "Google Sans Code", monospace;
  font-optical-sizing: auto;
  font-weight: 600;
  font-style: normal;
}

/* Resume Panel Animations */
.resume-panel {
  transition: var(--transition-slow);
  opacity: 1;
  transform: translateY(0);
  max-height: 200px;
  overflow: hidden;
}

.resume-panel.hiding {
  opacity: 0;
  transform: translateY(-10px);
  max-height: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
}

/* Discovery Panel Animations */
.discovery-panel details {
  transition: var(--transition-fast);
}

.discovery-panel details summary {
  transition: var(--transition-fast);
}

.discovery-arrow {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

.discovery-text-collapsed,
.discovery-text-expanded {
  grid-column: 1;
  grid-row: 1;
  transition: opacity var(--transition-normal);
}

.discovery-panel details .discovery-text-collapsed {
  opacity: 1;
}

.discovery-panel details .discovery-text-expanded {
  opacity: 0;
}

.discovery-panel details[open] .discovery-text-collapsed {
  opacity: 0;
}

.discovery-panel details[open] .discovery-text-expanded {
  opacity: 1;
}

.discovery-content {
  opacity: 0;
  transform: translateY(-8px) scaleY(0.96);
  transition: var(--transition-slow);
  transform-origin: top;
  max-height: 0;
  overflow: hidden;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 40;
  background: var(--color-primary-bg);
  border-radius: var(--border-radius);
  border: 1px solid var(--color-border-subtle);
  margin-top: 8px;
}

.discovery-content.show {
  opacity: 1;
  transform: translateY(0) scaleY(1);
  max-height: 50vh;
  overflow-y: auto;
}

.discovery-content.hide {
  opacity: 0;
  transform: translateY(-8px) scaleY(0.96);
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-top: 0;
}

/* Chat Layout States */
.chat-inactive {
  justify-content: flex-start;
  padding-top: 1rem;
}

.chat-active {
  justify-content: flex-start;
  padding-top: 0;
  flex: 1;
}

.chat-active #chat-input-container {
  position: fixed;
  bottom: 4vh;
  left: 0;
  right: 0;
  background: transparent;
  padding: 0.25rem;
  z-index: 35;
}

.chat-active #chat-input-container > div {
  max-width: 768px;
  margin: 0 auto;
}

.chat-active #chat-history-wrapper {
  height: 60vh;
  transition: opacity var(--transition-slow);
  margin-bottom: 2vh;
}

@media (min-width: 768px) {
  .chat-active #chat-history-wrapper {
    margin-bottom: 6vh;
  }
}

.discovery-panel[open] ~ #chat-history {
  opacity: 0.3;
}

#main-container.chat-active {
  padding-bottom: 20vh;
}

/* Message Content Styling */
.message-content {
  font-family: inherit;
  white-space: pre-wrap;
  margin: 0;
  word-break: break-word;
}

.message-content a {
  color: var(--color-accent-primary);
  text-decoration: underline;
  transition: color var(--transition-normal);
}

.message-content a:hover {
  color: var(--color-accent-primary-hover);
}

.external-link-icon {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 2px;
  vertical-align: baseline;
  opacity: 0.7;
  transition: opacity var(--transition-normal);
}

.message-content a:hover .external-link-icon {
  opacity: 1;
}