/**
 * HrdFlex Side Menu Theme CSS
 * 사이드 메뉴 전용 디자인 시스템
 * Created: 배서연
 */

/* ========================================
   0. 기초 디자인 시스템 import
   ======================================== */
@import url('./hrdflex.theme.css');

/* ========================================
   1. 사이드 메뉴 오버레이
   ======================================== */
#flexside_menu_bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 9998;
  transition: opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
}

#flexside_menu_bg.active {
  opacity: 1;
  pointer-events: auto;
}

/* ========================================
   2. 사이드 메뉴 컨테이너
   ======================================== */
#flexside_menu {
  position: fixed;
  top: 0;
  right: -320px;
  width: 320px;
  height: 100%;
  background: var(--bg-white);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

#flexside_menu.active {
  right: 0;
}

/* 다크 테마 버전 */
#flexside_menu.dark-theme {
  background: linear-gradient(135deg, #1a1f3a 0%, #0f1322 100%);
  color: var(--text-white);
}

/* ========================================
   3. 사이드 메뉴 헤더
   ======================================== */
#menu_h_bl {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-light);
  position: sticky;
  top: 0;
  z-index: 10;
}

.dark-theme #menu_h_bl {
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* 메뉴 타이틀 */
.menu-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--primary-blue);
  margin: 0;
}

.dark-theme .menu-title {
  color: var(--hrdflex-blue);
}

/* 닫기 버튼 */
.menu-close-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition-smooth);
  color: var(--text-gray);
}

.menu-close-btn:hover {
  background: var(--bg-light);
  transform: rotate(90deg);
}

.dark-theme .menu-close-btn {
  color: rgba(255, 255, 255, 0.7);
}

.dark-theme .menu-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.menu-close-btn svg {
  width: 20px;
  height: 20px;
}

/* ========================================
   4. 사이드 메뉴 콘텐츠
   ======================================== */
#menu_c_bl {
  padding: 1.5rem;
  flex: 1;
  overflow-y: auto;
}

/* 사용자 정보 섹션 */
.ml1 {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.dark-theme .ml1 {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ml1_r {
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.3;
}

.dark-theme .ml1_r {
  color: white;
}

/* 정보 항목 */
.ml2 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--bg-light);
}

.dark-theme .ml2 {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.ml2_l {
  font-size: var(--font-size-sm);
  color: var(--text-gray);
  font-weight: 500;
}

.dark-theme .ml2_l {
  color: rgba(255, 255, 255, 0.6);
}

.ml2_r {
  font-size: var(--font-size-base);
  color: var(--text-dark);
  font-weight: 600;
}

.dark-theme .ml2_r {
  color: white;
}

/* 통계 카드 */
.ml3 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--bg-light);
  border-radius: var(--radius-lg);
  margin: 1.5rem 0;
}

.dark-theme .ml3 {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
}

.ml3_l, .ml3_r {
  text-align: center;
}

.ml3_l_t, .ml3_r_t {
  font-size: var(--font-size-xs);
  color: var(--text-gray);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.dark-theme .ml3_l_t,
.dark-theme .ml3_r_t {
  color: rgba(255, 255, 255, 0.5);
}

.ml3_l_c, .ml3_r_c {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--primary-blue);
}

.dark-theme .ml3_l_c,
.dark-theme .ml3_r_c {
  color: var(--hrdflex-blue);
}

/* ========================================
   5. 메뉴 링크
   ======================================== */
.menu_bl {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
}

.dark-theme .menu_bl {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* 수강안내문 버튼 그룹 */
.menu_bl .flex {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.menu_line_center {
  padding: 0.75rem 1rem;
  background: var(--bg-light);
  border-radius: var(--radius-md);
  text-align: center;
  color: var(--text-dark);
  font-size: var(--font-size-sm);
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition-smooth);
  border: 1px solid transparent;
}

.menu_line_center:hover {
  background: var(--primary-blue);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 102, 255, 0.2);
}

