/* navbar.css — 講師後台共用導覽列樣式
   originally inlined in teacher/exam.html; 抽出供新頁面共用 */

/* ── 頂部導覽列 ── */
.navbar {
  background: #1B3A6B;
  border-bottom: 1px solid #2A4D82;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1000;
  gap: 12px;
}

.navbar-brand {
  font-size: 1rem;
  font-weight: 800;
  color: #D4B76A;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-groups {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.nav-group { position: relative; }

.nav-group-btn {
  background: transparent;
  border: none;
  color: #B8CDE4;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.nav-group-btn:hover,
.nav-group-btn.open {
  background: rgba(212,183,106,0.12);
  color: #D4B76A;
}

.nav-caret { font-size: 0.7rem; transition: transform 0.2s; }
.nav-group-btn.open .nav-caret { transform: rotate(180deg); }

.nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #1B3A6B;
  border: 1px solid #2A4D82;
  border-radius: 10px;
  min-width: 152px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  z-index: 1001;
}

.nav-group.open .nav-dropdown { display: block; }

.nav-drop-item {
  display: block;
  padding: 10px 18px;
  font-size: 0.85rem;
  color: #B8CDE4;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.nav-drop-item:hover { background: rgba(212,183,106,0.12); color: #D4B76A; }
.nav-drop-item.current-page { color: #D4B76A; background: rgba(212,183,106,0.08); font-weight: 700; }

.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  flex-shrink: 0;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #B8CDE4;
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}

.nav-mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 1002;
}

.nav-mobile-overlay.open { display: block; }

.nav-mobile-menu {
  position: fixed;
  top: 0;
  right: -280px;
  width: 260px;
  height: 100dvh;
  background: #1B3A6B;
  border-left: 1px solid #2A4D82;
  z-index: 1003;
  overflow-y: auto;
  transition: right 0.25s ease;
}

.nav-mobile-menu.open { right: 0; }

.nav-mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #2A4D82;
}

/* 手機選單品牌名稱：當 <a> 使用時抑制底線與顏色變化 */
.nav-mobile-brand { font-size: 0.95rem; font-weight: 800; color: #D4B76A; text-decoration: none; cursor: pointer; }

.nav-mobile-close {
  background: transparent;
  border: none;
  color: #8AA3C0;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
}

.nav-mobile-section {
  padding: 8px 0;
  border-bottom: 1px solid #2A4D82;
}

.nav-mobile-section:last-child { border-bottom: none; }

.nav-mobile-section-title {
  padding: 6px 20px 4px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #4E6B88;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nav-mobile-item {
  display: block;
  padding: 11px 20px;
  font-size: 0.9rem;
  color: #B8CDE4;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.nav-mobile-item:hover,
.nav-mobile-item.current-page { background: rgba(212,183,106,0.1); color: #D4B76A; }

@media (max-width: 600px) {
  .nav-groups { display: none; }
  .nav-hamburger { display: flex; }
}
