/* TW Agribot — ChatGPT-style public shell v2 */
:root {
  --tw-ink: #0d0d0d;
  --tw-muted: #8e8e8e;
  --tw-border: rgba(0, 0, 0, 0.08);
  --tw-sidebar: #f9f9f9;
  --tw-main: #ffffff;
  --tw-composer: #f4f4f4;
  --tw-accent: #0f766e;
  --tw-accent-soft: rgba(15, 118, 110, 0.12);
}

html,
body {
  min-height: 100%;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}

html body {
  background: var(--tw-main) !important;
  color: var(--tw-ink) !important;
}

main,
[class*="h-screen"],
[class*="min-h-screen"] {
  background: var(--tw-main) !important;
}

/* ========== Sidebar ========== */
nav.grid {
  width: 280px !important;
  background: var(--tw-sidebar) !important;
  border-right: 1px solid var(--tw-border) !important;
}

/* Remove mint/green empty history slab + gradients */
nav.grid > div,
nav.grid .scrollbar-custom,
nav.grid [class*="from-app"],
nav.grid [class*="to-app"],
nav.grid [class*="bg-gradient"],
nav.grid [class*="from-"],
nav.grid [class*="rounded-r-xl"] {
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}

/* Header stack: logo row, then full-width New Chat */
nav.grid > div:first-child {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  gap: 0.7rem !important;
  padding: 0.9rem 0.85rem 0.85rem !important;
  border-bottom: 1px solid var(--tw-border) !important;
}

nav.grid > div:first-child > a:has(img),
nav.grid > div:first-child > a[href^="https://"] {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.55rem !important;
  width: 100% !important;
  max-width: 100% !important;
  font-weight: 600 !important;
  font-size: 0.95rem !important;
  color: var(--tw-ink) !important;
  letter-spacing: -0.015em !important;
}

nav.grid img[alt*="logo" i] {
  width: 1.55rem !important;
  height: 1.55rem !important;
  object-fit: contain !important;
}

/* New Chat — ChatGPT full-width button with + */
nav.grid a[href="/"][class*="border"] {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 0.6rem !important;
  width: 100% !important;
  flex: none !important;
  margin: 0 !important;
  padding: 0.7rem 0.85rem !important;
  border-radius: 0.85rem !important;
  border: 1px solid var(--tw-border) !important;
  background: #ffffff !important;
  color: var(--tw-ink) !important;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  box-shadow: none !important;
  line-height: 1.2 !important;
}

nav.grid a[href="/"][class*="border"]::before {
  content: "+" !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 1.3rem !important;
  height: 1.3rem !important;
  border-radius: 0.4rem !important;
  background: var(--tw-accent) !important;
  color: #fff !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  line-height: 1 !important;
}

nav.grid a[href="/"][class*="border"]:hover {
  background: #f3f3f3 !important;
  border-color: rgba(15, 118, 110, 0.3) !important;
  transform: none !important;
  box-shadow: none !important;
}

/* Empty conversation list: quiet placeholder feel */
nav.grid .scrollbar-custom:empty::after,
nav.grid > div:nth-child(2):empty::after {
  content: "Your chats will appear here";
  display: block;
  padding: 0.85rem 1rem;
  color: #a3a3a3;
  font-size: 0.8rem;
}

nav.grid > div:nth-child(2) {
  min-height: 8rem;
}

/* Footer links */
nav.grid a[href="/models"],
nav.grid a[href="/privacy"],
nav.grid button {
  border-radius: 0.75rem !important;
  color: #525252 !important;
}

nav.grid a[href="/models"]:hover,
nav.grid a[href="/privacy"]:hover,
nav.grid button:hover {
  background: rgba(0, 0, 0, 0.04) !important;
}

/* ========== Hero ========== */
h1 {
  letter-spacing: -0.045em !important;
  color: var(--tw-ink) !important;
  font-weight: 650 !important;
  font-size: clamp(1.85rem, 2.8vw, 2.25rem) !important;
}

/* Hide version chip (v0.9.2) next to hero title */
span[class*="rounded-full"],
div:has(> img[alt*="logo" i]) > span,
div:has(> img[alt*="logo" i]) > *:not(img):not(p):not(a):not(h1):not(button) {
  display: none !important;
}

/* Keep logo + title text visible if title is not a separate element */
div:has(> img[alt*="logo" i]) {
  gap: 0.65rem !important;
}

h1 + p,
p[class*="text-gray"] {
  color: var(--tw-muted) !important;
  max-width: 36rem !important;
  margin-left: auto !important;
  margin-right: auto !important;
  line-height: 1.45 !important;
}

/* Example suggestion cards */
div:has(> button + button + button) {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  gap: 0.75rem !important;
  max-width: 52rem !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

div:has(> button + button + button) > button {
  background: #fff !important;
  border: 1px solid var(--tw-border) !important;
  border-radius: 1rem !important;
  box-shadow: none !important;
  color: var(--tw-ink) !important;
  padding: 0.9rem 1.05rem !important;
  font-weight: 500 !important;
  min-width: 10.5rem !important;
}

div:has(> button + button + button) > button:hover {
  background: #f7f7f7 !important;
  border-color: rgba(15, 118, 110, 0.35) !important;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.05) !important;
}

/* ========== Composer ========== */
textarea,
input[type="text"] {
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

div:has(> textarea) {
  max-width: 48rem !important;
  margin-left: auto !important;
  margin-right: auto !important;
  border-radius: 1.75rem !important;
  background: var(--tw-composer) !important;
  border: 1px solid var(--tw-border) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 10px 28px rgba(0, 0, 0, 0.04) !important;
}

div:has(> textarea):focus-within {
  border-color: rgba(15, 118, 110, 0.35) !important;
  box-shadow: 0 0 0 3px var(--tw-accent-soft), 0 10px 28px rgba(0, 0, 0, 0.05) !important;
}

textarea:focus,
input[type="text"]:focus {
  outline: none !important;
  box-shadow: none !important;
}

button[type="submit"],
button[aria-label*="Send" i],
div:has(> textarea) > button {
  background: var(--tw-accent) !important;
  color: #fff !important;
  border-radius: 9999px !important;
}

footer,
.footer,
p.text-xs,
p[class*="text-xs"] {
  color: var(--tw-muted) !important;
}

/* Disclaimer modal */
dialog,
[role="dialog"] {
  border: 1px solid var(--tw-border) !important;
  border-radius: 1.15rem !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18) !important;
}

[role="dialog"] button,
dialog button {
  background: var(--tw-accent) !important;
  color: #fff !important;
  border-radius: 9999px !important;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
*::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 999px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}

/* Dark mode */
html.dark body,
:root.dark body,
[data-theme="dark"] body {
  background: #212121 !important;
  color: #ececec !important;
}

html.dark nav.grid,
:root.dark nav.grid,
[data-theme="dark"] nav.grid {
  background: #171717 !important;
  border-right-color: rgba(255, 255, 255, 0.08) !important;
}

html.dark nav.grid > div:first-child,
:root.dark nav.grid > div:first-child {
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

html.dark nav.grid a[href="/"][class*="border"],
:root.dark nav.grid a[href="/"][class*="border"] {
  background: #212121 !important;
  color: #ececec !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

html.dark div:has(> textarea),
:root.dark div:has(> textarea) {
  background: #2f2f2f !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

html.dark div:has(> button + button + button) > button,
:root.dark div:has(> button + button + button) > button {
  background: #2f2f2f !important;
  color: #ececec !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}
