/* sidebar.css — Session Sidebar / Global Navbar / Landing Page */

/* ══════ Session Sidebar (global, fixed) ══════ */
.sidebar {
  position: fixed; left: 0; top: 48px; bottom: 0;
  width: 260px; background: var(--bg2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 100;
  transform: translateX(-260px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 4px 0 16px rgba(0,0,0,0);
}
.sidebar.open {
  transform: translateX(0);
  box-shadow: 4px 0 16px rgba(0,0,0,0.08);
}
[data-theme="dark"] .sidebar.open { box-shadow: 4px 0 16px rgba(0,0,0,0.3); }
.sb-header {
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.sb-header .sb-title-text { font-size: 14px; font-weight: 600; color: var(--text); flex: 1; }
.sb-icon-btn {
  width: 28px; height: 28px; border-radius: 6px; border: none;
  background: transparent; color: var(--text2); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; flex-shrink: 0;
}
.sb-icon-btn:hover { background: var(--bg3); color: var(--text); }
.sb-icon-btn svg { width: 16px; height: 16px; }
.sb-icon-btn.refreshing svg { animation: spin 0.6s linear; }
.sb-list {
  flex: 1; overflow-y: auto; padding: 8px;
}
.sb-list::-webkit-scrollbar { width: 3px; }
.sb-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.sb-footer {
  padding: 10px 12px; border-top: 1px solid var(--border); flex-shrink: 0;
}
.sb-new-btn {
  width: 100%; padding: 8px; border-radius: 8px; border: 1px dashed var(--border);
  background: transparent; color: var(--accent); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.15s; text-align: center;
}
.sb-new-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); border-style: solid; }
.sb-item {
  padding: 10px 12px; border-radius: 8px; cursor: pointer;
  margin-bottom: 4px; transition: background 0.15s;
  border: 1px solid transparent;
  position: relative;
  display: flex; align-items: center; gap: 6px;
}
.sb-item:hover { background: var(--bg3); }
.sb-item.active { background: var(--accent-glow); border-color: var(--accent); }
.sb-item .sb-item-main {
  flex: 1; min-width: 0; cursor: pointer;
}
.sb-item .sb-item-title {
  font-size: 13px; font-weight: 500; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sb-item .sb-meta {
  font-size: 11px; color: var(--text3); margin-top: 3px;
  display: flex; align-items: center; gap: 8px;
}
.sb-item .sb-item-more {
  width: 24px; height: 24px; border-radius: 5px; border: none;
  background: transparent; color: var(--text3); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; line-height: 1; padding: 0; flex-shrink: 0;
  opacity: 0; transition: opacity 0.15s, background 0.15s;
}
.sb-item:hover .sb-item-more,
.sb-item.active .sb-item-more { opacity: 1; }
.sb-item .sb-item-more:hover { background: var(--bg2); color: var(--text); }
.sb-item .sb-state {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--text3);
}
.sb-item .sb-state.idle { background: var(--green); }
.sb-item .sb-state.running { background: var(--orange); }
/* ══════ Global Navbar ══════ */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; height: 48px; z-index: 101;
  background: var(--bg2); border-bottom: 1px solid var(--border);
  display: none; align-items: center; padding: 0 14px; gap: 10px;
}
.navbar.visible { display: flex; }
.navbar .nav-left { display: flex; align-items: center; gap: 8px; }
.navbar .nav-toggle {
  width: 32px; height: 32px; border-radius: 8px; border: none;
  background: transparent; color: var(--text2); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.navbar .nav-toggle:hover { background: var(--bg3); color: var(--text); }
.navbar .nav-toggle svg { width: 18px; height: 18px; }
.navbar .nav-brand {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
}
.navbar .nav-brand-icon {
  width: 28px; height: 28px;
  background: #1a1a1a;
  border-radius: 7px; display: flex; align-items: center;
  justify-content: center; font-size: 14px; color: #fff;
}
.navbar .nav-brand-text {
  font-size: 15px; font-weight: 700; letter-spacing: 1.5px;
  color: var(--text); font-family: 'Avenir', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
}
.navbar .nav-spacer { flex: 1; }
.navbar .nav-right { display: flex; align-items: center; gap: 12px; }
.nav-btn {
  height: 30px; border-radius: 7px;
  border: 1px solid var(--border); background: var(--bg2);
  color: var(--text2); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; font-size: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.nav-btn:hover { background: var(--bg3); color: var(--text); }
.nav-btn svg { width: 14px; height: 14px; }
.nav-btn.icon-only { width: 30px; }
.nav-btn.with-text { padding: 0 10px; gap: 5px; }
.nav-more { margin-left: 12px; }
/* ── More dropdown ── */
.nav-more-dropdown {
  display: none; position: absolute; right: 0; top: calc(100% + 4px);
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 10px; padding: 4px 0; z-index: 999;
  min-width: 160px; box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.nav-more-dropdown.show { display: block; }
.nav-more-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; cursor: pointer; font-size: 13px;
  color: var(--text); white-space: nowrap; position: relative;
}
.nav-more-item:hover { background: var(--bg3); }
.nav-more-item svg { flex-shrink: 0; }
.nav-more-arrow { margin-left: auto; color: var(--text3); }
/* Language submenu */
.nav-more-sub {
  display: none; position: absolute; right: 100%; top: 0;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 10px; padding: 4px 0; min-width: 150px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.nav-more-has-sub:hover .nav-more-sub { display: block; }
.nav-more-sub .lang-item {
  padding: 6px 14px; cursor: pointer; font-size: 13px;
  white-space: nowrap; color: var(--text);
}
.lang-item:hover { background: var(--bg3); }
.lang-item.active { font-weight: 700; color: var(--accent); }
.lang-item::before { content: ''; display: inline-block; width: 16px; }
.lang-item.active::before { content: '✓'; width: 16px; color: var(--accent); }
/* Hide sidebar toggle in navbar when in guest mode */
body.guest-mode .nav-toggle { display: none; }
body.guest-mode .nav-brand { margin-left: 0; }

/* ══════ Landing Page ══════ */
.landing {
  display: flex; flex-direction: column; align-items: center;
  justify-content: flex-start; padding-top: 6vh; height: calc(100% - 48px); margin-top: 48px;
  transition: opacity 0.3s; position: relative; overflow-y: auto;
  background:
    radial-gradient(ellipse 60% 50% at 50% 40%, var(--accent-glow) 0%, transparent 70%);
}
.landing.hidden { display: none; }
.landing .logo {
  display: flex; align-items: center; gap: 14px; margin-bottom: 12px;
}
.landing .logo-icon {
  width: 42px; height: 38px;
  background: #1a1a1a;
  border-radius: 10px; display: flex; align-items: center;
  justify-content: center; font-size: 22px;
}
.landing .logo-text {
  font-size: 30px; font-weight: 700; letter-spacing: 2.5px;
  color: var(--text); font-family: 'Avenir', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
}
.landing .subtitle {
  color: var(--text3); font-size: 15px; margin-bottom: 36px;
  letter-spacing: 0.3px;
}
.landing-input {
  width: 720px; max-width: 90vw; position: relative;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: 0 2px 16px rgba(0,0,0,0.04);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.landing-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow), 0 8px 32px rgba(0,0,0,0.08);
}
.landing-input textarea {
  width: 100%; background: transparent; border: none;
  color: var(--text); padding: 22px 56px 22px 24px;
  font-size: 16px; line-height: 1.7; resize: none; outline: none;
  min-height: 120px; font-family: inherit; position: relative; z-index: 0;
}
.landing-input textarea::placeholder { color: var(--text3); }
.landing-input .go-btn {
  position: absolute; right: 12px; bottom: 14px; z-index: 2; width: 28px; height: 28px;
  border-radius: 50%; border: 1px solid #333;
  background: transparent; color: var(--text2);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.landing-input .go-btn:hover { border-color: var(--accent); color: var(--accent); }
.landing-input .go-btn svg { width: 14px; height: 14px; }
.landing-hints {
  margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap;
  justify-content: center; max-width: 720px;
}
.hint-chip {
  padding: 6px 14px; border-radius: 8px; background: #f3f4f6;
  border: none; font-size: 13px; color: #1a1a1a;
  cursor: pointer; transition: all 0.2s;
}
.hint-chip:hover {
  background: #e5e7eb; color: #000;
}
