/* ==================================================================
   css/map-view-menu.css - UPDATED FOR D&L UNIT LOOK
   ================================================================== */

/* --------------------------------------------------
   0. Global Bar & Shared Theme
-------------------------------------------------- */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 50px;
  padding: 0 1rem;
  background: var(--menu-color, #8b2d48) !important; /* Branded color */
  color: #fff;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 2000; /* Higher than sidebar to keep it in front */
}

/* Hamburger & "menu" text as a single unit */
.hamburger {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 2px solid #ffffff; /* White pill border */
  border-radius: 25px;       /* Pill shape */
  color: #ffffff;
  padding: 4px 14px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  text-transform: lowercase; /* Matches "menu" look */
}

.hamburger:hover {
  background: rgba(255, 255, 255, 0.1);
}

.hamburger i {
  font-size: 1.2rem;
}

/* Bold Project Title — single-line ellipsis on narrow screens */
.topbar-title {
  font-weight: 800 !important;
  font-size: 1.3rem;
  margin-left: 5px;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;        /* Allow flex child to shrink below content size */
  overflow: hidden;
}

/* --------------------------------------------------
   3. SIDEBAR LAYOUT — Sliding Behind Topbar
-------------------------------------------------- */

#sidebar {
  position: fixed !important;  /* !important: project custom_css must not override layout positioning */
  top: 50px !important;        /* Aligns precisely beneath topbar height */
  left: -280px;
  width: 280px;
  height: calc(100% - 50px) !important;
  background: #ffffff !important;
  box-shadow: 4px 0 15px rgba(0,0,0,0.1);
  z-index: 1000; /* Lower than topbar to slide behind it */
  display: flex;
  flex-direction: column;
  transition: left .3s ease-in-out;
  padding: 0 !important;
}

body.sidebar-open #sidebar {
  left: 0;
}

/* Sidebar header: "Hide Menu" button row at top */
.sidebar-header {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid #e9ecef;
}

/* List Item Styling */
#sidebar .sidebar-inner {
  display: flex;
  flex-direction: column;
  padding: 10px 0;
}

#sidebar .sidebar-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 14px 20px;
  border: none;
  background: transparent;
  border-bottom: 1px solid #f5f5f5;
  cursor: pointer;
  transition: background 0.2s;
  text-align: left;
}

#sidebar .sidebar-btn:hover {
  background: #f8f9fa;
}

#sidebar .sidebar-btn i {
  width: 24px;
  text-align: center;
  color: var(--menu-color, #8b2d48);
  font-size: 1.1rem;
}

.sidebar-label {
  font-weight: 500;
  color: #333;
}

/* --------------------------------------------------
   4. Dropdown & Logic
-------------------------------------------------- */

/* Ensure classic/text menus hide when sidebar is used */
body[data-menu-layout="sidebar"] #button-panel,
body[data-menu-layout="sidebar"] .controls { 
  display: none !important; 
}

/* ─────────────────────────────────────────────
   Menu hover labels (Map View)
   ───────────────────────────────────────────── */

.round-btn {
  position: relative;
}

.menu-hover-label {
  position: absolute;
  left: 110%;
  top: 50%;
  transform: translateY(-50%);

  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  font-size: 0.85rem;
  padding: 6px 10px;
  border-radius: 4px;
  white-space: nowrap;

  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease-in-out;

  z-index: 1000;
}

/* show label only on hover */
.round-btn:hover .menu-hover-label {
  opacity: 1;
}

/* --------------------------------------------------
   5. TOPNAV BAR — Horizontal Navigation
-------------------------------------------------- */

#topnav-bar {
  position: fixed;
  left: 0; right: 0;
  z-index: 1050;
  background: var(--menu-color, #0d6efd);
  display: none;               /* shown via JS layout */
  align-items: center;
  padding: 0 12px;
  min-height: 40px;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}

/* Project title on the left side of topnav bar */
.topnav-title {
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
  padding: 0 12px 0 4px;
  flex-shrink: 0;
}

.topnav-inner {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
  flex: 1;               /* Grow to fill between title and zoomto */
}

/* Zoom To slot on the right side of topnav bar */
#topnav-zoomto-slot {
  display: flex;
  align-items: center;
  margin-left: auto;     /* Push to right edge */
  flex-shrink: 0;
  padding-right: 4px;
}

#topnav-zoomto-slot .zoomto-select {
  min-width: 144px;
  max-width: 200px;
  padding: 4px 10px;
  font-size: 13px;
  height: 32px;
  background: rgba(255,255,255,.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,.3);
  box-shadow: none;
}

/* Dropdown options need dark text on white background */
#topnav-zoomto-slot .zoomto-select option {
  background: #fff;
  color: #333;
}

/* Nav links (top-level items) */
.topnav-link {
  background: none;
  border: none;
  color: #fff;
  font-size: .85rem;
  padding: 8px 12px;
  cursor: pointer;
  white-space: nowrap;
  border-radius: 4px;
  transition: background .15s;
  font-family: inherit;
}
.topnav-link:hover {
  background: rgba(255,255,255,.18);
}

/* Logo items inside topnav */
.topnav-logo {
  padding: 4px 8px;
}

/* Dropdown wrapper */
.topnav-dropdown {
  position: relative;
}

.topnav-dropdown-trigger {
  font-weight: 500;
}

.topnav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 180px;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
  padding: 4px 0;
  z-index: 1060;
}

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

.topnav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 14px;
  background: none;
  border: none;
  color: #333;
  font-size: .85rem;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}
.topnav-dropdown-item:hover {
  background: #f0f0f0;
}