@import url('/assets/css/login_modal.css');

:root {
  --header-z-max: 2147483647;
  --mobile-menu-top: 64px;
  /* 헤더 높이 기본값 - JS 실행 전 레이아웃 시프트 방지 */
  --common-header-offset: 52px;
}

body {
  padding-top: var(--common-header-offset, 0px);
}

.common-header,
.common-header .header-links a,
.common-header #sproutsCount,
.common-header .nav-trigger,
.common-header .user-menu__item,
.mobile-menu a,
.mobile-learning__link,
.mobile-learning__title,
.mobile-learning__desc {
  font-family: var(--font-family-sans, 'Pretendard Variable', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif) !important;
  font-weight: var(--font-weight-bold);
  font-synthesis: auto;
}

/* 푸터는 폰트 패밀리만 적용, font-weight는 개별 요소에서 정의 */
.common-footer,
.common-footer a,
.common-footer p,
.common-footer address {
  font-family: var(--font-family-sans, 'Pretendard Variable', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif) !important;
}

.common-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: #fff;
  box-shadow: none;
  border-bottom: none;
  z-index: var(--header-z-max);
  transition: transform 0.3s ease, visibility 0.25s ease;
  /* 인증 상태 확인 전까지 숨김 - visibility 사용으로 CLS 방지 */
  visibility: hidden;
}

/* 인증 상태 확인 완료 후 표시 */
.common-header.is-auth-ready {
  visibility: visible;
}

body.header-hidden .common-header {
  transform: translateY(-100%);
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.site-logo__mark {
  height: 1.125rem;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.site-logo__text {
  position: relative;
  top: 0.09rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.site-logo__role {
  font-weight: 600;
}

@media (max-width: 850px) {
  .site-logo__text[data-role="admin"] .site-logo__role {
    display: none;
  }
}

@media (min-width: 768px) {
  .site-logo__mark {
    height: 1.25rem;
  }
}

@media (min-width: 1024px) {
  .site-logo__mark {
    height: 1.25rem;
  }

  .site-logo__text {
    top: 0.11rem;
  }
}

.header-content {
  --header-horizontal-padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem var(--header-horizontal-padding);
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 1024px) {
  .header-content {
    --header-horizontal-padding: 1.25rem;
  }
}

@media (max-width: 768px) {
  .header-content {
    --header-horizontal-padding: 1rem;
  }
}

@media (max-width: 640px) {
  .header-content {
    --header-horizontal-padding: 0.75rem;
  }
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

#mobileMenuButton {
  display: none;
}

@media (max-width: 850px) {
  #mobileMenuButton {
    display: inline-flex;
  }
}

@media (min-width: 851px) {
  #mobileMenuButton {
    display: none !important;
  }
}

.header-authenticated-group {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.header-login-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.35rem 1rem;
  border-radius: 9999px;
  background: #111827;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
  border: none;
  cursor: pointer;
}

.header-login-button:hover,
.header-login-button:focus-visible {
  background: #1e40af;
  transform: translateY(-1px);
  outline: none;
}

.header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  border: none;
  background: transparent;
  color: #000000;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.header-icon .material-symbols-outlined,
.user-menu__trigger .material-symbols-outlined,
.header-icon i {
  font-size: 1.35rem;
  line-height: 1;
}

.alert-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  min-height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ef4444;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px #ffffff;
  pointer-events: none;
}

.alert-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: min(520px, 90vw);
  min-height: 200px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 22px 45px rgba(15, 23, 42, 0.18);
  border: 1px solid rgba(226, 232, 240, 0.8);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 60;
}

.alert-dropdown::before {
  content: '';
  position: absolute;
  top: -10px;
  right: 24px;
  border-width: 5px;
  border-style: solid;
  border-color: transparent transparent #ffffff transparent;
  filter: drop-shadow(0 -2px 2px rgba(15, 23, 42, 0.08));
}

.alert-dropdown__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.alert-dropdown__header-actions {
  display: flex;
  gap: 0.5rem;
}

.alert-dropdown__header-btn {
  border: none;
  background: transparent;
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s ease, color 0.2s ease;
}

.alert-dropdown__header-btn:hover {
  background: rgba(226, 232, 240, 0.8);
  color: #1d4ed8;
}

.alert-dropdown__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

