/* 
 * JumClass Student Design System - Mobile Header Component
 * 학생용 디자인 시스템 모바일 헤더 컴포넌트
 * 피그마 디자인 기반 구현
 */

/* ===== 모바일 헤더 기본 스타일 ===== */
.jumclass-mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: #000;
  z-index: 1000;
  width: 100%;
  box-sizing: border-box;
}

.mobile-header-inner {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 17px;
  box-sizing: border-box;
}

/* ===== 마이페이지용 모바일 헤더 ===== */
.mobile-header-mypage {
  display: none;
  /* 밑줄 제거 */
  border-bottom: none !important;
  box-shadow: none !important;
}

@media (max-width: 768px) {
  /* 마이페이지에서만 표시 */
  body.mypage-page .mobile-header-mypage {
    display: block !important;
  }
  
  /* 마이페이지에서 기존 헤더 숨김 */
  body.mypage-page #header {
    display: none !important;
  }
  
  /* 컨텐츠 상단 여백 조정 */
  body.mypage-page #wrapper {
    padding-top: 0;
  }
  
  /* 메인 컨텐츠 영역 조정 - 간격 축소 */
  body.mypage-page .sub-conts-wrap {
    padding: 0 !important;
  }
  
  /* 마이페이지 모든 상위 컨테이너 패딩 제거 */
  body.mypage-page #wrapper.student-new {
    padding: 0 !important;
    margin: 0 !important;
  }
  
  body.mypage-page #contents {
    margin: 0 !important;
    padding: 0 !important;
  }
  
  /* 모바일 헤더 스타일 개선 */
  .mobile-header-mypage .mobile-header-inner {
    padding: 0 20px;
  }
  
  .mobile-header-mypage .mobile-header-title {
    font-family: 'Pretendard';
    font-style: normal;
    font-weight: 700;
    font-size: 16px;
    line-height: 140%;
    text-align: center;
    letter-spacing: -0.03em;
    color: #FFFFFF;
    width: 100%;
    /* tyle="color: white; font-size: 18px; font-weight: 600; */
  }
  
  /* 뒤로가기 버튼 위치 조정 */
  .mobile-header-mypage .mobile-back-btn {
    left: 12.22px;
  }
}

