/* =========================================================
   LEARNING REWIRED LAB — Search Page
   Ask the Lab / LLM-ready search experience
   File: /assets/css/search.css
   ========================================================= */

.search-page {
  min-height: 100vh;
  padding: clamp(64px, 8vw, 118px) 24px clamp(88px, 10vw, 140px);
  background:
    radial-gradient(circle at 86% 12%, rgba(37, 99, 235, 0.10), transparent 30%),
    radial-gradient(circle at 12% 84%, rgba(20, 184, 166, 0.08), transparent 34%),
    #ffffff;
  color: #07111f;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

.search-page *,
.search-page *::before,
.search-page *::after {
  box-sizing: border-box;
}

.search-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.search-page h1,
.search-page h2,
.search-page h3,
.search-page p {
  margin-top: 0;
}

.search-page a {
  color: inherit;
}

/* =========================================================
   Hero
   ========================================================= */

.search-hero {
  max-width: 960px;
  margin: 0 auto clamp(34px, 5vw, 58px);
  text-align: center;
}

.search-eyebrow,
.search-kicker {
  display: inline-flex;
  margin: 0 0 22px;
  padding: 10px 14px;
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.10), rgba(124, 58, 237, 0.10), rgba(20, 184, 166, 0.10));
  color: #123f9c;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.17em;
  line-height: 1;
  text-transform: uppercase;
}

.search-kicker {
  margin-bottom: 12px;
  background: rgba(37, 99, 235, 0.08);
}

.search-hero h1 {
  margin: 0;
  color: #07111f;
  font-size: clamp(52px, 7vw, 96px);
  line-height: 0.96;
  letter-spacing: -0.07em;
  font-weight: 720;
  text-wrap: balance;
}

.search-hero > p {
  max-width: 790px;
  margin: 28px auto 0;
  color: #5f6b7a;
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.7;
}

/* =========================================================
   Main ask form
   ========================================================= */

.search-form {
  margin-top: 36px;
}

.search-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.search-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  max-width: 860px;
  margin: 0 auto;
  padding: 10px;
  border: 1px solid rgba(15, 23, 42, 0.09);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow:
    0 18px 52px rgba(15, 23, 42, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.search-input {
  width: 100%;
  min-height: 56px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #07111f;
  font: inherit;
  font-size: 17px;
  font-weight: 650;
  outline: none;
}

.search-input::placeholder {
  color: #7a8594;
  font-weight: 600;
}

.search-submit {
  min-height: 56px;
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #07111f 0%, #123f9c 54%, #2563eb 100%);
  color: #ffffff;
  font: inherit;
  font-size: 15px;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.22);
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    background 0.22s ease;
}

.search-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(37, 99, 235, 0.26);
}

/* =========================================================
   Example prompt chips
   ========================================================= */

.search-example-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 920px;
  margin: 22px auto 0;
}

.search-example {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #334155;
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.045);
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease,
    color 0.2s ease;
}

.search-example:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.28);
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.09), rgba(124, 58, 237, 0.08), rgba(20, 184, 166, 0.08));
  color: #123f9c;
}

/* =========================================================
   Intelligence panel
   ========================================================= */

.search-intelligence-panel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 0 0 28px;
}

.search-intelligence-panel article {
  min-height: 230px;
  padding: 24px;
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.055);
}

.search-intelligence-panel span {
  display: inline-flex;
  margin-bottom: 22px;
  color: #123f9c;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.search-intelligence-panel h2 {
  margin: 0 0 12px;
  color: #07111f;
  font-size: clamp(26px, 2.8vw, 36px);
  line-height: 1.02;
  letter-spacing: -0.052em;
  font-weight: 700;
}

.search-intelligence-panel p {
  margin: 0;
  color: #5f6b7a;
  font-size: 15.5px;
  line-height: 1.62;
}

/* =========================================================
   Lab response
   ========================================================= */

.search-response-section {
  margin: 28px 0;
  padding: clamp(24px, 4vw, 36px);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 34px;
  background:
    radial-gradient(circle at 96% 8%, rgba(37, 99, 235, 0.08), transparent 32%),
    radial-gradient(circle at 8% 96%, rgba(20, 184, 166, 0.07), transparent 36%),
    rgba(255, 255, 255, 0.94);
  box-shadow:
    0 22px 62px rgba(15, 23, 42, 0.07),
    inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.search-response-topline {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.search-response-topline h2 {
  margin: 0;
  color: #07111f;
  font-size: clamp(32px, 4vw, 52px);
  line-height: 0.98;
  letter-spacing: -0.058em;
  font-weight: 720;
}

.search-reset {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 999px;
  background: #ffffff;
  color: #334155;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.search-reset:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.24);
  color: #123f9c;
}

/* Loading state */

.search-loading {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border-radius: 24px;
  background: rgba(248, 250, 252, 0.88);
}

.search-loading p {
  margin: 0;
  color: #475569;
  font-size: 15px;
  font-weight: 800;
}

.search-loader {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(37, 99, 235, 0.16);
  border-top-color: #2563eb;
  border-radius: 999px;
  animation: searchSpin 0.8s linear infinite;
}

@keyframes searchSpin {
  to {
    transform: rotate(360deg);
  }
}

/* AI response container */

.search-ai-response {
  display: grid;
  gap: 18px;
}

.search-ai-response-card {
  padding: 22px;
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: 26px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.05);
}

.search-ai-response-card h3 {
  margin: 0 0 10px;
  color: #07111f;
  font-size: clamp(24px, 2.6vw, 34px);
  line-height: 1.04;
  letter-spacing: -0.046em;
}

.search-ai-response-card p,
.search-ai-response-card li {
  color: #5f6b7a;
  font-size: 16px;
  line-height: 1.65;
}

.search-ai-response-card p {
  margin: 0;
}

.search-ai-response-card ul,
.search-ai-response-card ol {
  margin: 10px 0 0;
  padding-left: 20px;
}

.search-ai-response-card li + li {
  margin-top: 8px;
}

/* Fallback / starting state */

.search-fallback-results {
  display: block;
}

.search-empty {
  padding: clamp(28px, 4vw, 42px);
  border: 1px dashed rgba(37, 99, 235, 0.24);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.86);
  text-align: center;
}