.alert-dropdown__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 95%;
  max-height: 300px;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.alert-dropdown__list::-webkit-scrollbar {
  display: none;
}

.alert-dropdown__item {
  border-bottom: 1px solid #e2e8f0;
}

.alert-dropdown__item:last-child {
  border-bottom: none;
}

.alert-dropdown__item[data-alert-state="read"] {
  opacity: 0.85;
}

.alert-dropdown__item-button {
  width: 100%;
  padding: 0.75rem 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}

.alert-dropdown__item-button:focus-visible {
  outline: 2px solid rgba(96, 165, 250, 0.75);
  outline-offset: 2px;
}

.alert-dropdown__item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.alert-dropdown__item-title {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: #000000;
  line-height: 1.35;
}

.alert-dropdown__item-time {
  font-size: 0.75rem;
  color: #64748b;
  flex-shrink: 0;
}

.alert-dropdown__item-body {
  margin: 0;
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.4;
  white-space: pre-line;
}

.alert-dropdown__filters {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.6);
  padding: 0.2rem;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.alert-dropdown__filter {
  border: none;
  border-radius: 999px;
  background: transparent;
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.alert-dropdown__filter.is-active {
  background: #1d4ed8;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(29, 78, 216, 0.25);
}

.alert-dropdown__filter:focus-visible {
  outline: 2px solid rgba(96, 165, 250, 0.75);
  outline-offset: 2px;
}

.alert-dropdown__empty {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
  color: #64748b;
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

@media (max-width: 640px) {
  .alert-dropdown {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 85vh;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 30px rgba(15, 23, 42, 0.2);
    padding: 1.25rem 1rem 1.5rem;
    animation: slideUp 0.25s ease-out;
  }

  @keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  .alert-dropdown::before {
    display: none;
  }

  .alert-dropdown__title {
    font-size: 1.1rem;
    text-align: center;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    margin-bottom: 0.5rem;
  }

  .alert-dropdown__filters {
    width: fit-content;
    justify-content: center;
  }

  .alert-dropdown__list {
    width: 100%;
  }

  .alert-dropdown__header {
    flex-wrap: wrap;
  }

  .alert-dropdown__title {
    flex: 1;
  }
}


.header-icon:hover,
.header-icon:focus-visible {
  background: transparent;
  transform: translateY(-1px);
  outline: none;
}

/* 로고와 메뉴 링크를 감싸는 컨테이너 */
.header-content>div:first-child {
  display: flex;
  align-items: center;
  gap: 3rem;
  transition: gap 0.2s ease-in-out;
}


.header-links {
  gap: 0.5rem;
  align-items: center;
}

@media (max-width: 850px) {
  .header-links {
    display: none !important;
  }
}

@media (min-width: 851px) {
  .header-links {
    display: flex;
  }
}

.header-links a {
  position: relative;
  text-decoration: none;
  color: #374151;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  transition: color 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}

.header-links a::after {
  content: '';
  position: absolute;
  bottom: 0.15rem;
  left: 50%;
  width: 0;
  height: 2px;
  background: #4f46e5;
  border-radius: 1px;
  transform: translateX(-50%);
  transition: width 0.2s ease;
}

.header-links a:hover {
  color: #4f46e5;
  background: rgba(79, 70, 229, 0.08);
}

.header-links a:hover::after {
  width: 60%;
}

.header-links a.is-active {
  color: #4f46e5;
  background: rgba(79, 70, 229, 0.1);
}

.header-links a.is-active::after {
  width: 60%;
}

/* 관리자 버튼 - 초기 숨김 후 부드러운 전환 */
#adminPageLink,
#adminPageLinkMobile {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

#adminPageLink.is-visible,
#adminPageLinkMobile.is-visible {
  opacity: 1;
  visibility: visible;
}

/* ========================================= */
/* ✨ 로그인 후 표시 요소 스타일 추가 ✨ */
/* ========================================= */
#sproutsCount {
  font-size: 11pt;
  white-space: nowrap;
  transition: font-size 0.2s ease-in-out;
}

/* 화면 너비가 1024px 이하일 때 */
@media (max-width: 1024px) {
  .header-content>div:first-child {
    gap: 1.2rem;
  }

  .header-links {
    gap: 0.6rem;
  }

  .header-login-button {
    padding: 0.3rem 0.85rem;
    font-size: 0.9rem;
  }

  #sproutsContainer {
    gap: 0.4rem;
  }

  .user-menu__item .sprouts-icon {
    width: 1.05rem;
    height: 1.05rem;
  }
}