/* 뒤로가기 버튼 */
.mobile-back-btn {
  position: absolute;
  width: 28px;
  height: 28px;
  left: 12.22px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-back-btn svg {
  width: 24px;
  height: 24px;
}

.mobile-back-btn path {
  stroke: #FFFFFF;
  stroke-width: 2px;
}

.mobile-back-btn svg {
  width: 28px;
  height: 28px;
}

.mobile-back-btn svg path {
  /* Removed rotation to keep arrow pointing left */
  transform-origin: center;
}

/* 페이지 제목 */
.mobile-page-title {
  font-family: 'Pretendard';
  font-style: normal;
  font-weight: 700;
  font-size: 16px;
  line-height: 140%;
  text-align: center;
  letter-spacing: -0.48px;
  color: #FFFFFF;
}

/* ===== 일반 페이지용 모바일 헤더 ===== */
.mobile-header-general {
  display: none;
}

/* 모바일 헤더 메인 스타일 - 중복 제거됨 */

/* 로고 영역 */
.mobile-logo-wrapper {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.mobile-logo {
  display: block;
  width: 130px;
  height: 25px;
  line-height: 1;
}

.mobile-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* 우측 액션 영역 */
.mobile-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.mobile-header-link {
  font-family: 'Pretendard';
  font-style: normal;
  font-weight: 700;
  font-size: 13px;
  line-height: 140%;
  letter-spacing: -0.03em;
  color: #FFFFFF;
  text-decoration: none;
}

.mobile-header-username {
  font-family: 'Pretendard';
  font-style: normal;
  font-weight: 700;
  text-decoration: none;
  color: #ffffff;
  font-size: 13px;
  line-height: 140%;
  letter-spacing: -0.03em;
  color: #FFFFFF;
}

/* 모바일 로그인/로그아웃 버튼 */
.mobile-login-btn {
  display: inline-block !important;
  font-family: 'Pretendard';
  font-style: normal;
  font-weight: 700;
  font-size: 13px;
  line-height: 140%;
  color: #1A1A1A !important;
  background-color: #FFFFFF !important;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid #FFFFFF;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
  margin: 0 4px;
}

.mobile-login-btn:hover {
  background-color: #F0F0F0;
  transform: scale(1.02);
}

/* 모바일 메뉴 버튼 */
.mobile-menu-btn {
  position: relative;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4.56px;
}

.menu-line {
  width: 17.5px;
  height: 0;
  border: 1.76965px solid #FFFFFF;
  background: transparent;
}

/* ===== 모바일 반응형 (768px 이하) ===== */
@media (max-width: 768px) {
  /* 마이페이지에서만 마이페이지 헤더 표시 */
  body.mypage-page .mobile-header-mypage,
  html.mypage-page .mobile-header-mypage,
  .mypage-page .mobile-header-mypage {
    display: block !important;
  }

  /* 마이페이지가 아닌 페이지에서는 일반 모바일 헤더 표시 */
  body:not(.mypage-page) .jumclass-mobile-header,
  .jumclass-mobile-header-wrapper .jumclass-mobile-header {
    display: block !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 60px !important;
    background: #000 !important;
    z-index: 1000 !important;
  }
  
  /* 마이페이지에서는 일반 모바일 헤더 숨김 */
  body.mypage-page .jumclass-mobile-header:not(.mobile-header-mypage) {
    display: none !important;
  }

  /* 데스크탑 헤더 숨기기 - 더 구체적인 선택자 */
  .student-new-header,
  #wrapper.student-new #header,
  #wrapper #header,
  #header,
  .desktop-header,
  header#header {
    display: none !important;
  }

  /* 일반 페이지 컨텐츠 영역 상단 패딩 조정 */
  body:not(.mypage-page) {
    padding-top: 60px;
  }
  
  /* 마이페이지는 별도 처리 */
  body.mypage-page {
    padding-top: 0;
  }

  #wrapper {
    padding-top: 0;
  }

  #contents {
    padding-top: 0;
  }

  .student-new {
    margin-top: 0;
  }

  /* 마이페이지 컨텐츠는 myclass.css에서 관리 */

  /* 마이페이지 사이드바는 유지 */

  /* 마이페이지 컨텐츠 영역 조정 */
  .mypage-page .myclass-content-wrapper {
    margin-left: 0;
    padding: 15px;
  }

  .mypage-page .myclass-content {
    width: 100%;
  }

  /* 마이페이지 전체 레이아웃 조정 */
  .mypage-wrap {
    display: block !important;
  }

  .mypage-conts {
    width: 100% !important;
    margin: 0 !important;
  }

}

/* ===== 모바일 메뉴 스타일 ===== */
.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  right: -300px;
  width: 300px;
  height: 100vh;
  background: #1A1A1A;
  z-index: 2000;
  transition: right 0.3s ease;
  overflow-y: auto;
}

/* 768px 미만에서 표시 (모바일/태블릿) */
@media (max-width: 767px) {
  .mobile-menu {
    display: block;
  }
}

/* 데스크톱에서는 숨기기 */
@media (min-width: 768px) {
  .mobile-menu,
  .mobile-menu-overlay {
    display: none !important;
  }
}

.mobile-menu.active {
  right: 0;
}

.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-menu-header h2 {
  font-size: 18px;
  color: #FFF;
  font-weight: 600;
  margin: 0;
}

.mobile-menu-close {
  background: none;
  border: none;
  font-size: 28px;
  color: #FFF;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-menu-content {
  padding: 20px;
}

.mobile-menu-item {
  margin-bottom: 20px;
}

