/* =========================================
   가이드 페이지 공통 스타일 (guide.css)
   anatomy.html, weekend.html 공통 적용
   ========================================= */

/* =========================================
   가이드 페이지 공통 레이아웃
   ========================================= */

.guide-page {
  padding: 2rem 0 4rem;
}

/* 뒤로가기 버튼 */
.guide-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: none;
  color: #888;
  font-size: 0.875rem;
  cursor: pointer;
  padding: 0.5rem 0;
  margin-bottom: 1.5rem;
  text-decoration: none;
  transition: color 0.2s;
}

.guide-back-btn:hover {
  color: #f5f5f5;
}

/* 페이지 제목 */
.guide-page-title {
  font-size: 1.75rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.guide-page-subtitle {
  color: #888;
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

/* API 에러 메시지 */
.guide-error-msg {
  display: none;
  padding: 1.5rem;
  background-color: #1a1a1a;
  border: 1px solid #3a1a1a;
  border-radius: 0.5rem;
  color: #888;
  text-align: center;
  font-size: 0.95rem;
}

.guide-error-msg.visible {
  display: block;
}

/* =========================================
   2단 레이아웃 (Anatomy 페이지)
   ========================================= */

.guide-layout {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

/* 왼쪽: 지도 컬럼 (flex: 3, 약 60%) */
.guide-map-column {
  flex: 3;
  min-width: 0;
  position: sticky;
  top: 80px;
}

/* 오른쪽: 정보 컬럼 (flex: 2, 약 40%) */
.guide-info-column {
  flex: 2;
  min-width: 0;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}

.guide-info-column::-webkit-scrollbar {
  width: 6px;
}

.guide-info-column::-webkit-scrollbar-track {
  background: transparent;
}

.guide-info-column::-webkit-scrollbar-thumb {
  background-color: #333;
  border-radius: 3px;
}

.guide-info-column::-webkit-scrollbar-thumb:hover {
  background-color: #555;
}

/* 반응형: 768px 미만 단일 컬럼 */
@media (max-width: 768px) {
  .guide-layout {
    flex-direction: column;
  }

  .guide-map-column {
    position: static;
    width: 100%;
  }

  .guide-info-column {
    width: 100%;
    max-height: none;
  }
}

/* =========================================
   레이스카 도면 이미지 + SVG 핀 컨테이너
   ========================================= */

.anatomy-map-wrapper {
  position: relative;
  width: 100%;
  background: #111;
  border: 1px solid #2a2a2a;
  border-radius: 0.75rem;
  overflow: hidden;
}

.anatomy-map-img {
  display: block;
  width: 100%;
  height: auto;
}

/* SVG 핀 오버레이 (이미지 위에 절대 위치) */
.anatomy-pin-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.35s ease;
}

/* 핀 숨기기 상태 */
.anatomy-pin-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.anatomy-pin-overlay svg {
  width: 100%;
  height: 100%;
  /* preserveAspectRatio="xMidYMid meet"과 함께 사용:
     이미지 비율을 유지하면서 핀 좌표가 실제 이미지 영역에 맞게 배치됨 */
}

/* 핀 스타일 — 드롭 핀(📍) 형태 SVG 아이콘 */
.anatomy-pin {
  cursor: pointer;
  pointer-events: all;
  transition: filter 0.2s ease;
  filter: url(#pin-shadow);
}

/* 핀 본체 (path) */
.anatomy-pin .anatomy-pin-body {
  fill: #dc2626;
  stroke: #ffffff;
  stroke-width: 0.5;
  transition: fill 0.2s ease;
}

/* 내부 흰색 점 (원형 머리 중심) */
.anatomy-pin .anatomy-pin-dot {
  fill: #ffffff;
  stroke: none;
  pointer-events: none;
}

.anatomy-pin:hover .anatomy-pin-body,
.anatomy-pin.active .anatomy-pin-body {
  fill: #ff1e1e;
  stroke-width: 0.7;
}

.anatomy-pin:hover,
.anatomy-pin.active {
  filter: url(#pin-shadow-active);
}

/* =========================================
   아코디언 컴포넌트 (Anatomy 페이지)
   ========================================= */

.guide-accordion-item {
  border-bottom: 1px solid #2a2a2a;
}

.guide-accordion-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.875rem 1rem;
  background: transparent;
  border: none;
  color: #f5f5f5;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s;
}

.guide-accordion-header:hover {
  background: #1a1a1a;
}

.guide-accordion-item.active .guide-accordion-header {
  background: #1a1a1a;
}

/* 알파벳 배지 */
.guide-accordion-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  background: #dc2626;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: bold;
  flex-shrink: 0;
  color: #fff;
}

.guide-accordion-title {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 500;
}

.guide-accordion-chevron {
  font-size: 0.75rem;
  color: #888;
  transition: transform 0.3s ease;
}

.guide-accordion-item.active .guide-accordion-chevron {
  transform: rotate(180deg);
}

/* 아코디언 바디 슬라이드 */
.guide-accordion-body {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.25s ease-out;
}

.guide-accordion-item.active .guide-accordion-body {
  max-height: 600px;
  transition: max-height 0.25s ease-in;
}

/* 아코디언 콘텐츠 */
.guide-accordion-content {
  background: #111;
  padding: 1rem 1.25rem 1.25rem;
  border-left: 3px solid #dc2626;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.guide-accordion-item.active .guide-accordion-content {
  opacity: 1;
}

.guide-accordion-content-title {
  color: #dc2626;
  font-size: 1rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.guide-accordion-content-eng {
  color: #888;
  font-size: 0.8rem;
  margin-bottom: 0.75rem;
}

.guide-accordion-content-desc {
  color: #ddd;
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

.guide-accordion-content-img {
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid #2a2a2a;
  margin-top: 0.5rem;
}

/* =========================================
   타임라인 (Weekend 페이지)
   ========================================= */

.timeline-container {
  position: relative;
  padding-left: 2rem;
}

/* 세로 연결선 */
.timeline-container::before {
  content: '';
  position: absolute;
  left: 0.6rem;
  top: 1.5rem;
  bottom: 1.5rem;
  width: 2px;
  background: linear-gradient(to bottom, #dc2626, #3a3a3a);
}

/* 요일 섹션 */
.timeline-day-section {
  position: relative;
  margin-bottom: 2.5rem;
}

/* 요일 헤더 (타임라인 점) */
.timeline-day-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.timeline-day-dot {
  position: absolute;
  left: -1.65rem;
  width: 1rem;
  height: 1rem;
  background: #dc2626;
  border: 2px solid #0a0a0a;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.3);
}

.timeline-day-label {
  font-size: 1.1rem;
  font-weight: bold;
  color: #f5f5f5;
}



/* 용어 카드 목록 */
.timeline-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* 개별 용어 카드 */
.timeline-term-card {
  background-color: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 0.5rem;
  overflow: hidden;
  transition: border-color 0.2s;
}

.timeline-term-card:hover {
  border-color: #444;
}

.timeline-term-card.active {
  border-color: #dc2626;
}

/* 카드 헤더 (클릭 영역) */
.timeline-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  cursor: pointer;
  user-select: none;
}

.timeline-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #f5f5f5;
}

.timeline-card-eng {
  font-size: 0.8rem;
  color: #888;
  margin-top: 0.15rem;
}

.timeline-card-chevron {
  font-size: 0.75rem;
  color: #888;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.timeline-term-card.active .timeline-card-chevron {
  transform: rotate(180deg);
}

/* 카드 상세 (슬라이드 다운) */
.timeline-card-body {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.28s ease-out;
}

.timeline-term-card.active .timeline-card-body {
  max-height: 600px;
  transition: max-height 0.28s ease-in;
}

/* 카드 상세 콘텐츠 */
.timeline-card-content {
  padding: 0 1rem 1rem;
  border-top: 1px solid #2a2a2a;
  opacity: 0;
  transition: opacity 0.25s ease-in-out;
}

.timeline-term-card.active .timeline-card-content {
  opacity: 1;
}

.timeline-card-desc {
  color: #ddd;
  font-size: 0.9rem;
  line-height: 1.7;
  padding-top: 0.75rem;
  margin-bottom: 0.75rem;
}

.timeline-card-img {
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid #2a2a2a;
}


/* =========================================
   전체 폭 레이아웃 컨테이너 (Anatomy 페이지)
   ========================================= */

.anatomy-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* =========================================
   모달 팝업 (Anatomy 페이지 - 핀 클릭 시)
   ========================================= */

/* 모달 오버레이 (딤드 배경) */
.anatomy-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.anatomy-modal-overlay.visible {
    display: flex;
    opacity: 1;
}

/* 모달 본체 */
.anatomy-modal {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 0.75rem;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.anatomy-modal-overlay.visible .anatomy-modal {
    transform: translateY(0);
}

/* 닫기 버튼 */
.anatomy-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: #888;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem;
    transition: color 0.2s;
}

.anatomy-modal-close:hover {
    color: #f5f5f5;
}

/* 모달 타이틀 */
.anatomy-modal-title {
    font-size: 1.25rem;
    font-weight: bold;
    color: #f5f5f5;
    margin-bottom: 1rem;
    padding-right: 2rem;
}

/* 모달 설명 */
.anatomy-modal-desc {
    color: #ccc;
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 1.25rem;
}

/* 카테고리 해시태그 */
.anatomy-modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.anatomy-modal-tag {
    color: #dc2626;
    font-size: 0.85rem;
    font-weight: 500;
}


/* =========================================
   핀 툴팁 — HTML 레이어 (텍스트 왜곡 방지)
   SVG 내부 텍스트 대신 HTML div로 렌더링하여
   preserveAspectRatio 스케일 왜곡을 완전히 차단
   ========================================= */

/* 툴팁 레이어 컨테이너 (오버레이와 동일한 절대 위치) */
#anatomy-tooltip-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* 개별 HTML 툴팁 말풍선 */
.anatomy-html-tooltip {
  position: absolute;
  /* left: xPercent%, top: (yPercent - PIN_H)% 로 핀 머리 위치에 배치
     transform으로 가로 중앙 정렬 + 툴팁 자체 높이만큼 위로 올림 */
  transform: translate(-50%, -100%);
  margin-top: -4px;

  /* 텍스트 길이에 따라 자연스럽게 늘어나는 padding 기반 디자인 */
  padding: 6px 14px;
  background: rgba(20, 20, 20, 0.92);
  border: 1px solid #444;
  border-radius: 6px;
  color: #f5f5f5;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;        /* 줄바꿈 방지 */
  letter-spacing: -0.01em;
  line-height: 1.4;

  /* 기본 숨김 → hover 시 표시 */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.anatomy-html-tooltip.visible {
  opacity: 1;
}

/* =========================================
   (구) SVG 내부 툴팁 스타일 — 더 이상 사용 안 함
   하위 호환성을 위해 남겨두되 실제로는 렌더링되지 않음
   ========================================= */

.anatomy-pin-tooltip {
  display: none;
}

.anatomy-pin-tooltip-bg {
  display: none;
}

.anatomy-pin-tooltip-text {
  display: none;
}

/* =========================================
   핀 숨기기/보기 토글 버튼
   ========================================= */

.anatomy-pin-toggle {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  background: rgba(20, 20, 20, 0.75);
  backdrop-filter: blur(6px);
  border: 1px solid #3a3a3a;
  border-radius: 0.5rem;
  color: #ccc;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  line-height: 1;
}

.anatomy-pin-toggle:hover {
  background: rgba(30, 30, 30, 0.9);
  color: #f5f5f5;
  border-color: #555;
}


/* =========================================
   포맷 전환 토글 (Weekend 페이지)
   ========================================= */

.format-toggle {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-bottom: 2rem;
  background: #1a1a1a;
  border-radius: 9999px;
  padding: 0.25rem;
  border: 1px solid #2a2a2a;
  display: inline-flex;
  margin-left: 50%;
  transform: translateX(-50%);
}

.format-toggle-btn {
  padding: 0.6rem 1.5rem;
  border: none;
  border-radius: 9999px;
  background: transparent;
  color: #888;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

.format-toggle-btn:hover {
  color: #ccc;
}

.format-toggle-btn.active {
  background: #dc2626;
  color: #fff;
}


/* =========================================
   페이드 애니메이션 (Weekend 페이지)
   ========================================= */

.timeline-fade-out {
  opacity: 0;
  transition: opacity 300ms ease-out;
}

.timeline-fade-in {
  opacity: 1;
  transition: opacity 300ms ease-in;
}