/* ========================================= */
/* 모바일 메뉴(햄버거) 디자인 */
/* ========================================= */
.mobile-menu {
  display: none;
  position: fixed;
  top: var(--mobile-menu-top, 64px);
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ffffff;
  box-shadow: 0 22px 48px -28px rgba(15, 23, 42, 0.4);
  border-top: 1px solid rgba(226, 232, 240, 0.75);
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem 0 2.5rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  z-index: calc(var(--header-z-max, 2147483647) + 2);
}

.mobile-menu.active {
  display: flex;
}

.mobile-menu__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1.5rem 0.75rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.75);
}

.mobile-menu__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}

.mobile-menu__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 9999px;
  border: none;
  background: rgba(99, 102, 241, 0.1);
  color: #1f2a60;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.mobile-menu__close:hover,
.mobile-menu__close:focus-visible {
  background: rgba(79, 70, 229, 0.2);
  transform: translateY(-1px);
  outline: none;
}

.mobile-menu__body {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding: 0.25rem 0 0;
}

.mobile-menu a {
  width: 100%;
  padding: 1rem 1.5rem;
  text-align: left;
  border-bottom: 1px solid #f3f4f6;
  color: #1F2937;
  font-size: 11pt;
  box-sizing: border-box;
}

.mobile-menu__body> :last-child {
  border-bottom: none;
}

/* ========================================= */
/* 공통 푸터 스타일 */
/* ========================================= */
.common-footer {
  background: #ffffff;
  color: #111827;
  margin-top: auto;
  padding: 1.5rem 1.5rem;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  flex-shrink: 0;
}

.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.footer-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.75rem;
  flex-wrap: wrap;
}

.footer-brand {
  flex: 1 1 240px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 280px;
}

.footer-logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #111827;
  text-decoration: none;
}

.footer-description {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #1f2937;
  margin: 0;
}

.footer-contact {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: #1f2937;
}

.footer-contact-label {
  font-weight: 600;
}

