/* ========================================
   Header V2 - 독립 CSS
   v2_main/resources.jsp 전용
   기존 CSS 충돌 없음
   ======================================== */

/* ==========================================
   1. 기본 리셋 및 요소 숨김
   ========================================== */

/* Skip Menu 숨김 */
.skip-menu {
  display: none;
}

/* ==========================================
   V2 헤더 고립화 - 최소 리셋
   ========================================== */

/* 모든 하위 요소 기본 스타일 - 전역 reset 차단 */
#header-v2,
#header-v2 *,
#header-v2 *::before,
#header-v2 *::after {
  box-sizing: border-box !important;
  margin: 0;
  padding: 0;
  border: 0;
  font: inherit;
  vertical-align: baseline;
}

/* 헤더 루트 요소 기본 스타일 - 완전 고립화 */
#header-v2 {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 16px;
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-weight: 400;
  vertical-align: baseline;
  line-height: 1;
  letter-spacing: normal;
  position: relative;
  z-index: 1000;
}

/* 링크 기본 스타일 - 전역 a 스타일 차단 */
#header-v2 a {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: inherit;
  font-family: inherit;
  font-weight: inherit;
  vertical-align: baseline;
  color: inherit;
  text-decoration: none;
  background-color: transparent;
}

/* 이미지 기본 스타일 - 전역 img 스타일 차단 */
#header-v2 img {
  margin: 0;
  padding: 0;
  border: 0;
  border-style: none;
  vertical-align: middle;
  font-size: inherit;
}

/* btn 클래스 기본 스타일 - 전역 [class|='btn'] 선택자 차단 */
/* [class|='btn']은 클래스가 정확히 'btn' 또는 'btn-'으로 시작하는 요소만 매칭 */
#header-v2 [class|='btn'] {
  position: static;
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-sizing: border-box !important;
  text-decoration: none;
  background-color: transparent;
  color: inherit;
  font-weight: inherit;
  text-align: inherit;
  vertical-align: baseline;
  box-shadow: none;
  white-space: normal;
}

/* btn 호버 시 검은색 오버레이 차단 */
#header-v2 [class|='btn']::after,
#header-v2 [class|='btn']:hover::after,
#header-v2 [class|='btn']:focus::after {
  content: none !important;
  display: none !important;
}

/* 리스트 기본 스타일만 제거 (li::before/after는 기존 코드에서 처리) */
#header-v2 ul,
#header-v2 ol {
  list-style: none;
}

#header-v2 li::before {
  content: none;
  display: none;
}

/* gnb-item-v2의 ::after는 파란 라인용이므로 제외 */
#header-v2 li::after {
  content: none;
  display: none;
}

#header-v2 .gnb-item-v2::after {
  content: "" !important;
  display: block !important;
}

/* ==========================================
   2. 기본 레이아웃 (Bootstrap Grid)
   ========================================== */

#header-v2 .container {
  width: 1170px;
  max-width: 1170px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 15px !important;
  padding-right: 15px !important;
}

#header-v2 .row {
  display: flex;
  flex-wrap: wrap;
  margin-left: -15px;
  margin-right: -15px;
}

#header-v2 .col-4,
#header-v2 .col-6,
#header-v2 .col-12,
#header-v2 .col-md-6 {
  position: relative;
  width: auto;
  padding-left: 15px;
  padding-right: 15px;
}

#header-v2 .col-4 {
  flex: 0 0 33.333333%;
  max-width: 33.333333%;
}

#header-v2 .col-6 {
  flex: 0 0 50%;
  max-width: 50%;
}

#header-v2 .col-12 {
  flex: 0 0 100%;
  max-width: 100%;
}

#header-v2 .col-md-6 {
  flex: 0 0 50%;
  max-width: 50%;
}

#header-v2 .align-items-center {
  align-items: center;
}

/* ==========================================
   3. 상단 바 (30px)
   ========================================== */

#header-v2 .top-bar-v2 {
  height: 30px;
  background-color: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  font-size: 13px;
  line-height: 30px;
  color: #888888;
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue",
    "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-weight: 400;
}

#header-v2 .top-bar-v2 .container {
  height: 100%;
  padding-left: 0;
  padding-right: 0;
}

#header-v2 .top-bar-v2 .row {
  height: 100%;
  margin: 0;
}

#header-v2 .top-bar-left-v2 {
  display: flex;
  align-items: center;
  gap: 15px;
  height: 100%;
  padding-left: 0;
  padding-right: 0;
}

