/* ─── Reset ─────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ─── Variables ─────────────────────────────────────── */
:root {
  --bg:            #ffffff;
  --surface:       #f6f8fa;
  --border:        #e1e4e8;
  --text-primary:  #16191f;
  --text-secondary:#687078;
  --accent:        #FF9900;
  --accent-dark:   #e08600;
  --accent-light:  #fff8ec;
  --navy:          #232F3E;
  --radius-sm:     8px;
  --radius:        12px;
  --radius-lg:     16px;
  --shadow-sm:     0 1px 4px rgba(0,0,0,0.07);
  --shadow:        0 2px 12px rgba(0,0,0,0.08);
  --shadow-focus:  0 0 0 3px rgba(255,153,0,0.2);
  --transition:    0.18s ease;
}

/* ─── Base ──────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }

/* ─── Page shell ────────────────────────────────────── */
.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ─── Header ────────────────────────────────────────── */
.header {
  padding: 18px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
}

.nav-brand {
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.3px;
  cursor: default;
}

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

/* ─── Main (homepage) ───────────────────────────────── */
.main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px 64px;
}

.hero {
  width: 100%;
  max-width: 660px;
  text-align: center;
}

/* ─── Logo ──────────────────────────────────────────── */
.logo {
  margin-bottom: 40px;
}

.logo-icon {
  font-size: 52px;
  display: block;
  margin-bottom: 12px;
  line-height: 1;
}

.logo-text {
  font-size: 40px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -1.5px;
  margin-bottom: 10px;
}

.tagline {
  font-size: 16px;
  color: var(--text-secondary);
  font-weight: 400;
}

/* ─── Search form ───────────────────────────────────── */
.search-form {
  margin-bottom: 36px;
}

.search-wrapper {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.search-input {
  flex: 1;
  padding: 15px 18px;
  font-size: 15px;
  font-family: inherit;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  background: var(--bg);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
  min-width: 0;
}

.search-input::placeholder {
  color: #b0b8c1;
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: var(--shadow-focus);
}

.search-btn {
  padding: 15px 28px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), transform 0.1s;
  white-space: nowrap;
  flex-shrink: 0;
}

.search-btn:hover  { background: var(--accent-dark); }
.search-btn:active { transform: scale(0.97); }

/* ─── Format hint ───────────────────────────────────── */
.format-hint {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: left;
  padding-left: 2px;
  line-height: 1.5;
}

.hint-label {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent);
  background: var(--accent-light);
  border: 1px solid #ffe5b0;
  border-radius: 4px;
  padding: 2px 7px;
  margin-right: 8px;
  vertical-align: middle;
}

.format-hint strong {
  color: var(--navy);
  font-weight: 600;
}

/* ─── Example chips ─────────────────────────────────── */
.examples {
  text-align: center;
}

.examples-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

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

.chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 8px 16px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  max-width: 340px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.chip:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ─── Footer ────────────────────────────────────────── */
.footer {
  padding: 18px 32px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer p {
  font-size: 13px;
  color: var(--text-secondary);
}

.footer a {
  color: var(--accent);
  font-weight: 500;
}

.footer a:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════════════
   RESULTS PAGE
═══════════════════════════════════════════════════════ */

/* Results header */
.results-header { padding: 14px 32px; }

.results-nav {
  gap: 20px;
  justify-content: space-between;
}

.results-nav .nav-brand {
  flex-shrink: 0;
  font-size: 16px;
  cursor: pointer;
}

.results-nav .nav-brand:hover .accent { text-decoration: underline; }

.results-search-wrapper {
  display: flex;
  gap: 8px;
  flex: 1;
  max-width: 580px;
}

.results-search-input {
  flex: 1;
  padding: 11px 16px;
  font-size: 14px;
  font-family: inherit;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--bg);
  color: var(--text-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
  min-width: 0;
}

.results-search-input:focus {
  border-color: var(--accent);
  box-shadow: var(--shadow-focus);
}

.results-search-input::placeholder { color: #b0b8c1; }

.results-search-wrapper .search-btn {
  padding: 11px 22px;
  font-size: 14px;
  border-radius: var(--radius-sm);
}

/* Results main */
.results-main {
  flex: 1;
  padding: 32px 24px 48px;
}

.results-container {
  max-width: 1000px;
  margin: 0 auto;
}

/* Query display */
.query-display {
  margin-bottom: 28px;
}

.query-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.query-text {
  font-size: 18px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: -0.3px;
  line-height: 1.4;
}

/* Results grid */
.results-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

/* Result cards */
.result-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

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

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.card-icon {
  font-size: 20px;
  line-height: 1;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: -0.2px;
}

.card-body {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.placeholder-body {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 13px;
  padding: 8px 0;
}

.placeholder-body::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.8); }
}

/* Back bar */
.back-bar {
  display: flex;
  align-items: center;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--surface);
  transition: all var(--transition);
}

.back-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ─── Responsive ────────────────────────────────────── */
@media (max-width: 700px) {
  .search-wrapper    { flex-direction: column; }
  .search-btn        { width: 100%; }
  .logo-text         { font-size: 30px; }
  .chip              { max-width: 100%; white-space: normal; }

  .results-nav       { flex-wrap: wrap; gap: 12px; }
  .results-search-wrapper { max-width: 100%; }
  .results-grid      { grid-template-columns: 1fr; }
}