.footer-contact-link {
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-contact-link:hover {
  color: #1d4ed8;
}

.footer-nav {
  flex: 2 1 360px;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-section {
  min-width: 160px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-heading {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #111827;
  margin: 0;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.footer-links--services {
  grid-template-columns: repeat(2, 1fr);
}

.footer-links a {
  color: #1f2937;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: #2563eb;
}

.footer-address {
  font-style: normal;
  color: #4b5563;
  line-height: 1.5;
  margin: 0;
  font-size: 0.9rem;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  font-size: 0.85rem;
  color: #4b5563;
}

.footer-copy {
  margin: 0;
}

.footer-policy {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-policy a {
  color: #1f2937;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-policy a:hover {
  color: #2563eb;
}

@media (max-width: 800px) {
  .footer-top {
    gap: 1.25rem;
  }

  .footer-nav {
    gap: 1.25rem;
  }
}

@media (max-width: 640px) {
  .common-footer {
    padding: 1.5rem 1.25rem;
  }

  .footer-top {
    flex-direction: column;
    gap: 1.5rem;
  }

  .footer-nav {
    width: 100%;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
}

.mobile-menu a:hover {
  background-color: #f9fafb;
  color: #1E40AF;
}



body.mobile-menu-open {
  overflow: hidden;
}

/* ==== Compact Header Overrides (add at the end) ==== */
.common-header .header-content {
  padding: .3rem 1rem;
}

.common-header .header-content>div:first-child {
  gap: 2.5rem;
}

.common-header .header-links {
  gap: 0.4rem;
}

.common-header .header-links a {
  font-size: 11pt;
}

/* 로고/카운트/버튼도 약간 축소 */
.common-header #sproutsCount {
  font-size: 11pt;
}

/* 헤더 구분선도 살짝 얇게 */
.common-header .header-divider {
  height: 2px;
}

/* 반응형(중단점)에서도 한 단계 더 조정 */
@media (max-width: 800px) {
  .common-header .header-content {
    padding: .35rem 1rem;
  }

  .common-header .header-content>div:first-child {
    gap: 1.6rem;
  }

  .common-header .header-links {
    gap: 0.3rem;
  }

  #sproutsContainer {
    gap: 0.4rem;
  }

  .user-menu__item .sprouts-icon {
    width: 1.05rem;
    height: 1.05rem;
  }

}

@media (max-width: 800px) {
  .common-header .header-content {
    padding: .3rem .85rem;
  }

  .common-header .header-content>div:first-child {
    gap: 0.8rem;
  }

  /* 기존 1.5rem → 1rem */
  .common-header .header-links {
    gap: 0.3rem;
  }

  /* 기존 0.75rem → 0.6rem */
  #sproutsContainer {
    gap: 0.35rem;
  }

  .user-menu__item .sprouts-icon {
    width: 1rem;
    height: 1rem;
  }

}

@media (max-width: 640px) {
  .header-content {
    padding: 0.5rem 0.85rem;
  }

  .common-header .header-content>div:first-child {
    gap: 0.6rem;
  }

  .header-actions {
    gap: 0.5rem;
  }

  .header-icon {
    width: 36px;
    height: 36px;
    font-size: 1.25rem;
  }

  .user-menu__trigger {
    width: 36px;
    height: 36px;
    font-size: 1.35rem;
  }

  #mobileMenuButton .fas,
  #mobileMenuButton i {
    font-size: 1.4rem;
  }

  .mobile-menu {
    padding: 0.35rem 0 2rem;
  }

  .mobile-menu__header {
    padding: 0.35rem 1.25rem 0.65rem;
  }

  .mobile-menu__title {
    font-size: 1rem;
  }

  .mobile-services__heading {
    margin: 0 1.5rem 0.35rem;
  }

  .mobile-services__link,
  .mobile-services__link--secondary {
    padding: 0.85rem 1.5rem;
  }
}

#mobileMenuButton i {
  font-family: "Font Awesome 6 Free", "Font Awesome 5 Free" !important;
  font-weight: 900;
}

.footer-contact {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* ======= Enhanced Navigation & User Menu ======= */
.nav-dropdown {
  position: relative;
}

.nav-dropdown--mega {
  position: static;
}

.nav-dropdown--mega .nav-dropdown-panel {
  margin-left: 0;
  left: 50%;
  width: 100vw;
  max-width: 100vw;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
  padding-left: calc(max((100vw - 1200px) / 2, 0px) + var(--header-horizontal-padding, 1.5rem));
  padding-right: calc(max((100vw - 1200px) / 2, 0px) + var(--header-horizontal-padding, 1.5rem));
  transform: translate(-50%, 12px);
  box-sizing: border-box;
}

.nav-dropdown::after {
  content: '';
  position: absolute;
  left: -0.6rem;
  top: 100%;
  width: calc(100% + 1.2rem);
  height: 1.2rem;
  pointer-events: none;
}

.nav-dropdown[data-open="true"]::after,
.common-header.noscript .nav-dropdown:hover::after {
  pointer-events: auto;
}

.nav-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 11pt;
  font-weight: 600;
  color: #374151;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0.3rem 0.65rem;
  border-radius: 12px;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-trigger:hover,
.nav-trigger:focus-visible,
.nav-dropdown[data-open="true"] .nav-trigger {
  color: var(--accent, #4f46e5);
  background: rgba(99, 102, 241, 0.12);
  outline: none;
}

.nav-dropdown-panel {
  position: absolute;
  top: calc(100% + 0.3rem);
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1rem;
  min-width: 220px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 48px -32px rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(226, 232, 240, 0.65);
  z-index: var(--header-z-max);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  --dropdown-step-delay: 60ms;
}

.nav-dropdown[data-open="true"] .nav-dropdown-panel,
.common-header.noscript .nav-dropdown:hover .nav-dropdown-panel {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.nav-dropdown--mega[data-open="true"] .nav-dropdown-panel,
.common-header.noscript .nav-dropdown--mega:hover .nav-dropdown-panel {
  transform: translate(-50%, 0);
}

.nav-dropdown-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 11pt;
  font-weight: 500;
  color: #1f2937;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  opacity: 0;
  transform: translateY(8px);
  transition: background 0.18s ease, color 0.18s ease, opacity 0.2s ease, transform 0.2s ease;
  transition-delay: 0s;
}

.nav-dropdown[data-open="true"] .nav-dropdown-link,
.nav-dropdown:hover .nav-dropdown-link {
  opacity: 1;
  transform: translateY(0);
  transition-delay: calc(var(--item-index, 0) * var(--dropdown-step-delay, 60ms));
}

.nav-dropdown-link:hover,
.nav-dropdown-link:focus-visible {
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent, #4f46e5);
  outline: none;
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10pt;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  line-height: 1;
}

.nav-subgroup {
  position: relative;
}

.nav-dropdown-link--has-children {
  justify-content: space-between;
}

.nav-subpanel {
  position: absolute;
  top: 0;
  left: calc(100% + 0.75rem);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.8rem;
  min-width: 180px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 20px 40px -28px rgba(15, 23, 42, 0.3);
  border: 1px solid rgba(226, 232, 240, 0.6);
  z-index: var(--header-z-max);
  opacity: 0;
  visibility: hidden;
  transform: translateX(12px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  --submenu-step-delay: 60ms;
}

.nav-mega-panel {
  flex-direction: row;
  gap: 1.5rem;
  box-sizing: border-box;
}

.nav-mega-section {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  border-right: 1px solid rgba(226, 232, 240, 0.6);
  padding-right: 1rem;
}

.nav-mega-section:last-of-type {
  border-right: none;
  padding-right: 0;
}

.nav-mega-section__label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.nav-mega-grid {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.nav-mega-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  text-decoration: none;
  color: #0f172a;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.2s ease;
  opacity: 0;
  transform: translateY(8px);
  transition-delay: 0s;
}

.nav-dropdown[data-open="true"] .nav-mega-card,
.nav-dropdown:hover .nav-mega-card {
  opacity: 1;
  transform: translateY(0);
  transition-delay: calc(var(--item-index, 0) * 60ms);
}

.nav-mega-card:hover,
.nav-mega-card:focus-visible {
  border-color: rgba(79, 70, 229, 0.4);
  box-shadow: 0 10px 24px -18px rgba(15, 23, 42, 0.35);
  outline: none;
  transform: translateY(-1px);
}

.nav-mega-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.nav-mega-card__title {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-mega-card__desc {
  font-size: 0.8rem;
  color: #6b7280;
  line-height: 1.4;
}

.nav-mega-card__icon {
  font-size: 1.25rem;
  color: #4f46e5;
  margin-top: 0.15rem;
}

.nav-badge--soft {
  background: rgba(79, 70, 229, 0.12);
  color: #4338ca;
  font-size: 0.65rem;
  font-weight: 600;
}

@media (max-width: 960px) {
  .nav-mega-panel {
    flex-direction: column;
    gap: 1rem;
  }

  .nav-mega-section {
    border-right: none;
    padding-right: 0;
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    padding-bottom: 0.75rem;
  }

  .nav-mega-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
  }
}

@media (max-width: 640px) {
  .nav-mega-panel {
    gap: 0.75rem;
  }
}

.nav-subgroup:hover .nav-subpanel,
.nav-subgroup:focus-within .nav-subpanel {
  visibility: visible;
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.nav-subaction {
  border: none;
  background: none;
  text-align: left;
  font-size: 11pt;
  font-weight: 500;
  color: #334155;
  padding: 0.45rem 0.5rem;
  border-radius: 10px;
  cursor: pointer;
  opacity: 0;
  transform: translateX(8px);
  transition: background 0.18s ease, color 0.18s ease, opacity 0.2s ease, transform 0.2s ease;
  transition-delay: 0s;
}

.nav-subgroup:hover .nav-subaction,
.nav-subgroup:focus-within .nav-subaction {
  opacity: 1;
  transform: translateX(0);
  transition-delay: calc(var(--submenu-index, 0) * var(--submenu-step-delay, 60ms));
}

.nav-subaction:hover,
.nav-subaction:focus-visible {
  background: rgba(99, 102, 241, 0.08);
  color: var(--accent, #4f46e5);
  outline: none;
}

.header-actions {
  align-items: center;
  gap: 0.6rem;
}

.header-icon {
  border: none;
  background: transparent;
  color: #000000;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease;
}

.header-icon:hover,
.header-icon:focus-visible {
  background: transparent;
  transform: translateY(-1px);
  outline: none;
}

.user-menu {
  position: relative;
  --user-menu-hover-gap: 0.75rem;
  --user-menu-panel-width: min(250px, calc(100vw - 2.5rem));
}

.user-menu::after {
  content: '';
  position: absolute;
  top: 100%;
  right: 0;
  width: var(--user-menu-panel-width);
  height: calc(var(--user-menu-hover-gap) + 0.5rem);
}

.user-menu__trigger {
  border: none;
  background: transparent;
  color: #000000;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  cursor: pointer;
  transition: transform 0.18s ease;
}

.user-menu__trigger:hover,
.user-menu__trigger:focus-visible,
.user-menu.is-open .user-menu__trigger {
  background: transparent;
  transform: translateY(-1px);
  outline: none;
}

.user-menu__panel {
  position: absolute;
  top: calc(100% + var(--user-menu-hover-gap));
  right: 0;
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  width: var(--user-menu-panel-width);
  min-width: var(--user-menu-panel-width);
  padding: 0.75rem 0.4rem;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 26px 48px -28px rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(226, 232, 240, 0.65);
  z-index: var(--header-z-max);
}

.user-menu.is-open .user-menu__panel,
.user-menu:hover .user-menu__panel {
  display: flex;
}

.user-menu__item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  font-size: 11pt;
  color: #1f2937;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease;
}

.user-menu__item:hover,
.user-menu__item:focus-visible {
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent, #4f46e5);
  outline: none;
}

.user-menu__item span.material-symbols-outlined {
  font-size: 1.15rem;
}

#sproutsContainer {
  gap: 0.55rem;
  font-weight: 700;
  color: #0f172a;
  font-size: 11pt;
}

.user-menu__item .sprouts-icon {
  width: 1.25rem;
  height: 1.25rem;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 6px;
  box-shadow: 0 0 0 1px rgba(15, 118, 110, 0.1);
}

.user-menu__item.hidden {
  display: none;
}

.mobile-learning {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid #f3f4f6;
}

.mobile-menu__body>.mobile-learning:last-of-type {
  border-bottom: none;
}

.mobile-learning__heading {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 1.5rem 0.2rem;
}

.mobile-learning__group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.1rem 1.25rem 0.35rem;
}

.mobile-learning__group-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
  margin: 0 0 0.2rem;
}

.mobile-learning__link {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.6rem 0.65rem;
  border-radius: 12px;
  border: 1px solid transparent;
  text-decoration: none;
  color: #0f172a;
  background: #ffffff;
  font-size: 0.95rem;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.mobile-learning__link:hover,
.mobile-learning__link:focus-visible {
  border-color: rgba(79, 70, 229, 0.3);
  background: rgba(99, 102, 241, 0.08);
  outline: none;
}

.mobile-learning__title {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: #111827;
}

.mobile-learning__desc {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: #475569;
  margin-top: 0.1rem;
  line-height: 1.4;
}

.mobile-learning__link--secondary {
  color: #4338ca;
}

.footer-disclaimer {
  margin-top: 8px;
  font-size: 0.75rem;
  color: #9ca3af;
  opacity: 0.7;
  text-align: center;
  line-height: 1.4;
}

/* 모바일에서는 더 작게 표시 */
@media (max-width: 640px) {
  .footer-disclaimer {
    font-size: 0.7rem;
    margin-top: 6px;
  }
}

/* 다크모드 지원 */
.dark .footer-disclaimer {
  color: #6b7280;
}

#mobileMenuButton {
  display: inline-flex;
}


/* 멤버십 가입 버튼 - 무지개 테두리 */
.header-membership-btn {
  position: relative;
  padding: 0.125rem 0.375rem;
  border-radius: 6px;
  background: transparent;
  color: #374151;
  text-decoration: none;
  border: 2px solid transparent;
  background-image: linear-gradient(#fff, #fff), linear-gradient(90deg, #ff0000, #ff8000, #ffff00, #00ff00, #00ffff, #0080ff, #8000ff, #ff0080, #ff0000);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  background-size: 100% 100%, 400% 100%;
  animation: rainbow-border 20s linear infinite;
}

@keyframes rainbow-border {
  0% { background-position: 0 0, 0% 50%; }
  100% { background-position: 0 0, 400% 50%; }
}

.header-membership-btn:hover {
  color: #4f46e5;
}
