/* ===== Tokens ===== */
:root {
  --bg-0: #0E172A;
  --bg-1: #232B32;
  --line: #2E363E;
  --txt-0: #F1F1F1;
  --txt-1: #CFE0EF;
  --txt-2: #AAB5BE;
  --txt-3: #9AAEBF;
  --txt-4: #7E8C95;
  --accent-cyan: #A2FFFE;
  --accent-blue: #328DFF;
}

body {
  background: #0E172A;
  color: var(--txt-1);
}

/* ===== Header ===== */
.gnb-header {
  position: fixed;
  left: 313px;
  right: 22px;
  top: 18px;
  z-index: 1000;
  height: 50px;
  padding: 0 14px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
  border-radius: 8px;
}

/* ===== 좌측 타이틀 ===== */
.gnb-left {
  display: flex;
  align-items: center;
  gap: 12px;   /* 햄버거 ↔ 타이틀 간격 (2026-06-15 · tanwoo) */
}

.gnb-title {
  color: var(--gray-1, #FFF);
  font-family: Pretendard;
  font-size: 22px;
  font-style: normal;
  font-weight: 600;
  line-height: 20px;
}

/* ===== 우측 묶음 ===== */
.gnb-right {
  display: flex;
  align-items: center;
  gap: 13px;
}

/* ===== 날씨 ===== */
.gnb-weather {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
}

.weather-icon-container {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.weather-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.weather-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.weather-humidity {
  color: #8799A8;
  font-size: 13px;
  font-family: Pretendard;
  font-weight: 300;
  line-height: 12px;
  text-align: center;
}

.weather-temp {
  color: #AAB5BE;
  font-size: 13px;
  font-family: Pretendard;
  font-weight: 600;
  line-height: 12px;
  text-align: center;
}

/* ===== 세로 구분선 ===== */
.gnb-sep-v {
  width: 0;
  height: 28px;
  border-left: 1px solid #1D2D4E;
}

/* ===== 날짜/시간 ===== */
.gnb-datetime {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 8px;
}

.info-text-date {
  color: #8799A8;
  font-size: 14px;
  font-family: Pretendard;
  font-weight: 300;
  line-height: 12px;
  text-align: center;
}

.info-text-time {
  color: #AAB5BE;
  font-size: 14px;
  font-family: Pretendard;
  font-weight: 600;
  line-height: 12px;
  text-align: center;
}

/* ===== 아이콘 버튼 (프로필, 모드) ===== */
.gnb-icon-btn {
  width: 47px;
  height: 47px;
  background: #1F2937;
  border: 0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: opacity .15s ease;
}

.gnb-icon-btn:hover {
  opacity: 0.85;
}

.gnb-icon-btn img {
  width: 47px;
  height: 47px;
}

.gnb-noti-btn img {
  width: 28px;
  height: 28px;
}

/* ===== 알림 ===== */
.gnb-noti-wrap {
  position: relative;
}

.gnb-noti-btn {
  position: relative;
  overflow: visible;
}

.gnb-noti-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 19px;
  height: 19px;
  padding: 0 var(--space-1);
  border-radius: var(--radius-pill);
  background: var(--status-critical);
  color: #FFFFFF;
  border: 2px solid var(--bg-page);
  font-size: 11px;
  font-weight: var(--fw-bold);
  line-height: 15px;
  text-align: center;
  box-sizing: border-box;
}

.gnb-noti-badge.is-hidden {
  display: none;
}

.noti-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  width: 360px;
  max-width: calc(100vw - var(--space-7));
  background: var(--bg-modal);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-overlay);
  overflow: hidden;
}

.noti-dropdown.open {
  display: block;
}

.noti-dropdown-header,
.noti-dropdown-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
}

.noti-dropdown-header {
  border-bottom: 1px solid var(--border);
}

.noti-dropdown-title {
  color: var(--text-primary);
  font-size: var(--font-md);
  font-weight: var(--fw-bold);
  line-height: 1.2;
}

.noti-dropdown-subtitle {
  margin-top: var(--space-1);
  color: var(--text-muted);
  font-size: var(--font-xs);
  line-height: 1.2;
}

.noti-dropdown-count {
  min-width: 28px;
  height: 24px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--primary-bg);
  color: var(--primary);
  font-size: var(--font-xs);
  font-weight: var(--fw-bold);
  line-height: 24px;
  text-align: center;
}

.noti-dropdown-list {
  list-style: none;
  margin: 0;
  padding: var(--space-2) 0;
  max-height: 360px;
  overflow-y: auto;
}

.noti-dropdown-item {
  margin: 0;
}

.noti-dropdown-item-btn {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  display: grid;
  gap: var(--space-1);
  cursor: pointer;
}

.noti-dropdown-item-btn:hover {
  background: var(--bg-hover);
}

.noti-dropdown-item-title {
  color: var(--text-primary);
  font-size: var(--font-base);
  font-weight: var(--fw-bold);
  line-height: 1.3;
}

.noti-dropdown-item-message {
  color: var(--text-secondary);
  font-size: var(--font-sm);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.noti-dropdown-item-date {
  color: var(--text-muted);
  font-size: var(--font-xs);
  line-height: 1.2;
}

.noti-dropdown-empty {
  padding: var(--space-7) var(--space-4);
  color: var(--text-muted);
  font-size: var(--font-sm);
  text-align: center;
}

.noti-dropdown-footer {
  border-top: 1px solid var(--border);
}

.noti-dropdown-link {
  color: var(--primary);
  text-decoration: none;
  font-size: var(--font-sm);
  font-weight: var(--fw-bold);
}

.noti-dropdown-link:hover {
  text-decoration: underline;
  color: var(--primary);
}

/* ===== 프로필 드롭다운 ===== */
.gnb-profile-wrap {
  position: relative;
}

.profile-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: #1F2937;
  border: 1px solid #2E363E;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  z-index: 1100;
  flex-direction: column;
  gap: 12px;
}

