/*
 * TimAPI pricing theme.
 *
 * This file is loaded by the Hong Kong edge for New API HTML responses. The
 * html[data-timapi-pricing] scope is toggled by timapi-pricing.js so SPA
 * navigation in and out of /pricing does not leak the theme into other pages.
 */

html[data-timapi-pricing],
html[data-timapi-pricing].dark {
  --background: #ffffff !important;
  --foreground: #0b1220 !important;
  --card: #ffffff !important;
  --card-foreground: #0b1220 !important;
  --popover: #ffffff !important;
  --popover-foreground: #0b1220 !important;
  --primary: #1d4ed8 !important;
  --primary-foreground: #ffffff !important;
  --secondary: #f7f8fa !important;
  --secondary-foreground: #1c273b !important;
  --muted: #f7f8fa !important;
  --muted-foreground: #5b6779 !important;
  --accent: #eef3ff !important;
  --accent-foreground: #173ea8 !important;
  --border: #e4e8ef !important;
  --input: #e4e8ef !important;
  --ring: #1d4ed8 !important;
  --radius: 0.55rem !important;
  color-scheme: light;
  background: #ffffff !important;
}

html[data-timapi-pricing] body {
  background: #ffffff !important;
  color: #0b1220 !important;
}

html[data-timapi-pricing] #root > div {
  background: #ffffff !important;
}

/* The upstream page paints a blue, cyan and violet glow behind the hero. */
html[data-timapi-pricing] #root > div > div.relative > div.pointer-events-none {
  display: none !important;
}

/* Hero: use the same restrained eyebrow, ink and muted-copy hierarchy as home. */
html[data-timapi-pricing] h1 {
  color: #0b1220 !important;
  font-size: clamp(2.15rem, 4.7vw, 3.35rem) !important;
  letter-spacing: -0.045em !important;
}

html[data-timapi-pricing] h1::before {
  content: "MODEL DIRECTORY  /  LIVE PRICING";
  display: block;
  margin-bottom: 0.8rem;
  color: #1d4ed8;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.4;
}

html[data-timapi-pricing] h1 + p {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  margin-inline: auto;
  padding: 0.24rem 0.65rem;
  border: 1px solid #cfe9dd;
  border-radius: 999px;
  background: #ecf8f2;
  color: #087a55 !important;
  font-size: 0.75rem;
  font-weight: 600;
}

html[data-timapi-pricing] h1 + p::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 0.45rem;
  border-radius: 50%;
  background: #087a55;
  box-shadow: 0 0 0 3px rgba(8, 122, 85, 0.1);
}

html[data-timapi-pricing] h1 + p + p {
  max-width: 680px;
  margin: 0.8rem auto 0;
  color: #5b6779 !important;
  font-size: 0.9rem;
  line-height: 1.7;
}

/* Search field: white paper, crisp border, quiet depth. */
html[data-timapi-pricing] input {
  border-color: #dfe4ec !important;
  background: #ffffff !important;
  color: #0b1220 !important;
  box-shadow: 0 1px 2px rgba(11, 18, 32, 0.025);
}

html[data-timapi-pricing] input::placeholder {
  color: #8b96a8 !important;
}

html[data-timapi-pricing] input:hover {
  border-color: #c8d1df !important;
}

html[data-timapi-pricing] input:focus {
  border-color: rgba(29, 78, 216, 0.58) !important;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.1) !important;
}

/* Filter rail and result toolbar. */
html[data-timapi-pricing] #root aside {
  border-color: #e4e8ef !important;
  background: #fbfcfd !important;
  box-shadow: 0 1px 2px rgba(11, 18, 32, 0.025);
}

html[data-timapi-pricing] #root main > div.bg-card {
  border-color: #e4e8ef !important;
  background: #ffffff !important;
  box-shadow: 0 1px 2px rgba(11, 18, 32, 0.025);
}

html[data-timapi-pricing] #root aside [data-slot="collapsible"] {
  border-color: #edf0f5 !important;
}

html[data-timapi-pricing] #root aside [data-slot="collapsible-trigger"] {
  color: #1c273b;
}

html[data-timapi-pricing] #root aside [data-slot="collapsible-trigger"]:hover {
  color: #1d4ed8;
}

/* Selected chips and view toggles use the same ink treatment as the homepage. */
html[data-timapi-pricing] #root aside button[aria-pressed="true"],
html[data-timapi-pricing] #root main button[aria-pressed="true"] {
  border-color: #0b1220 !important;
  background: #0b1220 !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

html[data-timapi-pricing] #root aside button:not([aria-pressed="true"]):hover,
html[data-timapi-pricing] #root main button:not([aria-pressed="true"]):hover {
  border-color: #d7dee9;
}

