/* 기본 설정 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'IBM Plex Sans KR', sans-serif;
}

body {
  background-color: #ffffff;
  color: #333;
  -ms-overflow-style: none;
}
::-webkit-scrollbar {
  display: none;
}
/* 
body.index-page {
  background: radial-gradient(circle 300px, #383e4f, #0b0f1a);
} */

a {
  text-decoration: none;
  color: inherit;
}
ul {
  list-style: none;
}

/* 컨테이너 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 헤더 */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
  background-color: #0b0f1a;
  padding: 0 20px;
  transition:
    background-color 0.3s ease,
    border-bottom 0.3s ease;
}

header:not(.main-header) {
  border-bottom: 1px solid #eee;
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo {
  font-size: 24px;
  font-weight: bold;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links {
  display: flex;
  gap: 15px;
  font-size: 15px;
  font-weight: 500;
  color: #666;
}

.nav-links li.active {
  color: #7476d4;
  font-weight: bold;
  position: relative;
}

.nav-links li.active::after {
  content: '';
  position: absolute;
  bottom: -25px;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: #7476d4;
}

.menu-toggle {
  cursor: pointer;
  width: 20px;
  display: none;
  margin-left: auto;
}

.mypage-link {
  width: 20px;
  height: 20px;
  /* border-radius: 50%; */
  /* overflow: hidden; */
}

.mypage-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.team-link {
  font-size: 14px;
  color: #666;
  border-left: 1px solid #666;
  padding-left: 15px;
}

.login {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 10px;
  background-color: #7476d4;
  color: #0b0f1a;
  font-size: 14px;
}

body.main-page .login {
  color: #ffffff;
}

body.main-page .mypage-link.member-only img {
  filter: brightness(0) saturate(100%);
}

.login-container {
  margin: 170px auto;
  padding: 50px 40px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-radius: 10px;
  border: 2px solid #f5f5f5;
  width: 400px;
}

.login-button {
  background-color: #7476d4;
  color: white;
  border: none;
  border-radius: 5px;
  padding: 5px;
  cursor: pointer;
}

.password-field {
  position: relative;
}

.password-field .input {
  width: 100%;
  padding-right: 46px;
}

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border: none;
  background-color: transparent;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  cursor: pointer;
}

.password-toggle:focus {
  outline: none;
}

.login-container .input {
  color: #000;
  padding: 5px 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
}

#sign-link:hover {
  color: #7476d4;
}

/* 탭 메뉴 */
.tabs {
  display: flex;
  gap: 20px;
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 20px;
}

.tabs span {
  color: #111;
}

.tabs span.inactive {
  color: #bbb;
}

/* ----------- 검색창 ----------- */
.search-container {
  margin-bottom: 30px;
}

.search-input {
  width: 100%;
  padding: 15px 20px;
  border: 1px solid #eaeaea;
  border-radius: 8px;
  font-size: 15px;
  background-color: #fafafa;
}

/* ----------- 메인 레이아웃 ----------- */
.main-content {
  display: flex;
  gap: 40px;
  margin-bottom: 50px;
}

.top-tittle {
  display: flex;
}

/* 버튼 기본 스타일 초기화 */
.btn-back {
  background: none;
  border: none;
  padding: 8px; /* 터치 영역 확보 */
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* 뒤로가기 화살표 아이콘 */
.icon-back {
  width: 24px; /* 화살표 너비 */
  height: 24px; /* 화살표 높이 */
  background-color: #0b0f1a;

  /* 마스크 경로 설정 */
  -webkit-mask-image: url('../../assets/left-chevron.png');
  mask-image: url('../../assets/left-chevron.png');

  /* 마스크 속성 최적화 */
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

/* ----------- 사이드바 필터 ----------- */
.sidebar {
  width: 220px;
  flex-shrink: 0;
}

.filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  font-weight: bold;
}

.filter-reset {
  font-size: 12px;
  color: #888;
  font-weight: normal;
}

.filter-group {
  margin-bottom: 25px;
}

.filter-group h4 {
  font-size: 14px;
  color: #555;
  margin-bottom: 12px;
}

.filter-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 14px;
  color: #666;
}

.filter-item input[type='checkbox'] {
  width: 16px;
  height: 16px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* ----------- 카드 리스트 영역 ----------- */
.content-area {
  flex-grow: 1;
}

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.content-header h2 {
  font-size: 18px;
}

.content-header h2 span {
  color: #888;
  font-weight: normal;
}

.sort-select {
  padding: 6px 10px;
  border: 1px solid #eee;
  border-radius: 6px;
  font-size: 13px;
}

footer {
  margin-top: 80px;
  padding: 40px;
  border-top: 1px solid #eee;
  text-align: center;
  color: #aaa;
  /* max-height: 100px; */
}

/* ===== 모바일 대응 ===== */
@media (max-width: 768px) {
  .main-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .sidebar {
    width: 100%;
  }

  .content-area {
    width: 100%;
  }

  /* 1. 토글 버튼 노출 및 위치 고정 */
  .menu-toggle {
    display: block;
    position: absolute;
    right: 15px;
    top: 20px; /* 헤더 패딩에 맞춰 조절하세요 */
  }

  /* 2. 헤더 구조를 세로 배열로 변경 */
  header.header {
    flex-direction: column;
    align-items: flex-start;
    height: auto;
    padding: 15px;
    position: relative;
  }

  .header-left {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
  }

  /* 로고 영역은 상단 고정 */
  .header-left .logo {
    margin-bottom: 10px;
  }

  /* 3. 기본 상태에서 메뉴 숨기기 */
  .nav-links,
  .header-right {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0;
    padding: 0;
  }

  /* 4. 자바스크립트로 active 클래스가 붙었을 때만 노출 */
  .nav-links.active,
  .header-right.active {
    display: flex;
  }

  /* 5. 모바일 메뉴 내부 스타일 정렬 */
  .nav-links li,
  .header-right > div,
  .header-right > a {
    width: 100%;
    text-align: center;
    padding: 12px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.05); /* 디자인에 따라 색상 조절 가능 */
  }

  .header-right {
    margin-top: 0;
    justify-content: center;
    align-items: center;
  }

  .team-link {
    border: none !important;
    padding: 12px 0 !important;
  }
}