#header-v2 .top-bar-logo-v2 {
  height: 100%;
  display: flex;
  align-items: center;
}

#header-v2 .top-bar-logo-v2 img {
  max-height: 24px;
  width: auto;
}

#header-v2 .top-bar-channels-v2 {
  display: flex;
  align-items: center;
  gap: 0;
}

#header-v2 .channel-btn-v2 {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 0 8px;
  transition: opacity 0.2s;
  opacity: 0.6;
}

#header-v2 .channel-btn-v2:hover {
  opacity: 1;
  text-decoration: none;
}

#header-v2 .channel-icon-v2 {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

#header-v2 .channel-divider-v2 {
  width: 1px;
  height: 14px;
  background-color: #888888;
  margin: 0 4px;
}

#header-v2 .top-bar-right-v2 {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  height: 100%;
  padding-left: 0;
  padding-right: 0;
}

#header-v2 .top-bar-actions-v2 {
  display: flex;
  align-items: center;
  gap: 10px;
}

#header-v2 .kakao-btn-v2 {
  background-color: #fae100;
  color: #000000;
  font-size: 13px;
  font-weight: 400;
  padding: 2px 10px;
  border-radius: 4px;
  text-decoration: none;
  transition: background-color 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 24px;
  line-height: 1;
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue",
    "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
}

#header-v2 .kakao-btn-v2:hover {
  background-color: #f0d500;
  color: #000000;
  text-decoration: none;
}

#header-v2 .kakao-icon-v2 {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

#header-v2 .action-btn-v2 {
  font-size: 13px;
  color: #888888;
  text-decoration: none;
  padding: 0 8px;
  transition: color 0.2s;
  font-weight: 400;
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue",
    "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
}

#header-v2 .action-btn-v2:hover {
  color: #4085ff;
  text-decoration: none;
}

#header-v2 .user-greeting-v2 {
  font-size: 13px;
  color: #888888;
  margin-right: 8px;
  font-weight: 400;
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue",
    "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
}

/* ==========================================
   4. 로고 및 로그인 영역
   ========================================== */

#header-v2 .top-logo-v2 {
  background: #fff;
  height: 100px;
  z-index: 10;
  border-bottom: 1px solid #dfe0da;
  display: flex;
  align-items: center;
  overflow: visible;
}

#header-v2 .top-logo-v2 .container {
  height: 100%;
  display: flex;
  align-items: center;
  padding-top: 0;
}

#header-v2 .top-logo-v2 .container > .row {
  height: 100%;
  margin: 0;
  display: flex;
  align-items: center;
  width: 100%;
}

#header-v2 .top-logo-v2 .logo-box-v2 {
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

#header-v2 .top-logo-v2 .logo-box-v2 img {
  height: 44px;
  max-height: 100%;
  width: auto;
  object-fit: contain;
}

#header-v2 .slide-logo-container-v2 {
  display: flex;
  align-items: center;
  height: 100%;
  padding-left: 0;
  padding-right: 0;
}

#header-v2 .top-logo-v2 .slide-logo-wrapper-v2 {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  overflow: visible;
}

#header-v2 .top-logo-v2 .slide-logo-item-v2 {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  pointer-events: none;
}

#header-v2 .top-logo-v2 .slide-logo-item-v2.active {
  opacity: 1;
  position: relative;
  pointer-events: auto;
}

#header-v2 .top-logo-v2 .slide-logo-item-v2 img {
  max-height: 90px;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  transform: scale(0.8);
  transform-origin: left center;
  padding-left: 40px;
}

#header-v2 .top-logo-v2 .slide-logo-item-v2.slide-logo-item-padded img {
  padding-left: 95px;
}

#header-v2 .top-logo-buttons-v2 {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  padding-right: 0;
}

#header-v2 .top-logo-buttons-v2 .button-set-v2 {
  display: flex;
  align-items: center;
  gap: 15px;
  height: 100%;
}

#header-v2 .top-logo-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: opacity 0.2s;
  min-width: 60px;
  cursor: pointer;
}

#header-v2 .top-logo-btn:hover {
  opacity: 0.7;
  text-decoration: none;
}

#header-v2 .top-logo-btn .btn-icon-v2 {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
  width: 44px;
  height: 44px;
  background-color: #4085ff;
  border-radius: 50%;
  padding: 8px;
}

