/* ================================================================
   OmNote UX Layout Polish (additive)
   Smoother topbar, cleaner nav pill, collapsible overflow,
   consistent card hover/focus, scroll-to-top, keyboard hint.
   ================================================================ */

/* --- Topbar: cleaner clustering + sticky shadow on scroll --- */
#topbar {
  transition: box-shadow .2s ease, background .2s ease;
}
body.is-scrolled #topbar {
  box-shadow: 0 2px 14px rgba(10, 61, 74, 0.08) !important;
}

/* Group right-side actions with subtle dividers */
.topbar-right { gap: 6px !important; align-items: center; }
.topbar-right .btn-icon {
  border-radius: 8px !important;
  transition: background .15s ease, transform .1s ease, color .15s ease;
}
.topbar-right .btn-icon:hover {
  background: rgba(14,124,134,0.08) !important;
  color: #0e7c86 !important;
}
.topbar-right .btn-icon:active { transform: translateY(1px); }

/* Vertical divider before profile cluster */
.profile-circle-btn { margin-left: 4px !important; }
.profile-circle-btn::before {
  content: ''; position: absolute; left: -8px; top: 20%; bottom: 20%;
  width: 1px; background: rgba(10,61,74,0.12);
}
.profile-circle-btn { position: relative; }
html.dark .profile-circle-btn::before { background: rgba(255,255,255,0.10); }

/* Log Out — quieter, ghost style */
.btn-logout {
  background: transparent !important;
  color: #6b7f88 !important;
  border: 1px solid transparent !important;
  border-radius: 8px !important;
  padding: 6px 12px !important;
  font-weight: 600 !important;
  transition: all .15s ease;
}
.btn-logout:hover {
  background: rgba(192,57,43,0.08) !important;
  color: #c0392b !important;
  border-color: rgba(192,57,43,0.25) !important;
}

/* --- Main nav tabs → segmented pill control --- */
.main-nav-tabs {
  background: rgba(14,124,134,0.06) !important;
  border-radius: 12px !important;
  padding: 4px !important;
  gap: 2px !important;
}
html.dark .main-nav-tabs { background: rgba(255,255,255,0.04) !important; }
.main-nav-tab {
  border-radius: 8px !important;
  padding: 8px 14px !important;
  font-weight: 600 !important;
  color: #4a6470 !important;
  background: transparent !important;
  border: none !important;
  transition: background .18s ease, color .18s ease, transform .1s ease;
}
.main-nav-tab:hover {
  background: rgba(255,255,255,0.65) !important;
  color: #0e7c86 !important;
}
html.dark .main-nav-tab:hover { background: rgba(255,255,255,0.06) !important; }
.main-nav-tab.active {
  background: #ffffff !important;
  color: #0e7c86 !important;
  box-shadow: 0 1px 3px rgba(10,61,74,0.08), 0 0 0 1px rgba(14,124,134,0.15) !important;
}
html.dark .main-nav-tab.active {
  background: #17383b !important; color: #7fd0d8 !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3), 0 0 0 1px rgba(14,124,134,0.35) !important;
}
.main-nav-tab .tab-emoji i { width: 16px !important; height: 16px !important; }

/* --- Consistent card hover / focus ring --- */
.home-subject-card, .sched-side-card, .pomo-stat-card, .goals-card,
.doc-card, .subject-card {
  transition: transform .15s ease, box-shadow .2s ease, border-color .15s ease !important;
}
.home-subject-card:hover, .doc-card:hover, .subject-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(10,61,74,0.10) !important;
  border-color: rgba(14,124,134,0.3) !important;
}
button:focus-visible, .btn-icon:focus-visible, .main-nav-tab:focus-visible,
.home-subject-card:focus-visible, .doc-card:focus-visible {
  outline: 2px solid #0e7c86 !important;
  outline-offset: 2px !important;
}

/* --- Scroll-to-top floating button --- */
#scroll-to-top {
  position: fixed; right: 20px; bottom: 88px; z-index: 900;
  width: 42px; height: 42px; border-radius: 50%;
  background: #0e7c86; color: #fff; border: none;
  box-shadow: 0 6px 20px rgba(14,124,134,0.35);
  display: none; align-items: center; justify-content: center;
  cursor: pointer; opacity: 0; transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease, background .2s ease;
}
#scroll-to-top.visible { display: flex; opacity: 1; transform: translateY(0); }
#scroll-to-top:hover { background: #0b6770; }
#scroll-to-top i { width: 18px; height: 18px; }

/* --- Keyboard shortcut hint toast --- */
#kbd-hint-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: rgba(10,61,74,0.95); color: #fff;
  padding: 10px 18px; border-radius: 10px; font-size: .85rem;
  box-shadow: 0 8px 30px rgba(10,61,74,0.25);
  opacity: 0; pointer-events: none; z-index: 9999;
  transition: opacity .2s ease, transform .2s ease;
  font-family: 'Figtree', system-ui, sans-serif;
}
#kbd-hint-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#kbd-hint-toast kbd {
  background: rgba(255,255,255,0.15); padding: 2px 6px; border-radius: 4px;
  font-family: 'JetBrains Mono', monospace; font-size: .78rem; margin: 0 2px;
}

/* --- Compact topbar at narrow widths: hide low-priority icons --- */
@media (max-width: 1200px) {
  #whatsnew-btn, #book-mode-btn { display: none !important; }
}
@media (max-width: 980px) {
  #focus-mode-btn, .btn-upload-top .lucide-chevron-down { display: none !important; }
  .topbar-right .btn-icon[onclick*="toggleFullScreen"] { display: none !important; }
  .doc-subtitle { display: none !important; }
}
@media (max-width: 780px) {
  .main-nav-tab { padding: 8px 10px !important; font-size: .82rem !important; }
  .main-nav-tab .tab-emoji { display: none !important; }
  .btn-logout { padding: 6px 8px !important; font-size: .8rem !important; }
}

/* --- Smoother view transitions --- */
#home-view, #scheduler-view, #stats-view {
  animation: op-view-in .25s ease both;
}
@keyframes op-view-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Import button: primary emphasis --- */
.btn-upload-top {
  background: #0e7c86 !important; color: #fff !important;
  border: 1px solid #0e7c86 !important; border-radius: 8px !important;
  padding: 8px 14px !important; font-weight: 700 !important;
  box-shadow: 0 1px 3px rgba(14,124,134,0.25);
  transition: background .15s ease, transform .1s ease, box-shadow .2s ease;
}
.btn-upload-top:hover { background: #0b6770 !important; box-shadow: 0 4px 12px rgba(14,124,134,0.30); }
.btn-upload-top:active { transform: translateY(1px); }

/* --- Empty state polish --- */
#home-empty-state {
  padding: 60px 24px !important;
  animation: op-view-in .35s ease both;
}
.btn-empty-upload {
  transition: transform .15s ease, box-shadow .2s ease !important;
}
.btn-empty-upload:hover { transform: translateY(-2px) scale(1.02); }
