/**
 * src/css/pages/dobo.css — dedicated DoBo page (AI-Studio/Gemini layout).
 * Owns dobo.html only. Reuses component classes from dobo2-dock.css
 * (bubbles, traces, cards, composer) + tokens from design-system.css.
 *
 * RK review (2026-08-01): dobo.html now uses the STANDARD app shell (the
 * same left sidebar-nav + topbar as index.html — see index.html/styles.css/
 * design-system.css for those). This file therefore only owns the CONTENT
 * area rendered inside <div class="main-content">: a flex row (.dobo-layout)
 * with the workspace (hero → thread → composer) on the left and the session
 * rail as a fixed-width column on the RIGHT (border-left, not border-right,
 * per RK: "keep the main navbar of the app same, give another nav bar
 * (sessions) on the right"). On <=900px the rail becomes a right-side
 * off-canvas drawer with a scrim, toggled from the header's
 * #doboRailToggle button (see dobo.html / dobo-page.js).
 */

#doboPage { color: var(--text-1, #0f172a); }
#doboPage *, #doboPage *::before, #doboPage *::after { box-sizing: border-box; }

.dobo-rail-toggle { display: none; }

/* ── Layout: fills the standard <div class="main-content"> content area ──── */
.dobo-layout { flex: 1; display: flex; min-height: 0; overflow: hidden; }