/* 나의강의실 버튼만 다른 색상 */
#header-v2 .top-logo-btn:nth-child(5) .btn-icon-v2 {
  background-color: #10B981;
}

#header-v2 .top-logo-btn .btn-icon-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

#header-v2 .top-logo-btn .btn-text-v2 {
  font-size: 12px;
  color: #373535;
  text-align: center;
  line-height: 1.2;
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue",
    "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-weight: 400;
}

/* ==========================================
   5. GNB (Global Navigation Bar)
   ========================================== */

#header-v2 .gnb-v2 {
  width: 100%;
  height: 54px;
  background: #fff;
  position: relative;
  border-bottom: 1px solid #dfe0da;
}

#header-v2 .gnb-v2 .container {
  height: 100%;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

#header-v2 .gnb-v2 .gnb-list-v2 {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  list-style: none;
  margin: 0;
  padding: 0;
}

#header-v2 .gnb-v2 .gnb-list-v2 .gnb-item-v2 {
  position: relative;
  box-sizing: border-box;
  flex: 0 0 12.5%;
  max-width: 12.5%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-bottom: none;
}

#header-v2 .gnb-v2 .gnb-list-v2 .gnb-item-v2 span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

#header-v2 .gnb-v2 .gnb-list-v2 .gnb-item-v2 span > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #373535;
  font-size: 18px;
  text-decoration: none;
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue",
    "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-weight: 600;
}

/* GNB 호버 시 하단 라인 - 가운데서부터 펼쳐지는 효과 */
#header-v2 .gnb-v2 .gnb-list-v2 .gnb-item-v2::after {
  content: "" !important;
  display: block !important;
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 80%;
  height: 3px;
  background-color: #4085ff;
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform-origin: center;
  z-index: 10;
}

#header-v2 .gnb-v2 .gnb-list-v2 .gnb-item-v2:hover::after {
  transform: translateX(-50%) scaleX(1);
}

/* hover-active는 제거 - 개별 아이템 호버만 작동 */

#header-v2 .gnb-v2 .gnb-list-v2 .gnb-item-v2.keep-line::after {
  transform: translateX(-50%) scaleX(1);
}

#header-v2 .gnb-v2 .gnb-list-v2 .gnb-item-v2.gnb-all-v2::after {
  display: none;
}

/* ==========================================
   6. 전체 메뉴 (menu-all)
   ========================================== */

#header-v2 .menu-all-v2 {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 2000;
  background: #fff;
  width: 100%;
  padding-left: 0;
  padding-right: 0;
  box-sizing: border-box;
  border-top: 1px solid #dfe0da;
  border-bottom: 1px solid #dfe0da;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-8px);
  transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    visibility 0s;
}

#header-v2 .menu-all-v2 .container {
  width: 1170px;
  max-width: 1170px;
  margin: 0 auto;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

#header-v2 .menu-all-v2.menuOpen {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    visibility 0s;
}

#header-v2 .menu-all-v2 .ma-list-v2 {
  display: flex;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

#header-v2 .menu-all-v2 .ma-item-v2 {
  flex: 0 0 12.5%;
  max-width: 12.5%;
  position: relative;
  box-sizing: border-box;
  padding-top: 16px;
  padding-bottom: 16px;
  transition: background-color 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 컬럼 구분선 */
#header-v2 .menu-all-v2 .ma-item-v2::before {
  content: "";
  display: block;
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 100%;
  background-color: #dfe0da;
  opacity: 1;
}

#header-v2 .menu-all-v2 .ma-item-v2:first-child::before {
  display: block;
}

/* 마지막 컬럼 오른쪽 보더 */
#header-v2 .menu-all-v2 .ma-item-v2:last-child::after {
  content: "";
  display: block;
  position: absolute;
  right: 0;
  top: 0;
  width: 1px;
  height: 100%;
  background-color: #dfe0da;
}

#header-v2 .menu-all-v2 .ma-item-v2:hover,
#header-v2 .menu-all-v2 .ma-item-v2.column-hover {
  background-color: rgba(64, 133, 255, 0.05);
}

/* 대메뉴 타이틀 숨김 */
#header-v2 .menu-all-v2 .ma-item-v2 p {
  display: none;
}

/* 소메뉴 리스트 */
#header-v2 .menu-all-v2 .ma-item-v2 .menu-item-v2 {
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: center;
}

#header-v2 .menu-all-v2 .ma-item-v2 .menu-item-v2 li {
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: center;
}

