/* /public/css/topbar.css */

/* /public/css/topbar.css */

#top-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 64px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 0 32px;
  z-index: 1000;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* =========================
   공통 영역
========================= */

#top-bar .left,
#top-bar .center,
#top-bar .right {
  display: flex;
  align-items: center;
}

#top-bar span {
  margin-right: 14px;
  color: #374151;
  font-weight: 500;
}

#top-bar span:first-child {
  font-weight: 600;
  color: #111827;
}

/* 버튼 */
.topbar-btn {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #4f7cff, #6a5cff);
  color: #ffffff;
  transition: all 0.2s ease;
}

.topbar-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* 로고 */
#top-bar .logo {
  display: flex;
  align-items: center;
}

#top-bar .logo img {
  height: 36px;       /* ⭐ 핵심: topbar(64px)에 가장 잘 맞음 */
  width: auto;        /* 비율 유지 */
  display: block;
}

/* 데스크탑 메뉴 */
#top-bar .center {
  gap: 28px;
}

#top-bar .center a {
  text-decoration: none;
  font-weight: 600;
  color: #444;
}

#top-bar .center a:hover {
  color: #4f46e5;
}

#top-bar .center .highlight {
  color: #4f46e5;
}

/* 오른쪽 영역 */
#top-bar .right {
  gap: 12px;
}

/* body 밀기 */
body {
  padding-top: 64px;
}

/* =========================
   햄버거 버튼
========================= */

.hamburger {
  display: none;
  font-size: 26px;
  background: none;
  border: none;
  cursor: pointer;
}

/* =========================
   모바일 메뉴
========================= */

#mobile-menu {
  position: fixed;
  top: 64px;
  left: 0;
  width: 100%;
  background: #fff;
  display: none;
  flex-direction: column;
  border-top: 1px solid #eee;
  z-index: 999;
}

#mobile-menu a {
  padding: 16px 24px;
  border-bottom: 1px solid #f1f1f1;
  text-decoration: none;
  color: #333;
  font-weight: 600;
}

/* =========================
   📱 모바일 전용 레이아웃
========================= */

@media (max-width: 768px) {

  /* 데스크탑 메뉴 숨김 */
  .desktop-only {
    display: none !important;
  }

   #top-bar .logo img {
    height: 30px;
  }

  .level-text {
    display: none;
  }

  /* ⭐ top-bar를 grid로 전환 */
  #top-bar {
    display: grid;
    grid-template-columns: 48px 1fr 48px;
    padding: 0 12px;
  }

  /* 햄버거: 왼쪽 */
  .hamburger {
    display: block;
    grid-column: 1;
    grid-row: 1;          /* ⭐ 이 줄이 핵심 */
    justify-self: start;
    align-self: center;
    margin: 0;        
  }

  /* 로고: 중앙 */
  #top-bar .left {
    grid-column: 2;
    justify-self: center;
  }

  /* 오른쪽: 로그인 / 아이콘 */
  #top-bar .right {
    grid-column: 3;
    justify-self: end;
  }
}

.header .depth1>li>a {
  font-size: 16px !important;
}

#top-bar nav.center a {
  font-size: 16px !important;
}

/* ===== DET150 SITE CHROME START (2026-11-09) ===== */
/* 상단 메뉴 · 모바일 메뉴 고급 디자인. 이 블록만 지우면 이전 모습으로 돌아갑니다. */
#top-bar:not(.exam-bar) {
  --tb-ink: #142640; --tb-soft: #3A4A62; --tb-muted: #6B7A90;
  --tb-teal: #12756F; --tb-mark: #FFD84D; --tb-line: #E4E9F0;
  height: 64px;
  padding: 0 max(24px, calc((100vw - 1240px) / 2));
  background: rgba(255, 255, 255, .86);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--tb-line);
  box-shadow: none;
  box-sizing: border-box;
  font-family: "NanumSquareNeo", "Pretendard", -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  transition: box-shadow .25s ease, background .25s ease;
}
/* 맨 위 브랜드 라인 */
#top-bar:not(.exam-bar)::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, #142640 0%, #12756F 55%, #FFD84D 100%);
}
#top-bar.tb-scrolled:not(.exam-bar) {
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 10px 30px -18px rgba(20, 38, 64, .35);
}
#top-bar:not(.exam-bar) .logo { padding-top: 2px; }
#top-bar:not(.exam-bar) .logo img { height: 34px; }
#top-bar:not(.exam-bar) span { margin-right: 0; }
#top-bar:not(.exam-bar) .tb-cta span, #top-bar:not(.exam-bar) .tb-user span:not(.tb-avatar) { color: inherit; font-weight: inherit; margin: 0; }