.dark-theme .menu_line_center {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.dark-theme .menu_line_center:hover {
  background: var(--hrdflex-blue);
  border-color: var(--hrdflex-blue);
}

/* 메뉴 아이템 */
.menu_line {
  display: flex;
  align-items: center;
  padding: 0.875rem 1rem;
  margin: 0.25rem 0;
  border-radius: var(--radius-md);
  transition: var(--transition-smooth);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.menu_line:before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary-blue);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.menu_line:hover {
  background: var(--bg-light);
  padding-left: 1.5rem;
}

.menu_line:hover:before {
  transform: translateX(0);
}

.dark-theme .menu_line:hover {
  background: rgba(255, 255, 255, 0.05);
}

.dark-theme .menu_line:before {
  background: var(--hrdflex-blue);
}

/* 메뉴 아이콘 */
.menu_line_l {
  width: 24px;
  height: 24px;
  margin-right: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.menu_line_l img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  opacity: 0.8;
  transition: var(--transition-smooth);
}

.menu_line:hover .menu_line_l img {
  opacity: 1;
  transform: scale(1.1);
}

/* Font Awesome 아이콘 지원 */
.menu_line_l i {
  font-size: 18px;
  color: var(--primary-blue);
  transition: var(--transition-smooth);
}

.dark-theme .menu_line_l i {
  color: var(--hrdflex-blue);
}

.menu_line:hover .menu_line_l i {
  transform: scale(1.1);
}

/* 메뉴 텍스트 */
.menu_line_r {
  font-size: var(--font-size-base);
  font-weight: 500;
  color: var(--text-dark);
  flex: 1;
}

.dark-theme .menu_line_r {
  color: rgba(255, 255, 255, 0.9);
}

.menu_line:hover .menu_line_r {
  color: var(--primary-blue);
}

.dark-theme .menu_line:hover .menu_line_r {
  color: var(--hrdflex-blue);
}

/* 로그아웃 섹션 특별 스타일 */
.menu_bl:last-child .menu_line {
  background: rgba(255, 59, 48, 0.05);
  border: 1px solid rgba(255, 59, 48, 0.1);
}

.menu_bl:last-child .menu_line:hover {
  background: rgba(255, 59, 48, 0.1);
  border-color: rgba(255, 59, 48, 0.2);
}

.menu_bl:last-child .menu_line_r {
  color: #ff3b30;
}

/* ========================================
   6. 스크롤바 커스텀
   ======================================== */
#flexside_menu::-webkit-scrollbar {
  width: 6px;
}

#flexside_menu::-webkit-scrollbar-track {
  background: transparent;
}

#flexside_menu::-webkit-scrollbar-thumb {
  background: var(--border-gray);
  border-radius: 3px;
}

#flexside_menu::-webkit-scrollbar-thumb:hover {
  background: var(--primary-blue);
}

.dark-theme #flexside_menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
}

.dark-theme #flexside_menu::-webkit-scrollbar-thumb:hover {
  background: var(--hrdflex-blue);
}

/* ========================================
   7. 애니메이션
   ======================================== */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

#flexside_menu.active {
  animation: slideInRight 0.3s ease forwards;
}

#flexside_menu_bg.active {
  animation: fadeIn 0.3s ease forwards;
}

/* ========================================
   8. 반응형 디자인
   ======================================== */
@media (max-width: 480px) {
  #flexside_menu {
    width: 100%;
    right: -100%;
  }

  #menu_c_bl {
    padding: 1rem;
  }

  .ml1_r {
    font-size: var(--font-size-lg);
  }

  .ml3 {
    padding: 1rem;
  }

  .ml3_l_c, .ml3_r_c {
    font-size: var(--font-size-lg);
  }

  .menu_line {
    padding: 0.75rem;
  }

  .menu_line_r {
    font-size: var(--font-size-sm);
  }
}

/* ========================================
   9. 접근성
   ======================================== */
.menu_line:focus-visible,
.menu_line_center:focus-visible {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}

.dark-theme .menu_line:focus-visible,
.dark-theme .menu_line_center:focus-visible {
  outline-color: var(--hrdflex-blue);
}

/* Skip to content for screen readers */
.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;
}

/* ========================================
   10. 유틸리티 클래스
   ======================================== */
.hidden {
  display: none !important;
}

.scroll-disabled {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

/* Badge 스타일 */
.badge-new {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  background: var(--primary-red);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  margin-left: 0.5rem;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

/* 학습 등급별 색상 */
.level-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.level-새싹 {
  background: linear-gradient(135deg, #4caf50, #66bb6a);
  color: white;
}

.level-비상 {
  background: linear-gradient(135deg, #2196f3, #42a5f5);
  color: white;
}

.level-열정 {
  background: linear-gradient(135deg, #ff9800, #ffa726);
  color: white;
}

.level-성장 {
  background: linear-gradient(135deg, #9c27b0, #ab47bc);
  color: white;
}

.level-전문 {
  background: linear-gradient(135deg, #f44336, #ef5350);
  color: white;
}

.level-마스터 {
  background: linear-gradient(135deg, #f44336, #ef5350);
  color: white;
}

.level-레전드 {
  background: linear-gradient(135deg, #f44336, #ef5350);
  color: white;
}