#header-v2 .menu-all-v2 .ma-item-v2 .menu-item-v2 li {
  margin: 4px 0;
}

#header-v2 .menu-all-v2 .ma-item-v2 .menu-item-v2 li a {
  display: block;
  width: 100%;
  padding: 8px 12px;
  text-align: center;
  transition: color 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  color: #373535;
  font-size: 14px;
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue",
    "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-weight: 400;
  text-decoration: none;
  white-space: nowrap;
  border-radius: 4px;
}

#header-v2 .menu-all-v2 .ma-item-v2 .menu-item-v2 li a:hover {
  color: #4085ff;
  text-decoration: none;
}

/* ==========================================
   7. 개별 드롭다운 (사용 안 함)
   ========================================== */

#header-v2 .gnb-v2 .gnb-list-v2 .gnb-item-v2 .menu-item-v2 {
  display: none;
}

#header-v2.menu-all-open .gnb-v2 .gnb-list-v2 .gnb-item-v2:hover .menu-item-v2,
#header-v2.menu-all-open .gnb-v2 .gnb-list-v2 .gnb-item-v2 .menu-item-v2 {
  display: none;
  visibility: hidden;
  opacity: 0;
}

/* ==========================================
   8. fixedBottom 숨김
   ========================================== */

#fixedBottom {
  display: none;
  visibility: hidden;
  height: 0;
  overflow: hidden;
  position: absolute;
  bottom: -9999px;
}

/* ==========================================
   9. 띠배너 (Announcement Banner)
   ========================================== */

/* ==========================================
   띠배너 고립화 - 최소 리셋
   ========================================== */

/* 모든 하위 요소 기본 스타일 - 전역 reset 차단 */
#announcement-banner,
#announcement-banner *,
#announcement-banner *::before,
#announcement-banner *::after {
  box-sizing: border-box !important;
  margin: 0;
  padding: 0;
  border: 0;
  font: inherit;
  vertical-align: baseline;
}

/* 띠배너 루트 요소 스타일 */
#announcement-banner {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 16px;
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto,
    "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-weight: 400;
  vertical-align: baseline;
  line-height: 1;
  letter-spacing: normal;
  position: sticky;
  top: 0;
  z-index: 999; /* 헤더(1000)보다 1 낮게 */
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(3px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  height: 50px;
}

/* 링크 기본 스타일 - 전역 a 스타일 차단 */
#announcement-banner a {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: inherit;
  font-family: inherit;
  font-weight: inherit;
  vertical-align: baseline;
  color: inherit;
  text-decoration: none;
  background-color: transparent;
}

/* 버튼 기본 스타일 - 전역 button 스타일 차단 */
#announcement-banner button {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: inherit;
  font-family: inherit;
  font-weight: inherit;
  vertical-align: baseline;
  background-color: transparent;
  cursor: pointer;
}

/* SVG 스타일 */
#announcement-banner svg {
  display: block;
}

/* ==========================================
   띠배너 컨텐츠 스타일
   ========================================== */

#announcement-banner .container {
  max-width: 1170px;
  height: 100%;
  padding: 0 20px;
  margin: 0 auto;
}

#announcement-banner .banner-content {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 20px;
  position: relative;
}

#announcement-banner .banner-text {
  display: flex;
  align-items: center;
}

#announcement-banner .banner-title {
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;
}

#announcement-banner .banner-timer {
  display: flex;
  align-items: center;
  gap: 8px;
}

#announcement-banner .banner-timer .timer-item {
  display: flex;
  align-items: baseline;
  gap: 2px;
}

#announcement-banner .banner-timer .timer-value {
  font-size: 18px;
  font-weight: 700;
  color: #ffd700;
  font-variant-numeric: tabular-nums;
}

#announcement-banner .banner-timer .timer-label {
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;
  opacity: 0.9;
}

#announcement-banner .banner-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  background: #ffd700;
  color: #000000;
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.3s ease;
}

#announcement-banner .banner-btn:hover {
  background: #ffc700;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
  text-decoration: none;
  color: #000000;
}

#announcement-banner .banner-close {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #ffffff;
  cursor: pointer;
  padding: 4px;
  opacity: 0.6;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

#announcement-banner .banner-close:hover {
  opacity: 1;
}

/* 슬라이드 업 애니메이션 */
@keyframes slideUp {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(-100%);
    opacity: 0;
  }
}

#announcement-banner.banner-slide-up {
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