/* Model cards. */
html[data-timapi-pricing] [data-slot="card"] {
  border-radius: 13px !important;
  background: #ffffff !important;
  box-shadow:
    0 1px 2px rgba(11, 18, 32, 0.03),
    0 0 0 1px #e4e8ef !important;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

html[data-timapi-pricing] [data-slot="card"]:hover {
  background: #ffffff !important;
  transform: translateY(-1px);
  box-shadow:
    0 8px 22px rgba(11, 18, 32, 0.055),
    0 0 0 1px #c9d3e1 !important;
}

html[data-timapi-pricing] [data-slot="card-header"] > div[aria-hidden="true"] {
  border: 1px solid #dce6ff;
  background: #eef3ff !important;
}

html[data-timapi-pricing] [data-slot="card"] h3 {
  color: #0b1220 !important;
  font-weight: 650;
}

html[data-timapi-pricing] [data-slot="card-footer"] > div {
  border-color: #edf0f5 !important;
}

html[data-timapi-pricing] [data-slot="status-badge"] {
  width: fit-content;
  padding: 2px 7px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.69rem;
  font-weight: 600;
  letter-spacing: 0;
}

html[data-timapi-pricing] [data-slot="status-badge"].text-warning {
  border-color: #f0d79d;
  background: #fff8e6;
  color: #8a5a00 !important;
}

html[data-timapi-pricing] [data-slot="status-badge"].text-info {
  border-color: #d3ddff;
  background: #eef3ff;
  color: #173ea8 !important;
}

html[data-timapi-pricing] [role="group"][aria-label="Pricing"] .font-mono {
  color: #0b1220 !important;
}

html[data-timapi-pricing] [role="group"][aria-label="Pricing"] .font-mono > span:first-child {
  color: #173ea8 !important;
  font-weight: 700;
}

html[data-timapi-pricing] .text-warning {
  color: #8a5a00 !important;
}

html[data-timapi-pricing] .text-info {
  color: #173ea8 !important;
}

html[data-timapi-pricing] [class*="text-emerald"] {
  color: #087a55 !important;
}

html[data-timapi-pricing] [class*="bg-emerald-500"] {
  background-color: #087a55 !important;
}

html[data-timapi-pricing] [class*="text-red"],
html[data-timapi-pricing] [class*="text-destructive"] {
  color: #c81e3a !important;
}

html[data-timapi-pricing] [class*="bg-red-"],
html[data-timapi-pricing] [class*="bg-destructive"] {
  background-color: #c81e3a !important;
}

html[data-timapi-pricing] .text-primary {
  color: #1d4ed8 !important;
}

html[data-timapi-pricing] .bg-primary {
  background-color: #1d4ed8 !important;
}

/* Keep the pricing footer and pagination inside the same quiet system. */
html[data-timapi-pricing] #root main > div > div.border-t {
  border-color: #e4e8ef !important;
}

html[data-timapi-pricing] #root main [data-slot="button"] {
  border-color: transparent;
}

html[data-timapi-pricing] #root main [data-slot="button"]:not([aria-pressed="true"]):hover {
  border-color: #dfe4ec;
  background: #f7f8fa !important;
}

@media (max-width: 639px) {
  html[data-timapi-pricing] h1 {
    font-size: 2rem !important;
    letter-spacing: -0.035em !important;
  }

  html[data-timapi-pricing] h1::before {
    margin-bottom: 0.55rem;
    font-size: 0.61rem;
  }

  html[data-timapi-pricing] h1 + p {
    font-size: 0.69rem;
  }

  html[data-timapi-pricing] h1 + p + p {
    padding-inline: 0.65rem;
    font-size: 0.82rem;
    line-height: 1.6;
  }

  html[data-timapi-pricing] [data-slot="card"]:hover {
    transform: none;
  }
}

/* Brand hero: a decisive ink panel replaces the generic upstream header. */
html[data-timapi-pricing] header:has(h1) {
  margin-top: 1.75rem !important;
  padding: 2.5rem 2rem 1.75rem !important;
  border: 1px solid #1c273b !important;
  border-radius: 18px !important;
  background-color: #0b1220 !important;
  background-image: linear-gradient(90deg, #1d4ed8 0, #1d4ed8 88px, transparent 88px) !important;
  background-repeat: no-repeat !important;
  background-size: 100% 3px !important;
  box-shadow: 0 18px 45px rgba(11, 18, 32, 0.12) !important;
}

html[data-timapi-pricing] header:has(h1) h1 {
  color: #ffffff !important;
}

html[data-timapi-pricing] header:has(h1) h1::before {
  color: #78a6ff !important;
}

html[data-timapi-pricing] header:has(h1) h1 + p {
  border-color: rgba(126, 223, 183, 0.32) !important;
  background: rgba(8, 122, 85, 0.2) !important;
  color: #9be6c9 !important;
}

html[data-timapi-pricing] header:has(h1) h1 + p::before {
  background: #7edfb7 !important;
  box-shadow: 0 0 0 3px rgba(126, 223, 183, 0.12) !important;
}

html[data-timapi-pricing] header:has(h1) h1 + p + p {
  color: #b8c4d8 !important;
}

html[data-timapi-pricing] header:has(h1) input {
  height: 46px !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  background: rgba(255, 255, 255, 0.07) !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

html[data-timapi-pricing] header:has(h1) input::placeholder {
  color: #aab6c9 !important;
}

html[data-timapi-pricing] header:has(h1) input:focus {
  border-color: rgba(120, 166, 255, 0.76) !important;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.22) !important;
}

@media (max-width: 639px) {
  html[data-timapi-pricing] header:has(h1) {
    margin-top: 0.75rem !important;
    padding: 1.75rem 1rem 1.25rem !important;
    border-radius: 15px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html[data-timapi-pricing] [data-slot="card"] {
    transition: none;
  }
}