/* ===================================================
   ✅ [인덱스 배경전환 적용] 모바일 대응 반응형 스타일 (768px 이하)
   =================================================== */
@media (max-width: 768px) {
  /* [공통] 메인 레이아웃 세로 정렬 */
  .main-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .sidebar,
  .content-area {
    width: 100%;
  }

  .login-container {
    width: 300px;
  }

  /* -----------------------------------------------
     1. index 외의 일반 페이지 (서브 페이지) 모바일 헤더
     ----------------------------------------------- */
  body:not(.main-page) header {
    flex-direction: column !important;
    align-items: flex-start !important;
    height: auto !important;
    padding: 12px 20px !important;
    position: relative !important;
    background-color: #0b0f1a !important; /* 서브페이지는 기존 어두운 배경 유지 */
  }

  body:not(.main-page) .header-left,
  body:not(.main-page) .header-right {
    width: 100% !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 0 !important;
    display: none;
  }

  body:not(.main-page) .header-left {
    display: flex !important;
  }
  body:not(.main-page) .header-left .logo {
    align-self: flex-start !important;
    margin-bottom: 8px;
  }

  body:not(.main-page) .menu-toggle {
    display: block !important;
    position: absolute !important;
    right: 20px;
    top: 20px;
    cursor: pointer;
    filter: none !important; /* 원본 색상 유지 */
  }

  body:not(.main-page) .nav-links {
    display: none !important;
    width: 100% !important;
  }

  body:not(.main-page) .nav-links.active,
  body:not(.main-page) .header-right.active {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: 100% !important;
  }

  body:not(.main-page) .nav-links li,
  body:not(.main-page) .header-right > div,
  body:not(.main-page) .header-right > a {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
    padding: 10px 0 !important;
    font-size: 15px !important;
    color: #ffffff !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-sizing: border-box !important;
    line-height: 1.4 !important;
  }

  .member-only[style*='display: none'] {
    display: none !important;
  }

  body:not(.main-page) .nav-links li.active::after {
    bottom: 3px !important;
    width: 55px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
  }
  body:not(.main-page) .nav-links li.active {
    color: #7476d4 !important;
    font-weight: bold;
  }

  /* -----------------------------------------------
     2. index 페이지 (body.main-page) 전용 모바일 헤더
     ----------------------------------------------- */
  /* 기본 상태: 배경 투명화 */
  body.main-page header.header {
    flex-direction: column;
    align-items: flex-start;
    height: auto;
    padding: 12px 15px;
    position: fixed;
    width: 100%;
    background-color: transparent !important;
    border-bottom: none !important;
    transition:
      background-color 0.3s ease,
      box-shadow 0.3s ease;
    z-index: 9999;
  }

  /* 토글이 켜졌거나 스크롤이 내려갔을 때: 배경 흰색 */
  body.main-page header.header.scrolled {
    background-color: #ffffff !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  }

  body.main-page .header-left {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
  }

  body.main-page .header-left .logo {
    margin-bottom: 8px;
  }

  /* 🎯 [수정] 인덱스 토글 아이콘 초기 상태: filter를 제거하여 원본 검은색 이미지 노출 */
  body.main-page .menu-toggle {
    display: block;
    position: absolute;
    right: 15px;
    top: 18px;
    cursor: pointer;
    filter: none !important; /* 원래 업로드하신 검은색 list.png 그대로 출력 */
    transition: filter 0.3s ease;
  }

  /* 🎯 [수정] 스크롤이 내려가거나 토글이 열려 배경이 하얗게 변했을 때만 #0b0f1a 색상 필터 적용 */
  body.main-page header.header.scrolled .menu-toggle {
    filter: brightness(0) invert(6%) sepia(21%) saturate(2371%)
      hue-rotate(196deg) brightness(97%) contrast(97%) !important;
  }

  /* -----------------------------------------------
     3. 기타 모바일 공통 세부 컴포넌트 조정
     ----------------------------------------------- */
  /* 로그인 버튼 규격 최적화 */
  .login {
    width: 90% !important;
    max-width: 280px;
    margin: 8px auto !important;
    padding: 8px !important;
    background-color: #7476d4 !important;
    border-radius: 8px;
    display: block !important;
  }

  .header-right .login[style*='display: none'] {
    display: none !important;
  }

  /* 인덱스 페이지 모바일 로그인 텍스트 색상 대응 */
  body.main-page .login a {
    color: #ffffff !important;
  }
  body:not(.main-page) .login a {
    color: #0b0f1a !important;
  }

  /* 마이페이지 프로필 박스 두께 슬림화 */
  .mypage-link {
    display: block !important;
    width: 100% !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding: 6px 0 !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
    height: auto !important;
  }

  body.main-page .mypage-link {
    border-top: 1px solid rgba(0, 0, 0, 0.05) !important;
  }

  .mypage-link img {
    width: 36px !important;
    height: 36px !important;
    display: block !important;
    margin: 0 auto !important;
    border-radius: 50%;
    object-fit: cover;
  }

  .team-link {
    border-left: none !important;
    padding-left: 0 !important;
    line-height: 1.4 !important;
  }
}
