/* ==========================================================================
   RuangSNBT v25 — Liquid Glass Navigation & Floating Sidebar System
   True Optical Frost + Specular Rim · Zero AI Slop
   Precision Sized for Mobile (<768px), Tablet (768-1023px), Laptop (1024px+)
   ========================================================================== */

:root {
  --lg-bg: rgba(255, 255, 255, 0.68);
  --lg-bg-strong: rgba(255, 255, 255, 0.82);
  --lg-border: rgba(255, 255, 255, 0.85);
  --lg-outline: rgba(245, 138, 31, 0.09);
  --lg-shadow: 0 12px 34px -10px rgba(11, 22, 44, 0.12), 0 2px 8px rgba(245, 138, 31, 0.05);
  --lg-inset: inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 -1px 0 rgba(245, 138, 31, 0.04);
  --lg-blur: blur(22px) saturate(185%);
}

/* Soft Luminous Mist Backdrop so Liquid Glass refracts cleanly */
body.app-body {
  background: radial-gradient(circle at 12% 8%, #E6F0FF 0%, transparent 42%),
              radial-gradient(circle at 88% 14%, #EAF3FF 0%, transparent 38%),
              linear-gradient(180deg, #F3F7FE 0%, #F7FAFF 55%, #EEF4FD 100%) !important;
  background-attachment: fixed;
}

/* --------------------------------------------------------------------------
   1. LIQUID GLASS PUBLIC NAVBAR (Floating Capsule on Laptop, Edge-Glass on Mobile)
   -------------------------------------------------------------------------- */
.sn-pub-nav {
  position: sticky;
  top: 0;
  z-index: 95;
  padding: 10px 20px 0;
  pointer-events: none;
}
.sn-pub-inner {
  pointer-events: auto;
  max-width: var(--container-current, 1200px);
  margin: 0 auto;
  padding: 0 18px;
  height: 58px;
  border-radius: 18px;
  background: var(--lg-bg);
  backdrop-filter: var(--lg-blur);
  -webkit-backdrop-filter: var(--lg-blur);
  border: 1px solid var(--lg-border);
  box-shadow: var(--lg-shadow), var(--lg-inset), 0 0 0 1px var(--lg-outline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
@media (max-width: 767px) {
  .sn-pub-nav { padding: 8px 12px 0; }
  .sn-pub-inner { height: 52px; padding: 0 14px; border-radius: 15px; }
}

.sn-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: #17191D;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.025em;
  flex-shrink: 0;
}
.sn-brand-mark {
  width: 29px;
  height: 29px;
  border-radius: 9px;
  background: linear-gradient(145deg, #1A52E8 0%, #F58A1F 100%);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13.5px;
  box-shadow: 0 4px 10px rgba(245, 138, 31, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.sn-pub-links {
  display: flex;
  align-items: center;
  gap: 2px;
}
.sn-pub-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  color: #334155;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}
.sn-pub-link:hover {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(255, 255, 255, 0.9);
  color: #17191D;
}
.sn-pub-link.is-active {
  color: #F58A1F;
  font-weight: 600;
  background: rgba(245, 138, 31, 0.1);
  border-color: rgba(245, 138, 31, 0.14);
}

/* Liquid Glass Dropdown */
.sn-pub-dd { position: relative; }
.sn-pub-dd-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: -8px;
  width: 264px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(26px) saturate(190%);
  -webkit-backdrop-filter: blur(26px) saturate(190%);
  border: 1px solid var(--lg-border);
  border-radius: 16px;
  padding: 7px;
  box-shadow: 0 20px 46px -12px rgba(11, 22, 44, 0.18), var(--lg-inset), 0 0 0 1px var(--lg-outline);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(0.98);
  transition: opacity 0.18s ease, transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.18s ease;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 110;
}
.sn-pub-dd:hover .sn-pub-dd-menu,
.sn-pub-dd.is-open .sn-pub-dd-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.sn-pub-dd-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.14s ease;
}
.sn-pub-dd-item:hover { background: rgba(245, 138, 31, 0.08); }
.sn-pub-dd-ico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #EDF3FF;
  color: #F58A1F;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 15px;
  flex-shrink: 0;
}
.sn-pub-dd-ico svg { display: block; }
.sn-pub-dd-item > div > strong { display: block; font-size: 13px; color: #17191D; font-weight: 700; }
.sn-pub-dd-item > div > span { display: block; font-size: 11.5px; color: #52637E; margin-top: 1px; }

.sn-pub-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.sn-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 15px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.12s ease;
  white-space: nowrap;
}
.sn-nav-btn-ghost {
  color: #1E293B;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(245, 138, 31, 0.1);
}
.sn-nav-btn-ghost:hover { background: rgba(255, 255, 255, 0.9); color: #17191D; }
.sn-nav-btn-primary {
  background: linear-gradient(145deg, #1A52E8 0%, #F58A1F 100%);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 12px rgba(245, 138, 31, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.sn-nav-btn-primary:hover { filter: brightness(1.05); color: #FFFFFF; }

.sn-pub-burger {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(245, 138, 31, 0.12);
  background: rgba(255, 255, 255, 0.72);
  color: #17191D;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.sn-pub-mobile {
  pointer-events: auto;
  display: none;
  flex-direction: column;
  gap: 3px;
  max-width: var(--container-current, 1200px);
  margin: 8px auto 0;
  padding: 12px 14px 16px;
  border-radius: 16px;
  background: var(--lg-bg-strong);
  backdrop-filter: blur(26px) saturate(190%);
  -webkit-backdrop-filter: blur(26px) saturate(190%);
  border: 1px solid var(--lg-border);
  box-shadow: var(--lg-shadow), var(--lg-inset), 0 0 0 1px var(--lg-outline);
}
.sn-pub-mobile.is-open { display: flex; }
.sn-pub-mob-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #64748B;
  padding: 8px 10px 2px;
}
.sn-pub-mobile a.sn-mob-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  color: #17191D;
}
.sn-pub-mobile a.sn-mob-link:hover { background: rgba(245, 138, 31, 0.08); color: #F58A1F; }

@media (max-width: 1023px) {
  .sn-pub-links, .sn-pub-actions { display: none; }
  .sn-pub-burger { display: inline-flex; }
}

/* --------------------------------------------------------------------------
   2. FLOATING LIQUID GLASS SIDEBAR (Laptop 1024px+ · Tablet & Mobile Drawer)
   -------------------------------------------------------------------------- */
.sidebar.sb-modern {
  background: var(--lg-bg) !important;
  backdrop-filter: var(--lg-blur) !important;
  -webkit-backdrop-filter: var(--lg-blur) !important;
  border: 1px solid var(--lg-border) !important;
  box-shadow: var(--lg-shadow), var(--lg-inset), 0 0 0 1px var(--lg-outline) !important;
  display: flex;
  flex-direction: column;
  transition: width 0.24s cubic-bezier(0.22, 1, 0.36, 1), transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Laptop / Desktop Floating Liquid Glass Sidebar */
@media (min-width: 1024px) {
  .sidebar.sb-modern {
    width: 248px !important;
    margin: 12px 0 12px 12px !important;
    height: calc(100vh - 24px) !important;
    top: 12px !important;
    border-radius: 22px !important;
    padding: 14px 12px !important;
  }
  .app-shell.sidebar-collapsed .sidebar.sb-modern {
    width: 68px !important;
    padding: 14px 8px !important;
    border-radius: 20px !important;
  }
  .app-shell.sidebar-collapsed .sb-link-text,
  .app-shell.sidebar-collapsed .sb-brand-title,
  .app-shell.sidebar-collapsed .sb-group-label,
  .app-shell.sidebar-collapsed .sb-chevron,
  .app-shell.sidebar-collapsed .sb-kbd,
  .app-shell.sidebar-collapsed .sb-sublist,
  .app-shell.sidebar-collapsed .sb-profile-meta {
    display: none !important;
  }
  .app-shell.sidebar-collapsed .sb-link,
  .app-shell.sidebar-collapsed .sb-search-trigger,
  .app-shell.sidebar-collapsed .sb-account-trigger {
    justify-content: center !important;
    padding: 0 !important;
  }
  .app-shell.sidebar-collapsed .sb-top-row {
    flex-direction: column;
    gap: 8px;
  }
}

/* Tablet (768px - 1023px) & Mobile (<768px) Slide-Over Glass Sheet */
@media (max-width: 1023px) {
  .sidebar.sb-modern {
    width: min(292px, 84vw) !important;
    height: calc(100dvh - 16px) !important;
    margin: 8px 0 8px 8px !important;
    top: 8px !important;
    border-radius: 22px !important;
    padding: 16px 14px !important;
    background: var(--lg-bg-strong) !important;
  }
  .sb-mobile-backdrop {
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    background: rgba(11, 22, 44, 0.28) !important;
  }
  .sb-link { min-height: 40px; font-size: 14px !important; }
  .sb-sublink { height: 36px; font-size: 13.5px; }
}

.sb-search-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 36px;
  padding: 0 11px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 0 0 1px rgba(245, 138, 31, 0.08);
  color: #52637E;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 10px;
  transition: background 0.14s ease, color 0.14s ease;
}
.sb-search-trigger:hover { background: rgba(255, 255, 255, 0.92); color: #17191D; }
.sb-kbd {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(245, 138, 31, 0.1);
  color: #52637E;
}

.sb-group-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #7A8BA6;
  padding: 11px 10px 4px;
}
.sb-group-label:first-child { padding-top: 2px; }

.sb-nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px !important;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: none;
}
.sb-nav-group::-webkit-scrollbar { display: none; }

.sb-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 0 10px !important;
  border-radius: 11px !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  color: #334155;
  text-decoration: none;
  border: 1px solid transparent;
  background: transparent;
  width: 100%;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.sb-link:hover {
  background: rgba(255, 255, 255, 0.65);
  border-color: rgba(255, 255, 255, 0.85);
  color: #17191D;
}
.sb-link.is-active {
  background: linear-gradient(135deg, rgba(245, 138, 31, 0.13) 0%, rgba(59, 130, 246, 0.08) 100%) !important;
  border-color: rgba(245, 138, 31, 0.18) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  color: #F58A1F !important;
  font-weight: 600 !important;
}
.sb-link-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0.85;
}
.sb-link.is-active .sb-link-ico { opacity: 1; color: #F58A1F; }

.sb-chevron {
  margin-left: auto;
  display: inline-flex;
  transition: transform 0.18s ease;
  color: #7A8BA6;
}
.sb-acc.is-open .sb-chevron { transform: rotate(180deg); color: #F58A1F; }

.sb-sublist {
  margin: 3px 0 5px 18px;
  padding-left: 11px !important;
  border-left: 1px solid rgba(245, 138, 31, 0.14);
  display: none;
  flex-direction: column;
  gap: 2px;
}
.sb-acc.is-open .sb-sublist { display: flex !important; }
.sb-sublink {
  display: flex;
  align-items: center;
  height: 32px;
  padding: 0 10px;
  border-radius: 9px;
  font-size: 12.8px;
  font-weight: 500;
  color: #52637E;
  text-decoration: none;
  transition: background 0.13s ease, color 0.13s ease;
}
.sb-sublink:hover { background: rgba(255, 255, 255, 0.68); color: #17191D; }
.sb-sublink.is-active { color: #F58A1F; font-weight: 600; background: rgba(245, 138, 31, 0.1); }

/* --------------------------------------------------------------------------
   3. LIQUID GLASS USER ACCOUNT POPOVER
   -------------------------------------------------------------------------- */
.sb-account-wrap {
  position: relative;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(245, 138, 31, 0.08);
}
.sb-account-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.sb-account-trigger:hover {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(255, 255, 255, 0.95);
}

.sb-account-menu {
  position: absolute;
  left: 0;
  right: 0;
  min-width: 226px;
  bottom: calc(100% + 10px);
  background: var(--lg-bg-strong);
  backdrop-filter: blur(26px) saturate(195%);
  -webkit-backdrop-filter: blur(26px) saturate(195%);
  border: 1px solid var(--lg-border);
  border-radius: 16px;
  padding: 6px;
  box-shadow: 0 22px 48px -12px rgba(11, 22, 44, 0.22), var(--lg-inset), 0 0 0 1px var(--lg-outline);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(0.98);
  transition: opacity 0.16s ease, transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.16s ease;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 135;
}
.sb-account-menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.sb-acc-head {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(245, 138, 31, 0.08);
  margin-bottom: 4px;
}
.sb-acc-head strong { display: block; font-size: 13px; color: #17191D; }
.sb-acc-head span { display: block; font-size: 11.5px; color: #52637E; overflow: hidden; text-overflow: ellipsis; }

.sb-acc-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  color: #1E293B;
  text-decoration: none;
  transition: background 0.13s ease, color 0.13s ease;
}
.sb-acc-item:hover { background: rgba(245, 138, 31, 0.09); color: #F58A1F; }
.sb-acc-item.is-danger { color: #B91C1C; }
.sb-acc-item.is-danger:hover { background: rgba(239, 68, 68, 0.1); color: #991B1B; }
.sb-acc-div { height: 1px; background: rgba(245, 138, 31, 0.08); margin: 4px 0; }

/* --------------------------------------------------------------------------
   4. LIQUID GLASS TABLET & MOBILE HEADER + FLOATING BOTTOM DOCK
   -------------------------------------------------------------------------- */
.mobile-topbar {
  background: var(--lg-bg) !important;
  backdrop-filter: var(--lg-blur) !important;
  -webkit-backdrop-filter: var(--lg-blur) !important;
  border-bottom: 1px solid var(--lg-border) !important;
  box-shadow: 0 6px 24px -8px rgba(11, 22, 44, 0.1), var(--lg-inset) !important;
  height: 54px;
  padding: 0 14px !important;
}

@media (min-width: 768px) and (max-width: 1023px) {
  .mobile-topbar {
    margin: 10px 16px 0 !important;
    border-radius: 16px !important;
    border: 1px solid var(--lg-border) !important;
    box-shadow: var(--lg-shadow), var(--lg-inset), 0 0 0 1px var(--lg-outline) !important;
    height: 56px;
    padding: 0 16px !important;
  }
}

.tablet-search-pill { display: none; }
@media (min-width: 680px) and (max-width: 1023px) {
  .tablet-search-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 14px;
    min-width: 260px;
    border-radius: 11px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.62);
    box-shadow: 0 0 0 1px rgba(245, 138, 31, 0.08);
    color: #52637E;
    font-size: 13px;
    cursor: pointer;
  }
  .tablet-search-pill:hover { background: rgba(255, 255, 255, 0.92); color: #17191D; }
  .mobile-search-ico { display: none !important; }
}

/* Floating Liquid Glass Bottom Dock on Mobile (<768px) */
@media (max-width: 767px) {
  .app-content { padding-bottom: 96px !important; }
  .bottom-nav {
    left: 12px !important;
    right: 12px !important;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    width: auto !important;
    border-radius: 22px !important;
    background: rgba(255, 255, 255, 0.74) !important;
    backdrop-filter: blur(24px) saturate(190%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(190%) !important;
    border: 1px solid rgba(255, 255, 255, 0.88) !important;
    box-shadow: 0 14px 36px -8px rgba(11, 22, 44, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 0 0 1px rgba(245, 138, 31, 0.08) !important;
    padding: 7px 8px !important;
    height: auto !important;
  }
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 10.5px;
  font-weight: 600;
  color: #52637E;
  text-decoration: none;
  padding: 2px 0;
}
.bottom-nav-ico {
  width: 46px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}
.bottom-nav-item.is-active { color: #F58A1F !important; font-weight: 700; }
.bottom-nav-item.is-active .bottom-nav-ico {
  background: rgba(245, 138, 31, 0.13);
  color: #F58A1F;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