/* ── Session rail — RIGHT column (desktop) ──────────────────────────────── */
.dobo-rail {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border-soft, #e8edf3);
  background: #ffffff;
  min-height: 0;
  order: 2; /* after .dobo-main in DOM/tab order, i.e. visually on the right */
}
.dobo-main { order: 1; }
.dobo-rail-head { padding: 14px 14px 8px; }
.dobo-newchat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  border: none;
  border-radius: 12px;
  background: var(--amber-500, #fea619);
  color: var(--on-amber, #3d2800);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(254,166,25,.3);
  transition: filter .13s ease, transform .1s ease;
}
.dobo-newchat:hover { filter: brightness(1.05); }
.dobo-newchat:active { transform: scale(.98); }
.dobo-newchat svg { width: 16px; height: 16px; }
.dobo-rail-search {
  position: relative;
  padding: 4px 14px 10px;
}
.dobo-rail-search svg {
  position: absolute;
  left: 25px;
  top: 14px;
  width: 15px;
  height: 15px;
  color: var(--text-4, #94a3b8);
  pointer-events: none;
}
.dobo-rail-search input {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  background: var(--bg-app, #f8fafc);
  padding: 0 10px 0 34px;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--text-1);
  outline: none;
  transition: border-color .13s ease, background .13s ease, box-shadow .13s ease;
}
.dobo-rail-search input:focus { border-color: var(--navy-400, #3f6ea8); background: #fff; box-shadow: 0 0 0 3px rgba(2,36,72,.08); }
.dobo-rail-list { flex: 1; overflow-y: auto; padding: 0 8px 14px; min-height: 0; }
.dobo-rail-list::-webkit-scrollbar { width: 5px; }
.dobo-rail-list::-webkit-scrollbar-thumb { background: #E2E8F0; border-radius: 3px; }
.dobo-rail-group {
  padding: 12px 8px 5px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-4, #94a3b8);
}
.dobo-rail-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 10px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--text-2, #334155);
  font-size: 13px;
  font-weight: 500;
  transition: background .12s ease;
}
.dobo-rail-item:hover { background: #F8FAFC; }
.dobo-rail-item.active { background: #FFF7E8; color: #0f172a; }
.dobo-rail-item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dobo-rail-item .dobo2-mini { visibility: hidden; }
.dobo-rail-item:hover .dobo2-mini { visibility: visible; }
.dobo-rail-empty { padding: 24px 12px; text-align: center; font-size: 12.5px; color: var(--text-4); }

/* ── Main / hero — centered in the space remaining next to the rail ──────── */
.dobo-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  position: relative;
  background: #FBFCFE;
}
.dobo-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  overflow-y: auto;
  min-height: 0;
}
.dobo-main.started .dobo-hero { display: none; }
.dobo-hero-spark {
  width: 54px;
  height: 54px;
  color: #7c5cff;
  filter: drop-shadow(0 6px 20px rgba(124,92,255,.35));
  animation: dobo2-bob 3.2s ease-in-out infinite;
}
.dobo-hero-spark svg { width: 100%; height: 100%; }
.dobo-hero-title {
  margin: 4px 0 0;
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 800;
  letter-spacing: -.025em;
  text-align: center;
  background: linear-gradient(92deg, #022448 15%, #7c5cff 55%, #fea619 95%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.dobo-hero-wave { -webkit-text-fill-color: initial; }
.dobo-hero-sub {
  margin: 0 0 14px;
  font-size: 14.5px;
  color: var(--text-3, #64748b);
  text-align: center;
  max-width: 46ch;
}
.dobo-hero-mount { width: min(720px, 94%); }

/* Hero variant of the composer: Gemini-style gradient-edged card */
.dobo-hero-mount .dobo-composer { padding: 0; }
.dobo-hero-mount .dobo-inputwrap {
  position: relative;
  border: none;
  border-radius: 22px;
  padding: 16px 16px 12px;
  box-shadow: 0 10px 40px rgba(2,36,72,.10), 0 2px 8px rgba(2,36,72,.05);
}
.dobo-hero-mount .dobo-inputwrap::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 22px;
  padding: 1.6px;
  background: conic-gradient(from var(--dobo2-angle), #fea619, #ff6b4a, #8b5cf6, #38bdf8, #34d399, #fea619);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
          mask-composite: exclude;
  animation: dobo2-rotate 6s linear infinite;
  pointer-events: none;
}
.dobo-hero-mount .dobo-inputwrap:focus-within { box-shadow: 0 14px 48px rgba(124,92,255,.16), 0 2px 8px rgba(2,36,72,.06); }
.dobo-hero-mount .dobo2-input { font-size: 15px; min-height: 44px; }
.dobo-hero-mount .dobo2-disclaimer { display: none; }

/* Suggestion chips */
.dobo-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  max-width: 720px;
}
.dobo-chip {
  border: 1px solid var(--border, #e2e8f0);
  background: #fff;
  border-radius: 9999px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2, #334155);
  cursor: pointer;
  transition: border-color .13s ease, background .13s ease, transform .1s ease, box-shadow .13s ease;
}
.dobo-chip:hover { border-color: #c7b3ff; background: #FAFAFF; box-shadow: 0 2px 10px rgba(124,92,255,.12); }
.dobo-chip:active { transform: scale(.97); }
.dobo-chip-hot { border-color: #fde0a3; background: #FFF7E8; color: #92400e; }
.dobo-chip-hot:hover { border-color: #fea619; background: #FEEFC9; box-shadow: 0 2px 10px rgba(254,166,25,.2); }

/* ── Conversation ────────────────────────────────────────────────────────── */
.dobo-thread { flex: 1; display: none; min-height: 0; overflow: hidden; }
.dobo-main.started .dobo-thread { display: flex; }
.dobo-chatwide {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 18px 20px 8px;
}
.dobo-dockarea { display: none; flex-shrink: 0; }
.dobo-main.started .dobo-dockarea { display: block; }
.dobo-dockarea .dobo2-status { max-width: 820px; margin: 0 auto; }
#doboDockMount { max-width: 820px; margin: 0 auto; width: 100%; }
#doboDockMount .dobo-composer { padding: 6px 16px 14px; }

/* ── Mobile: rail becomes a RIGHT-side off-canvas drawer ──────────────────── */
.dobo-rail-scrim {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(2,20,40,.45);
  backdrop-filter: blur(2px);
  z-index: 40;
}
@media (max-width: 900px) {
  .dobo-rail-toggle { display: inline-flex; }
  .dobo-rail {
    position: fixed;
    right: 0; left: auto; top: 0; bottom: 0;
    z-index: 50;
    width: min(300px, 84vw);
    transform: translateX(105%);
    transition: transform .25s cubic-bezier(.16,1,.3,1);
    box-shadow: -8px 0 40px rgba(2,36,72,.25);
    border-left: 1px solid var(--border-soft, #e8edf3);
  }
  #doboPage.rail-open .dobo-rail { transform: translateX(0); }
  #doboPage.rail-open .dobo-rail-scrim { display: block; }
  .dobo-chips { gap: 6px; }
  .dobo-hero { padding: 16px; }
  .dobo-chatwide { padding: 14px 12px 6px; }
  #doboDockMount .dobo-composer { padding: 6px 10px 12px; }
}
@supports (padding: env(safe-area-inset-bottom)) {
  #doboDockMount .dobo-composer { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
}

/* ── Desktop: main-content already scrolls the body; the DoBo layout must
   fill exactly the space below the standard topbar ─────────────────────── */
@media (min-width: 901px) {
  .dobo-layout { height: 100%; }
}
