/* =====================================================
   DRAWER MENU – Native Learning App Style
   =====================================================
   기존 jsmobilemenu.css의 .menuwrap / .mobile-menu 동작은 유지
   내부 콘텐츠만 이 파일에서 스타일링
   ===================================================== */

/* ── 변수 ── */
:root {
  --drawer-bg:        #FFFFFF;
  --drawer-surface:   #F4F6F9;
  --drawer-primary:   #1a365d;      /* 학원 네이비 */
  --drawer-primary-light: #e8edf5;
  --drawer-text:      #1A1D23;
  --drawer-text-sub:  #5A6070;
  --drawer-text-muted:#8B95A5;
  --drawer-radius:    12px;
  --drawer-radius-sm: 8px;
  --drawer-gap:       16px;
}

/* ── 드로어 내부 전체 리셋 ── */
.menuwrap * { box-sizing: border-box; }
.menuwrap { background: var(--drawer-bg) !important; }

/* ── Section 1: 프로필 헤더 ── */
.drawer-header {
  padding: calc(env(safe-area-inset-top, 16px) + 28px) var(--drawer-gap) 16px;
  border-bottom: 1px solid #F0F2F5;
}

.drawer-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

/* X 닫기 버튼: 프로필 우측 끝 */
.btn-drawer-close {
  flex-shrink: 0;
  margin-left: auto;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 50%;
  color: var(--drawer-text-muted);
  cursor: pointer;
  transition: background 0.15s;
  padding: 0;
}
.btn-drawer-close:active {
  background: var(--drawer-surface);
}

.profile-avatar {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--drawer-surface);
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-text {
  flex: 1;
  min-width: 0;
}

.profile-name {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--drawer-text);
  line-height: 1.3;
  margin-bottom: 2px;
}

.profile-greeting {
  display: block;
  font-size: 12px;
  color: var(--drawer-text-muted);
  line-height: 1.3;
}

/* 메인 액션 버튼 */
.btn-drawer-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  background: var(--drawer-primary);
  color: #fff !important;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--drawer-radius-sm);
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
  letter-spacing: -0.2px;
}
.btn-drawer-primary:active {
  transform: scale(0.97);
  background: #14294a;
}

/* ── Section 2: 핵심 4대장 그리드 ── */
.drawer-core {
  padding: 16px var(--drawer-gap) 8px;
  margin-bottom: 0;
}

.feature-grid {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 12px;
  background: var(--drawer-surface);
  border-radius: var(--drawer-radius);
}

.feature-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 4px;
  background: transparent;
  border-radius: 10px;
  border: none;
  box-shadow: none;
  text-decoration: none;
  color: var(--drawer-text);
  transition: background 0.15s;
  flex: 1;
}
.feature-card:active {
  background: rgba(0,0,0,0.04);
}

.feature-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.feature-icon.fi-blue  { background: #DBEAFE; color: #2563EB; }
.feature-icon.fi-red   { background: #FEE2E2; color: #DC2626; }
.feature-icon.fi-green { background: #D1FAE5; color: #059669; }
.feature-icon.fi-gray  { background: #E5E7EB; color: #4B5563; }

.feature-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--drawer-text);
  letter-spacing: -0.3px;
  white-space: nowrap;
}

/* ── Section 3 & 4: 리스트 메뉴 ── */
.drawer-section {
  padding: 0;
  margin-bottom: 16px;
}

.drawer-sub,
.drawer-info {
  padding: 0 var(--drawer-gap);
}

.drawer-section-title {
  font-size: 14px;
  font-weight: 700;
  color: #495057;
  letter-spacing: -0.2px;
  margin: 0 0 12px 4px;
  padding: 0;
}

.drawer-menu-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.drawer-menu-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: var(--drawer-text) !important;
  text-decoration: none !important;
  font-size: 16px;
  font-weight: 500;
  border-radius: var(--drawer-radius-sm);
  transition: background 0.12s;
  cursor: pointer;
  position: relative;
}
.drawer-menu-link:active {
  background: var(--drawer-surface);
}
.drawer-menu-link svg {
  color: var(--drawer-text-muted);
  flex-shrink: 0;
}

/* 톤다운 텍스트 (이용안내 섹션) */
.drawer-menu-link.muted {
  color: var(--drawer-text-sub) !important;
  font-size: 14px;
  font-weight: 400;
}

/* 확장 화살표 */
.expand-arrow {
  margin-left: auto;
  color: var(--drawer-text-muted);
  transition: transform 0.25s;
}

/* NEW 뱃지 */
.drawer-badge-new {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  background: #ff3b30;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  font-family: 'Montserrat', sans-serif;
  border-radius: 4px;
  line-height: 1;
  letter-spacing: 0.5px;
  margin-left: 6px;
}

/* ── 서브메뉴 (접기/펼치기) ── */
.drawer-submenu {
  padding: 4px 0 8px 28px;
}

.drawer-submenu-link {
  display: block;
  padding: 9px 8px;
  font-size: 13px;
  font-weight: 400;
  color: var(--drawer-text-sub) !important;
  text-decoration: none !important;
  border-radius: 6px;
  transition: background 0.12s;
  position: relative;
}
.drawer-submenu-link:active {
  background: var(--drawer-surface);
}

/* 서브메뉴 new-dot 재배치 */
.drawer-submenu-link .new-dot {
  position: relative;
  display: inline-block;
  left: 0;
  top: 0;
  transform: none;
  margin-right: 4px;
}

/* ── Footer (정보수정/로그아웃) ── */
.drawer-footer {
  padding: 20px var(--drawer-gap);
  margin-top: 8px;
  border-top: 1px solid #F0F2F5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.drawer-footer-link {
  font-size: 13px;
  font-weight: 400;
  color: var(--drawer-text-muted) !important;
  text-decoration: none !important;
  transition: color 0.15s;
}
.drawer-footer-link:active {
  color: var(--drawer-text) !important;
}

.drawer-footer-divider {
  color: #D1D5DB;
  font-size: 12px;
}

/* ── 기존 m_menu 스타일 완전히 숨김 ── */
.menuwrap .m_menu_top_h,
.menuwrap .m_menu_line,
.menuwrap .m_name,
.menuwrap .m_btn_logout {
  /* 새 드로어에서는 사용하지 않음 */
}