.mobile-menu-item > a {
  display: block;
  color: #FFF;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* 태블릿에서 메뉴 아이템 스타일 */
@media (min-width: 769px) and (max-width: 1024px) {
  /* 모바일 헤더 wrapper 강제 표시 */
  .jumclass-mobile-header-wrapper {
    display: block !important;
    position: relative !important;
    z-index: 9999 !important;
  }
  
  /* 태블릿에서도 모바일 헤더 표시 */
  body:not(.mypage-page) .jumclass-mobile-header,
  .jumclass-mobile-header-wrapper .jumclass-mobile-header {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 60px !important;
    background: #000 !important;
    z-index: 9999 !important;
  }
  
  /* 데스크탑 헤더 강제 숨기기 - 더 구체적인 선택자 */
  #header,
  header#header,
  #wrapper #header,
  #wrapper.student-new #header,
  .student-new-header,
  .desktop-header,
  .header-top-bar,
  .header-main-nav,
  #wrapper.student-new .header-top-bar,
  #wrapper.student-new .header-main-nav {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
  }
  
  /* body 패딩 조정 */
  body {
    padding-top: 60px !important;
  }
  
  /* wrapper 패딩 제거 */
  #wrapper,
  #wrapper.student-new {
    padding-top: 0 !important;
  }
  
  .mobile-menu-item > a {
    font-size: 18px;
    padding: 12px 0;
  }
  
  .mobile-menu-header {
    padding: 24px;
  }
  
  .mobile-menu-content {
    padding: 24px;
  }
}

.mobile-submenu {
  margin-top: 10px;
  padding-left: 20px;
}

.mobile-submenu-item {
  display: block;
  color: #999;
  text-decoration: none;
  font-size: 14px;
  padding: 8px 0;
}

.mobile-submenu-item:hover {
  color: #FFF;
}

/* 모바일 메뉴 오버레이 */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1999;
}

.mobile-menu-overlay.active {
  display: block;
}

/* ===== 작은 화면 대응 ===== */
@media (max-width: 380px) {
  /* 강사신청/문의 텍스트를 줄임 */
  .mobile-header-link:first-child {
    font-size: 12px;
  }
  
  .mobile-header-inner {
    padding: 0 12px;
  }
  
  .mobile-header-actions {
    gap: 8px;
  }
}

@media (max-width: 340px) {
  /* 매우 작은 화면에서는 강사신청 링크 숨김 */
  .mobile-header-link:first-child {
    display: none !important;
  }
  
  .mobile-header-inner {
    padding: 0 10px;
  }
}

/* 모바일에서만 표시 */
@media (max-width: 768px) {
  .mobile-menu {
    display: block;
  }
}

/* ===== 강력한 오버라이드 규칙 (최우선 적용) ===== */
/* 1024px 이하 모든 화면에서 모바일 헤더 표시 */
@media screen and (max-width: 1024px) {
  /* 모바일 헤더 wrapper 강제 표시 */
  .jumclass-mobile-header-wrapper {
    display: block !important;
    position: relative !important;
    z-index: 9999 !important;
  }
  
  /* 일반 페이지 모바일 헤더 강제 표시 */
  .jumclass-mobile-header-wrapper .jumclass-mobile-header {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 60px !important;
    background-color: #000 !important;
    z-index: 9999 !important;
  }
  
  /* 모바일 헤더 내부 요소 표시 */
  .jumclass-mobile-header .mobile-header-inner {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: 60px !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 17px !important;
  }
  
  /* 로고 영역 표시 */
  .jumclass-mobile-header .mobile-logo-wrapper,
  .jumclass-mobile-header .mobile-logo {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  /* 액션 영역 표시 */
  .jumclass-mobile-header .mobile-header-actions {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  /* 메뉴 버튼 표시 */
  .jumclass-mobile-header .mobile-menu-btn {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  /* 모든 데스크탑 헤더 강제 숨김 */
  #header,
  header#header,
  #wrapper #header,
  #wrapper.student-new #header,
  .student-new-header,
  .desktop-header,
  .header-top-bar,
  .header-main-nav {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
  }
  
  /* body 패딩 조정 */
  body {
    padding-top: 60px !important;
  }
  
  /* wrapper 패딩 제거 */
  #wrapper,
  #wrapper.student-new {
    padding-top: 0 !important;
  }
}

/* 데스크탑만 (1025px 이상) */
@media screen and (min-width: 1025px) {
  /* 모바일 헤더 숨기기 */
  .jumclass-mobile-header-wrapper,
  .jumclass-mobile-header,
  .mobile-header-mypage {
    display: none !important;
  }
  
  /* 데스크탑 헤더 표시 */
  #header,
  #wrapper.student-new #header {
    display: block !important;
    visibility: visible !important;
    height: auto !important;
  }
}