/* Mobile-specific layout for the burger drawer and backdrop */

/* Backdrop behind the drawer */
#drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
  z-index: 1190;
}

/* When drawer is open, show backdrop */
.drawer.open + #drawer-backdrop {
  opacity: 1;
  pointer-events: auto;
}

/* In case we render [hidden] attribute */
[hidden] { display: none !important; }

/* Ensure the drawer sits above header/backdrop layers */
.drawer { z-index: 1200; }

/* Ensure dropdown inside the drawer is above content */
.drawer .dropdown {
  position: relative;
}

.drawer .dropdown-menu {
  position: absolute;
  z-index: 1300;
  left: 0;
  top: 100%;
  width: 100%;
  margin-top: 6px;
  display: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.drawer .dropdown-menu.show {
  display: block;
}

/* Bottom Navigation (mobile only) */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  padding-bottom: constant(safe-area-inset-bottom);
  padding-bottom: env(safe-area-inset-bottom);
  height: calc(60px + env(safe-area-inset-bottom));
  background: #fff;
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
  z-index: 1050;
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  backdrop-filter: saturate(180%) blur(10px);
  border-top: 1px solid #ececec;
}

.bottom-nav a {
  color: #6b7280;
  text-decoration: none;
  font-size: 0;
  padding: 8px 10px;
  border-radius: 10px;
  line-height: 1;
  touch-action: manipulation;
  transition: color .15s ease-in-out, background-color .15s ease-in-out;
}

.bottom-nav .icon-svg { display: block; width: 24px; height: 24px; }
.bottom-nav i { display: none; }

.bottom-nav .icon-ol path,
.bottom-nav .icon-ol circle,
.bottom-nav .icon-ol rect,
.bottom-nav .icon-ol line,
.bottom-nav .icon-ol polyline,
.bottom-nav .icon-ol polygon,
.bottom-nav .icon-ol ellipse {
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.bottom-nav .icon-fill path { fill: currentColor; }
.bottom-nav a:hover { color: #0d6efd; }
.bottom-nav a.active,
.bottom-nav a[aria-current="page"] { color: #0d6efd; }
.bottom-nav a:focus-visible { outline: 2px solid #0d6efd; outline-offset: 2px; }

.bottom-nav a.has-unread,
.bottom-nav a.has-unread-notifications {
  position: relative;
}

.bottom-nav a.has-unread { color: #dc3545; }
.bottom-nav a.has-unread-notifications { color: #ffc107; }

.bottom-nav a.has-unread::after,
.bottom-nav a.has-unread-notifications::after {
  content: '';
  position: absolute;
  top: 6px;
  right: 12px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 2px #fff;
}

.bottom-nav a.has-unread .icon-svg,
.bottom-nav a.has-unread-notifications .icon-svg {
  animation: nav-ping 2s ease-in-out infinite;
}

@keyframes nav-ping {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.fa-missing .bottom-nav { height: 70px; }
.fa-missing .bottom-nav a { display: flex; align-items: center; justify-content: center; font-size: 16px; }
.fa-missing .bottom-nav i { display: none; }
.fa-missing .bottom-nav .icon-svg { display: block; color: #6b7280; }

@media (prefers-reduced-motion: reduce) {
  .bottom-nav a { transition: none; }
}