.search-empty h2,
.search-empty h3 {
  margin: 0 0 12px;
  color: #07111f;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1;
  letter-spacing: -0.05em;
}

.search-empty p {
  max-width: 660px;
  margin: 0 auto;
  color: #5f6b7a;
  font-size: 17px;
  line-height: 1.65;
}

.search-workbench-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-top: 22px;
  padding: 0 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, #07111f 0%, #123f9c 54%, #2563eb 100%);
  color: #ffffff !important;
  font-size: 14px;
  font-weight: 950;
  line-height: 1;
  text-decoration: none !important;
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.20);
}

/* =========================================================
   Filters
   ========================================================= */

.search-tools {
  margin-bottom: 28px;
}

.search-filter-group {
  padding: clamp(20px, 3vw, 28px);
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: 30px;
  background: #ffffff;
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.055);
}

.search-filter-group p {
  margin: 0 0 16px;
  color: #123f9c;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.search-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.search-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 999px;
  background: #ffffff;
  color: #334155;
  font: inherit;
  font-size: 14px;
  font-weight: 850;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease,
    color 0.2s ease;
}

.search-chip:hover,
.search-chip.active {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.22);
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.09), rgba(124, 58, 237, 0.08), rgba(20, 184, 166, 0.08));
  color: #123f9c;
}

/* =========================================================
   Public resource results
   ========================================================= */

.search-results-section {
  margin-top: 28px;
}

.search-results-topline {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}

.search-results-topline p {
  margin: 0;
  color: #64748b;
  font-size: 14px;
  font-weight: 850;
}

.search-results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.search-result-card {
  display: flex;
  flex-direction: column;
  min-height: 280px;
  padding: 24px;
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: 30px;
  background: #ffffff;
  color: inherit;
  text-decoration: none !important;
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.055);
  transition:
    transform 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease;
}

.search-result-card:hover {
  transform: translateY(-4px);
  border-color: rgba(37, 99, 235, 0.18);
  box-shadow: 0 24px 58px rgba(15, 23, 42, 0.09);
}

.search-result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.search-result-type,
.search-result-status {
  display: inline-flex;
  width: fit-content;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
}

.search-result-type {
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.10), rgba(124, 58, 237, 0.09), rgba(20, 184, 166, 0.09));
  color: #123f9c;
}

.search-result-status {
  background: rgba(20, 184, 166, 0.11);
  color: #0f766e;
}

.search-result-card h2 {
  margin: 0 0 14px;
  color: #07111f;
  font-size: clamp(26px, 2.8vw, 36px);
  line-height: 1.02;
  letter-spacing: -0.05em;
  font-weight: 680;
}

.search-result-card p {
  margin: 0;
  color: #5f6b7a;
  font-size: 15px;
  line-height: 1.62;
}

.search-result-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 24px;
}

.search-result-tags span {
  display: inline-flex;
  padding: 7px 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.05);
  color: #475569;
  font-size: 12px;
  font-weight: 850;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 980px) {
  .search-intelligence-panel,
  .search-results-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .search-intelligence-panel article:nth-child(3) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .search-page {
    padding: 52px 18px 88px;
  }

  .search-hero {
    text-align: left;
  }

  .search-hero h1 {
    font-size: clamp(46px, 14vw, 70px);
    line-height: 1;
  }

  .search-hero > p {
    margin-left: 0;
  }

  .search-input-row {
    grid-template-columns: 1fr;
    border-radius: 28px;
  }

  .search-input {
    min-height: 54px;
    padding: 0 16px;
  }

  .search-submit {
    width: 100%;
  }

  .search-example-row {
    justify-content: flex-start;
  }

  .search-intelligence-panel,
  .search-results-grid {
    grid-template-columns: 1fr;
  }

  .search-intelligence-panel article:nth-child(3) {
    grid-column: auto;
  }

  .search-response-section {
    border-radius: 30px;
  }

  .search-response-topline {
    align-items: flex-start;
    flex-direction: column;
  }

  .search-results-topline {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .search-page {
    padding-left: 14px;
    padding-right: 14px;
  }

  .search-hero h1 {
    letter-spacing: -0.06em;
  }

  .search-example {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
  }

  .search-intelligence-panel article,
  .search-result-card,
  .search-filter-group,
  .search-response-section {
    border-radius: 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .search-chip,
  .search-example,
  .search-result-card,
  .search-submit,
  .search-reset,
  .search-workbench-cta {
    transition: none !important;
  }

  .search-chip:hover,
  .search-example:hover,
  .search-result-card:hover,
  .search-submit:hover,
  .search-reset:hover {
    transform: none !important;
  }

  .search-loader {
    animation: none !important;
  }
}
