/* === RESET & BASE === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #ffffff;
  --text: #1a1a1a;
  --text-secondary: #5f6368;
  --border: #dfe1e5;
  --border-hover: #c0c3c7;
  --accent: #4a90d9;
  --accent-hover: #3a7bc8;
  --surface: #ffffff;
  --surface-hover: #f8f9fa;
  --shadow: 0 1px 6px rgba(32,33,36,0.12);
  --shadow-hover: 0 2px 12px rgba(32,33,36,0.18);
  --ai-accent: #7c5cfc;
  --ai-bg: #f5f3ff;
  --navigate-accent: #34a853;
  --radius: 24px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e0e;
    --text: #e8eaed;
    --text-secondary: #9aa0a6;
    --border: #3c4043;
    --border-hover: #5f6368;
    --surface: #1e1e1e;
    --surface-hover: #2a2a2a;
    --shadow: 0 1px 6px rgba(0,0,0,0.3);
    --shadow-hover: 0 2px 12px rgba(0,0,0,0.4);
    --ai-bg: #1a1528;
  }
}

html { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* === HOMEPAGE === */
.home {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.goose-mascot {
  margin-bottom: 8px;
  animation: gooseWaddle 3s ease-in-out infinite;
}

@keyframes gooseWaddle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(3deg); }
  75% { transform: rotate(-3deg); }
}

.logo {
  font-size: 64px;
  font-weight: 700;
  letter-spacing: -2px;
  margin-bottom: 32px;
  user-select: none;
}

.logo-yo { color: var(--ai-accent); }
.logo-go { color: var(--navigate-accent); }
.logo-ose { color: var(--accent); }

/* === AMBIENT TICKER === */
.ambient-ticker {
  min-height: 24px;
  margin-top: 10px;
  margin-bottom: 10px;
  text-align: center;
  font-size: 14px;
  color: var(--text);
  opacity: 0.5;
  transition: opacity 0.8s ease-in-out;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 584px;
  padding: 0 20px;
}

/* === TRENDING SEARCHES === */
.trending-section {
  margin-top: 16px;
  max-width: 584px;
  width: 100%;
}

.trending-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.trending-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-family: var(--font);
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.trending-chip:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--border-hover);
}

.trending-chip-icon {
  font-size: 11px;
  opacity: 0.5;
}

/* === SEARCH BAR === */
.search-container {
  width: 100%;
  max-width: 584px;
  position: relative;
}

.search-bar {
  width: 100%;
  height: 48px;
  padding: 0 48px 0 20px;
  font-size: 16px;
  font-family: var(--font);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-bar:focus,
.search-bar:hover {
  border-color: transparent;
  box-shadow: var(--shadow-hover);
}

.search-bar::placeholder {
  color: var(--text-secondary);
}

.search-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
  pointer-events: none;
}

/* === AUTOCOMPLETE === */
.autocomplete {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 16px 16px;
  box-shadow: var(--shadow-hover);
  z-index: 100;
  display: none;
  overflow: hidden;
}

.autocomplete.active {
  display: block;
}

.autocomplete-item {
  display: flex;
  align-items: center;
  padding: 10px 20px;
  cursor: pointer;
  gap: 12px;
  transition: background 0.1s;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
  background: var(--surface-hover);
}

.autocomplete-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.autocomplete-icon.navigate { color: var(--navigate-accent); }
.autocomplete-icon.ai { color: var(--ai-accent); }

.autocomplete-text {
  font-size: 15px;
  color: var(--text);
  flex-grow: 1;
}

.autocomplete-type {
  font-size: 12px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* When autocomplete is open, square off bottom of search bar */
.search-container.ac-open .search-bar {
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom-color: transparent;
}

/* === CTA / MARKETING === */
.cta-section {
  margin-top: 28px;
  text-align: center;
}

.cta-text {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.5;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font);
  color: #fff;
  background: var(--ai-accent);
  border: none;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  text-decoration: none;
}

.cta-button:hover {
  background: #6a4ce0;
  transform: translateY(-1px);
}