/* 가운데 메뉴 */
#top-bar:not(.exam-bar) nav.center { gap: 4px; }
#top-bar:not(.exam-bar) nav.center a {
  position: relative;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 15px !important;
  font-weight: 700;
  color: var(--tb-soft);
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: color .15s, background .15s;
}
#top-bar:not(.exam-bar) nav.center a:hover { color: var(--tb-ink); background: #F1F4F8; }
#top-bar:not(.exam-bar) nav.center a.active,
#top-bar:not(.exam-bar) nav.center a.highlight { color: var(--tb-ink); text-decoration: none; font-weight: 800; }
#top-bar:not(.exam-bar) nav.center a.active::after {
  content: ""; position: absolute; left: 16px; right: 16px; bottom: 4px; height: 7px;
  background: var(--tb-mark); border-radius: 2px; z-index: -1; opacity: .9;
}

/* 오른쪽: 로그인 · 회원 */
#top-bar:not(.exam-bar) .right { gap: 8px; }
#top-bar:not(.exam-bar) .tb-link {
  padding: 9px 12px; border-radius: 10px; font-size: 14px; font-weight: 700;
  color: var(--tb-soft); text-decoration: none; background: none; border: 0; cursor: pointer; font-family: inherit;
}
#top-bar:not(.exam-bar) .tb-link:hover { color: var(--tb-ink); background: #F1F4F8; }
#top-bar:not(.exam-bar) .tb-cta {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 16px; border-radius: 10px; font-size: 14px; font-weight: 800;
  color: #fff; background: var(--tb-ink); text-decoration: none;
  box-shadow: 0 6px 16px -8px rgba(20, 38, 64, .6);
  transition: transform .15s, box-shadow .15s, background .15s;
}
#top-bar:not(.exam-bar) .tb-cta:hover { background: #0E1C31; transform: translateY(-1px); box-shadow: 0 10px 20px -10px rgba(20, 38, 64, .7); }
#top-bar:not(.exam-bar) .tb-cta b { color: var(--tb-mark); font-weight: 900; }
#top-bar:not(.exam-bar) .tb-level {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; letter-spacing: .02em;
  color: var(--tb-teal); background: #EAF5F4; border: 1px solid #CDE6E3;
}
#top-bar:not(.exam-bar) .tb-level::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--tb-teal); }
#top-bar:not(.exam-bar) .tb-user {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px;
  border-radius: 999px; border: 1px solid var(--tb-line); background: #fff;
  font-size: 14px; font-weight: 700; color: var(--tb-ink); text-decoration: none;
  transition: border-color .15s, box-shadow .15s;
}
#top-bar:not(.exam-bar) .tb-user:hover { border-color: #C9D3E0; box-shadow: 0 4px 12px -6px rgba(20, 38, 64, .3); }
#top-bar:not(.exam-bar) .tb-avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, #12756F, #142640); color: #fff; font-size: 13px; font-weight: 900; text-transform: uppercase;
}
#top-bar:not(.exam-bar) .tb-logout { font-size: 13px; color: var(--tb-muted); }

/* 햄버거 */
#top-bar:not(.exam-bar) .hamburger {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--tb-line);
  background: #fff; color: var(--tb-ink); font-size: 18px; line-height: 1;
}

/* 모바일 메뉴 패널 */
#mobile-menu {
  top: 64px;
  padding: 10px 16px 18px;
  background: #fff;
  border-top: 0;
  border-bottom: 1px solid #E4E9F0;
  box-shadow: 0 24px 40px -24px rgba(20, 38, 64, .45);
  gap: 2px;
  box-sizing: border-box;
  font-family: "NanumSquareNeo", "Pretendard", -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}
#mobile-menu a {
  padding: 14px 14px;
  border: 0;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 800;
  color: #142640;
  display: flex; justify-content: space-between; align-items: center;
}
#mobile-menu a::after { content: "›"; color: #A3AFC0; font-size: 20px; font-weight: 400; }
#mobile-menu a:hover, #mobile-menu a.active { background: #F4F7FA; text-decoration: none; }
#mobile-menu a.active { box-shadow: inset 4px 0 0 #FFD84D; }

@media (max-width: 768px) {
  #top-bar:not(.exam-bar) { padding: 0 12px; grid-template-columns: 48px 1fr auto; }
  #top-bar:not(.exam-bar) .logo img { height: 28px; }
  #top-bar:not(.exam-bar) .tb-hide-m { display: none !important; }
  #top-bar:not(.exam-bar) .tb-cta { padding: 8px 12px; font-size: 13px; }
  #top-bar:not(.exam-bar) .tb-user { padding: 3px; }
  #top-bar:not(.exam-bar) .tb-user span:not(.tb-avatar) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  #top-bar:not(.exam-bar), #top-bar:not(.exam-bar) * { transition: none !important; }
}
/* ===== DET150 SITE CHROME END ===== */