.profile-dropdown.open {
  display: flex;
}

.profile-dropdown-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-dropdown-name {
  color: #F1F1F1;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}

.profile-dropdown-role {
  color: #8799A8;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.3;
}

.profile-dropdown-divider {
  height: 1px;
  background: #2E363E;
}

.profile-dropdown-logout {
  background: transparent;
  border: 0;
  color: #FF6B6B;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 0;
  cursor: pointer;
  text-align: left;
  transition: opacity .15s ease;
}

.profile-dropdown-logout:hover {
  opacity: 0.8;
}

/* 내정보 등 일반 메뉴 항목 (로그아웃과 달리 중립색·밑줄 없음) */
.profile-dropdown-item {
  display: block;
  background: transparent;
  border: 0;
  color: #CFDBE7;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 0;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  transition: opacity .15s ease;
}

.profile-dropdown-item:hover {
  opacity: 0.8;
  text-decoration: none;
}

/* ===== AI Chatbot 버튼 ===== */
.gnb-chatbot-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  background: linear-gradient(155deg, #3C29EA 0%, #8358F2 100%);
  box-shadow: 5px 7px 20px rgba(103, 72, 240, 0.25);
  border-radius: 12px;
  transition: transform .2s ease;
}

.gnb-chatbot-wrap:hover {
  transform: translateY(-2px);
}

.gnb-chatbot-btn {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.gnb-chatbot-icon {
  width: 24px;
  height: 22px;
  flex-shrink: 0;
}

.gnb-chatbot-text {
  color: white;
  font-size: 16px;
  font-family: Pretendard, sans-serif;
  font-weight: 600;
  line-height: 16px;
  white-space: nowrap;
}

.gnb-chatbot-divider {
  width: 0;
  height: 20px;
  border-left: 1.2px solid rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
}

.gnb-chatbot-fullscreen-btn {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.gnb-chatbot-fullscreen-btn img {
  width: 22px;
  height: 22px;
  display: block;
}

/* ===== 라이트모드 ===== */
body.body--light .gnb-header {
    background: #FFFFFF;
    box-shadow: none;
}
body.body--light .gnb-title { color: #1A202C; }
body.body--light .weather-humidity { color: #6B7280; }
body.body--light .weather-temp { color: #374151; }
body.body--light .gnb-sep-v { border-left-color: #E2E8F0; }
body.body--light .info-text-date { color: #6B7280; }
body.body--light .info-text-time { color: #374151; }
body.body--light .gnb-icon-btn { background: #F3F4F6; }
body.body--light .gnb-icon-btn img {
    filter: brightness(0) saturate(100%) invert(30%) sepia(10%) saturate(500%) hue-rotate(180deg) brightness(90%) contrast(90%);
}
body.body--light .profile-dropdown {
    background: #FFFFFF;
    border-color: #E2E8F0;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
body.body--light .profile-dropdown-name { color: #1A202C; }
body.body--light .profile-dropdown-role { color: #6B7280; }
body.body--light .profile-dropdown-divider { background: #E2E8F0; }
body.body--light .profile-dropdown-item { color: #1A202C; }

/* ===== 언어 전환 ===== */
.gnb-lang-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.gnb-lang-trigger {
  transition: opacity .15s ease, box-shadow .15s ease;
}

.gnb-lang-trigger:hover {
  opacity: 0.85;
}

.gnb-lang-trigger[aria-expanded="true"] {
  box-shadow: 0 0 0 3px var(--primary-bg);
}

.gnb-lang-trigger .gnb-lang-trigger__icon {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
}

/* 언어 모달: 선택 항목의 왼쪽 inset bar 제거(면+보더 강조만 유지) */
#hdrLangForm .ui-option-list__item.is-selected,
#hdrLangForm .ui-option-list__item[aria-selected="true"] {
  box-shadow: none;
}

/* ===== 유틸리티 ===== */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== 사이드바 햄버거 + off-canvas backdrop ===== */
/* (2026-06-15 · tanwoo · 15번 스펙: 헤더 좌측 햄버거, 1280미만 노출, .ui-ico(currentColor·테마자동), backdrop=var(--overlay)) */
.gnb-hamburger {
  display: none;                 /* 기본(≥1280) 숨김 */
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;       /* 회색 박스 없이 — 타이틀 옆 깔끔한 메뉴 버튼 */
  border-radius: var(--radius-md);
  color: var(--text-primary);    /* .ui-ico 가 currentColor 추종 → 다크/라이트 자동 */
  cursor: pointer;
  transition: background .15s ease;
}
.gnb-hamburger:hover { background: var(--bg-hover); }
.gnb-hamburger .ui-ico { width: 24px; height: 24px; }

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: var(--z-overlay);               /* 1000 — 사이드바(1010) 바로 아래 */
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

@media (max-width: 1279px) {
  .gnb-hamburger { display: flex; }
  .gnb-header { left: var(--edge-gap); }   /* 헤더도 전체폭 — 사이드바 자리 회수 */
  body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
}