.cta-button svg {
  width: 16px;
  height: 16px;
}

/* === RESULTS PAGE === */
.results-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
}

.results-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.results-logo {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -1px;
  text-decoration: none;
  flex-shrink: 0;
}

.results-search-container {
  flex-grow: 1;
  position: relative;
}

.results-search-bar {
  width: 100%;
  height: 42px;
  padding: 0 16px;
  font-size: 15px;
  font-family: var(--font);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 21px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.results-search-bar:focus {
  border-color: transparent;
  box-shadow: var(--shadow-hover);
}

/* === AI RESPONSE === */
.ai-response {
  line-height: 1.7;
  font-size: 16px;
}

.ai-response h1 { font-size: 22px; margin: 20px 0 10px; font-weight: 600; }
.ai-response h2 { font-size: 19px; margin: 18px 0 8px; font-weight: 600; }
.ai-response h3 { font-size: 17px; margin: 16px 0 6px; font-weight: 600; }

.ai-response p { margin: 8px 0; }

.ai-response ul, .ai-response ol {
  margin: 8px 0;
  padding-left: 24px;
}

.ai-response li { margin: 4px 0; }

.ai-response code {
  background: var(--surface-hover);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 14px;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

.ai-response pre {
  background: var(--surface-hover);
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 12px 0;
}

.ai-response pre code {
  background: none;
  padding: 0;
}

.ai-response a {
  color: var(--accent);
  text-decoration: none;
}

.ai-response a:hover {
  text-decoration: underline;
}

.ai-response a.auto-link {
  color: var(--ai-accent);
  text-decoration: none;
  border-bottom: 1px dotted var(--ai-accent);
}

.ai-response a.auto-link:hover {
  border-bottom-style: solid;
}

.ai-response strong { font-weight: 600; }
.ai-response em { font-style: italic; }

.ai-response blockquote {
  border-left: 3px solid var(--ai-accent);
  padding-left: 16px;
  margin: 12px 0;
  color: var(--text-secondary);
}

/* === GOOSE LOADING === */
.goose-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
}

.dancing-goose {
  animation: gooseDance 0.6s ease-in-out infinite;
}

@keyframes gooseDance {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  20% { transform: translateY(-12px) rotate(-5deg); }
  40% { transform: translateY(0) rotate(0deg); }
  60% { transform: translateY(-8px) rotate(5deg); }
  80% { transform: translateY(0) rotate(0deg); }
}

.goose-loading.goose-fade-out {
  animation: gooseFadeOut 0.4s ease-out forwards;
}

@keyframes gooseFadeOut {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.8) translateY(-20px); }
}

.goose-status-text {
  margin-top: 6px;
  font-size: 13px;
  color: var(--ai-accent);
  font-weight: 500;
  min-height: 18px;
  animation: gooseTextPulse 1.5s ease-in-out infinite;
}

.goose-loading-text {
  margin-top: 16px;
  font-size: 15px;
  color: var(--text-secondary);
  animation: gooseTextPulse 1.5s ease-in-out infinite;
}

@keyframes gooseTextPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Cursor blink */
.cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--ai-accent);
  margin-left: 2px;
  animation: blink 0.8s infinite;
  vertical-align: text-bottom;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Loading dots */
.loading {
  display: flex;
  gap: 6px;
  padding: 20px 0;
}

.loading-dot {
  width: 8px;
  height: 8px;
  background: var(--ai-accent);
  border-radius: 50%;
  animation: loadingBounce 0.6s infinite alternate;
}

.loading-dot:nth-child(2) { animation-delay: 0.2s; }
.loading-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes loadingBounce {
  from { opacity: 0.3; transform: translateY(0); }
  to { opacity: 1; transform: translateY(-4px); }
}

/* === NEWS FEED (Apple News style) === */
.news-feed-container {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hero card */
.news-hero {
  display: block;
  text-decoration: none;
  color: var(--text);
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 20px;
  transition: transform 0.15s, box-shadow 0.15s;
}

.news-hero:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.news-hero-image {
  width: 100%;
  height: 280px;
  background-size: cover;
  background-position: center;
  background-color: var(--surface-hover);
}

.news-hero-content {
  padding: 20px;
}

.news-source {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--ai-accent);
}

