/* GetBar — Bootstrap 5 overrides only */
body.app-home #root { display: none !important; }
body.app-home .side-content { display: none !important; }

/* ===== Login page ===== */
html.gb-login-lock,
html.gb-login-lock body {
  height: 100%;
  overflow: hidden !important;
  overscroll-behavior: none !important;
}
html.gb-login-lock body.app-login {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  min-height: 100dvh !important;
  max-height: 100dvh !important;
  overflow: hidden !important;
}
html.gb-login-lock body.app-login #root {
  height: 100dvh !important;
  overflow: hidden !important;
}
body.app-login { background: #fff !important; }
body.app-login #ai-btn, body.app-login #audio-read-btn,
body.app-login #annotation-pen-btn, body.app-login #ai-box { display: none !important; }
/* Hide original branding & tabs */
body.app-login [class*="topBrand"] { display: none !important; }
body.app-login .ant-tabs-nav { display: none !important; }
/* Center the form */
body.app-login [class*="container___"] { background: transparent !important; height: 100dvh !important; min-height: 100dvh !important; max-height: 100dvh !important; overflow: hidden !important; display: flex !important; align-items: center !important; justify-content: center !important; }
body.app-login [class*="mainContent"] { background: transparent !important; width: 100% !important; max-width: 360px !important; }
body.app-login [class*="rightSection"] { background: transparent !important; padding: 0 1.5rem !important; }
body.app-login [class*="loginContainer"] { box-shadow: none !important; border: none !important; background: transparent !important; padding: 0 !important; }
body.app-login [class*="loginTabs"] { padding: 0 !important; }
/* Input styling */
body.app-login .ant-input,
body.app-login .ant-input-affix-wrapper { border: none !important; border-bottom: 1.5px solid #e5e7eb !important; border-radius: 0 !important; height: 48px !important; font-size: 1rem !important; background: transparent !important; box-shadow: none !important; padding-left: 8px !important; }
body.app-login .ant-input-affix-wrapper .ant-input { border: none !important; height: auto !important; }
body.app-login .ant-input:focus, body.app-login .ant-input-affix-wrapper-focused { border-bottom-color: #8b5cf6 !important; box-shadow: none !important; }
body.app-login .ant-input-prefix { color: #9ca3af !important; margin-right: 8px !important; }
body.app-login .ant-input-suffix { opacity: .3 !important; }
/* Button */
body.app-login .ant-btn-primary { background: linear-gradient(135deg, #3b82f6, #8b5cf6) !important; border: none !important; border-radius: 2rem !important; height: 48px !important; font-size: 1rem !important; font-weight: 600 !important; margin-top: 1rem !important; color: #fff !important; }
body.app-login .ant-form-item { margin-bottom: 20px !important; }
/* Bottom branding */
body.app-login #login-brand { position: fixed; bottom: 2rem; left: 0; right: 0; text-align: center; z-index: 1; }
body.app-login #login-brand .brand-name { font-size: 1.8rem; font-weight: 800; letter-spacing: -1px; background: linear-gradient(135deg, #3b82f6, #8b5cf6); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
body.app-login #login-brand .brand-sub { font-size: .8rem; color: #9ca3af; margin-top: .2rem; }
body.app-login .gb-signup-entry { margin-top: 14px; text-align: center; font-size: 13px; color: #6b7280; }
body.app-login #gb-signup-open { border: 0; background: transparent; color: #2563eb; font-weight: 800; cursor: pointer; padding: 6px 8px; }
body.app-login #gb-signup-open:hover { text-decoration: underline; }
.gb-signup-modal { position: fixed; inset: 0; z-index: 2147483000; display: none; align-items: center; justify-content: center; background: rgba(15,23,42,.44); padding: 16px; }
.gb-signup-modal.open { display: flex; }
.gb-signup-panel { position: relative; width: min(430px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; background: #fff; border-radius: 8px; box-shadow: 0 18px 56px rgba(15,23,42,.24); padding: 22px; }
.gb-signup-close { position: absolute; right: 12px; top: 10px; border: 0; background: transparent; color: #64748b; font-size: 24px; line-height: 1; cursor: pointer; }
.gb-signup-panel h2 { margin: 0 34px 4px 0; color: #111827; font-size: 20px; font-weight: 850; }
.gb-signup-sub { margin: 0 0 16px; color: #64748b; font-size: 13px; line-height: 1.5; }
.gb-signup-field { display: block; margin: 11px 0 0; color: #374151; font-size: 13px; font-weight: 750; }
.gb-signup-field input { margin-top: 5px; width: 100%; height: 40px; border: 1px solid #d1d5db; border-radius: 6px; padding: 0 11px; font-size: 14px; outline: none; background: #fff; }
.gb-signup-field input:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.gb-signup-file { margin-top: 5px; border: 1px dashed #cbd5e1; border-radius: 6px; background: #f8fafc; padding: 12px; }
.gb-signup-file input { height: auto; margin: 0; padding: 0; border: 0; box-shadow: none; background: transparent; }
.gb-signup-file-name { margin-top: 7px; color: #64748b; font-size: 12px; word-break: break-all; }
.gb-signup-submit { margin-top: 16px; width: 100%; height: 42px; border: 0; border-radius: 6px; background: #2563eb; color: #fff; font-weight: 850; cursor: pointer; }
.gb-signup-submit:disabled { opacity: .58; cursor: not-allowed; }
.gb-signup-msg { display: none; margin-top: 12px; border-radius: 6px; padding: 9px 10px; font-size: 13px; line-height: 1.45; }
.gb-signup-msg.show { display: block; }
.gb-signup-msg.ok { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.gb-signup-msg.err { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
@media (max-width: 767px) {
  body.app-login #login-brand { bottom: calc(.8rem + env(safe-area-inset-bottom, 0px)) !important; }
  body.app-login [class*="container___"] { align-items: flex-start !important; padding-top: 14dvh !important; }
  .gb-signup-panel { padding: 20px 18px; }
}

#app-root { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif; }

/* Sidebar */
.sidebar-nav { min-width: 200px; }
.sidebar-btn { white-space: nowrap; padding: .65rem 1rem; }
.sidebar-btn.active { background: #f0f4ff !important; }

/* Subject card hover */
.subject-card { transition: transform .2s, box-shadow .2s; cursor: pointer; }
.subject-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,.1) !important; }

/* Mobile sidebar = two-row wrap tabs */
@media (max-width: 991.98px) {
  .sidebar-nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: .35rem !important;
    padding-bottom: 4px;
  }
  .sidebar-btn { flex-shrink: 0; padding: .4rem .7rem; font-size: .82rem; }
}
#getbar-app { padding-bottom: 60px; }

/* Purple accent helper */
.text-purple { color: #8b5cf6 !important; }

/* Progress bar thin */
.progress { height: 5px; }

/* Hide hack.js floating buttons visually on home page (keep clickable for navbar delegation) */
body.app-home #ai-btn,
body.app-home #audio-read-btn,
body.app-home #annotation-pen-btn { position: fixed !important; left: -9999px !important; top: -9999px !important; opacity: 0 !important; }

/* Mobile bottom action bar */
.getbar-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid #dee2e6;
  padding: .5rem 1rem;
  z-index: 1050;
  box-shadow: 0 -2px 8px rgba(0,0,0,.06);
}

/* Repo grid: multi-column on desktop, single on mobile */
.repo-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
  gap: 4px 12px !important;
}
@media (max-width: 767px) {
  .repo-grid { grid-template-columns: 1fr !important; }
}

/* Shared navbar helpers */
.gb-nav-shell { min-height: 52px; }
.gb-nav-brand {
  display: inline-flex;
  align-items: center;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
}
.gb-nav-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-wrap: nowrap;
}

/* Sun/moon toggle button (shared with hack.js injection sites).
   Dark-mode theming comes from Dark Reader at runtime — no CSS overrides. */
.gb-nav-btn,
.gb-theme-btn {
  border: 1px solid #6c757d;
  background: transparent;
  color: #6c757d;
  border-radius: 999px !important;
  width: 36px;
  height: 36px;
  min-width: 36px;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}
.gb-nav-btn:hover,
.gb-theme-btn:hover { background: #6c757d; color: #fff; }
.gb-nav-btn i,
.gb-theme-btn i { font-size: 1rem; }
.gb-nav-btn.gb-nav-btn-text { font-size: 0.78rem; letter-spacing: 0; }
.gb-nav-btn.btn-outline-primary {
  color: #0d6efd;
  border-color: #0d6efd;
}
.gb-nav-btn.btn-outline-primary:hover {
  background: #0d6efd;
  color: #fff;
}
.gb-nav-btn.btn-outline-warning {
  color: #d97706;
  border-color: #f59e0b;
}
.gb-nav-btn.btn-outline-warning:hover {
  background: #f59e0b;
  color: #111827;
}
.gb-nav-btn.btn-outline-warning i { color: #d97706; }
.gb-nav-btn.btn-warning i { color: #111827; }