.news-hero-title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  margin: 8px 0;
  color: var(--text);
}

.news-hero-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0 0 8px 0;
}

.news-time {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Grid cards */
.news-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.news-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform 0.15s, box-shadow 0.15s;
}

.news-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.news-card-image {
  width: 100%;
  height: 140px;
  background-size: cover;
  background-position: center;
  background-color: var(--surface-hover);
}

.news-card-no-image {
  background: linear-gradient(135deg, var(--ai-accent) 0%, var(--accent) 100%);
  opacity: 0.3;
}

.news-card-content {
  padding: 14px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.news-card-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  margin: 6px 0;
  color: var(--text);
  flex-grow: 1;
}

@media (max-width: 600px) {
  .news-grid {
    grid-template-columns: 1fr;
  }
  .news-hero-image {
    height: 180px;
  }
  .news-hero-title {
    font-size: 20px;
  }
}

/* === FINANCIAL CHART === */
.financial-chart {
  margin-bottom: 20px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.financial-chart .tradingview-widget-container {
  width: 100%;
}

/* === RELATED SITES === */
.related-sites {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.related-sites h4 {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.related-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 6px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  transition: background 0.12s;
}

.related-link:hover {
  background: var(--surface-hover);
}

.related-link-icon {
  color: var(--navigate-accent);
  font-size: 16px;
  flex-shrink: 0;
}

.related-link-name {
  font-size: 15px;
  font-weight: 500;
}

.related-link-url {
  font-size: 12px;
  color: var(--text-secondary);
  margin-left: auto;
}

/* === POWERED BY === */
.powered-by {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
}

/* === FOLLOW-UP QUESTION === */
.followup-question {
  margin-top: 24px;
  padding: 12px 16px;
  background: var(--ai-bg);
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  border-left: 3px solid var(--ai-accent);
}

/* === FOLLOW-UP BAR === */
.followup-bar {
  position: sticky;
  bottom: 0;
  background: var(--bg);
  padding: 16px 0 20px;
  display: flex;
  gap: 8px;
  border-top: 1px solid var(--border);
  margin-top: 24px;
}

.followup-input {
  flex-grow: 1;
  height: 44px;
  padding: 0 16px;
  font-size: 15px;
  font-family: var(--font);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.followup-input:focus {
  border-color: transparent;
  box-shadow: var(--shadow-hover);
}

.followup-input::placeholder {
  color: var(--text-secondary);
}

.followup-send {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--ai-accent);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}

.followup-send:hover {
  background: #6a4ce0;
}

/* === FOOTER === */
.footer {
  padding: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: auto;
}

.footer a {
  color: var(--text-secondary);
  text-decoration: none;
  margin: 0 12px;
}

.footer a:hover {
  color: var(--text);
}

/* === LEGAL PAGES === */
.legal {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 20px;
}

.legal h1 {
  font-size: 28px;
  margin-bottom: 8px;
}

.legal .last-updated {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 32px;
}

.legal h2 {
  font-size: 20px;
  margin: 28px 0 12px;
}

.legal p, .legal li {
  line-height: 1.7;
  margin: 8px 0;
  color: var(--text-secondary);
}

.legal ul {
  padding-left: 24px;
}

.legal a {
  color: var(--accent);
}

/* === RESPONSIVE === */
@media (max-width: 600px) {
  .home { justify-content: flex-start; padding-top: 15vh; }
  .logo { font-size: 42px; margin-bottom: 20px; }
  .goose-mascot svg { width: 50px; height: 50px; }
  .search-bar { height: 44px; font-size: 15px; }
  .results-header { flex-direction: column; gap: 12px; }
  .results-search-container { width: 100%; }
  .cta-text { font-size: 13px; }
  .ai-response { font-size: 15px; }
  .trending-section { padding: 0 10px; }
}
