/* ====================================================== */
/* 1. 전역 변수 */
/* ====================================================== */
:root {
  --main-yellow: #f5c563;
  --main-yellow-light: #ffe89c;
  --main-orange: #ff9b6b;
  --main-orange-light: #ffd0a1;
  --font-primary: "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  --transition: all 0.3s ease;
}

/* ====================================================== */
/* 2. 기본 리셋 */
/* ====================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  font-family: var(--font-primary);
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  color: #333;
  scroll-behavior: smooth;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ====================================================== */
/* 3. 레이아웃 기본 컨테이너 */
/* ====================================================== */
.container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-top: clamp(60px, 8vh, 80px);
  overflow: hidden;
}

/* ====================================================== */
/* 4. 네비게이션 바 */
/* ====================================================== */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(135deg, var(--main-yellow) 0%, #f7d082 100%);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  z-index: 1000;
}

.nav-container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: clamp(60px, 8vh, 80px);
}

.logo-link {
  display: flex;
  align-items: center;
  transition: transform 0.3s ease;
}
.logo-link:hover {
  transform: scale(1.05);
}

.logo-img {
  width: 160px;
  height: 65px;
  background: #fff;
  border-radius: 12px;
  padding: 8px 12px;
  object-fit: contain;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 18px;
  transition: all 0.3s ease;
}

.nav-btn {
  border-radius: 30px;
  padding: 10px 22px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  border: 2px solid transparent;
  color: #333;
  background: #fff;
  transition: var(--transition);
}

/* 내가 저장한 일정 */
.nav-btn.my-ai-plans {
  border-color: var(--main-orange-light);
}
.nav-btn.my-ai-plans:hover {
  background: var(--main-orange-light);
  color: #fff;
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(255, 208, 161, 0.5);
}

/* 내가 작성한 후기 */
.nav-btn.my-reviews {
  border-color: var(--main-yellow-light);
}
.nav-btn.my-reviews:hover {
  background: var(--main-yellow-light);
  color: #fff;
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(255, 232, 156, 0.5);
}

/* AI에게 일정 추천받기 */
.nav-btn.ai-plan {
  border-color: var(--main-orange);
}
.nav-btn.ai-plan:hover {
  background: var(--main-orange);
  color: #fff;
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(255, 155, 107, 0.5);
}

/* 여행자들의 후기 */
.nav-btn.reviews {
  border-color: var(--main-yellow);
}
.nav-btn.reviews:hover {
  background: var(--main-yellow);
  color: #fff;
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(245, 197, 99, 0.5);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
}

.hamburger {
  width: 25px;
  height: 3px;
  background-color: #333;
  border-radius: 5px;
  transition: all 0.3s ease;
}

.nav-toggle.active .hamburger:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.nav-toggle.active .hamburger:nth-child(2) {
  opacity: 0;
}
.nav-toggle.active .hamburger:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ====================================================== */
/* 5. 공통 버튼 및 상태 */
/* ====================================================== */
button {
  font-family: var(--font-primary);
  font-weight: 700;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}
button:hover {
  transform: translateY(-3px);
}

.error-border {
  border-color: #ff6b6b !important;
  box-shadow: 0 0 6px rgba(255, 107, 107, 0.5);
  background-color: #fff5f5;
  transition: all 0.3s ease;
}

/* ====================================================== */
/* 6. 섹션 여백 */
/* ====================================================== */
.section {
  padding: clamp(30px, 5vw, 60px);
}

/* ====================================================== */
/* 7. 푸터 */
/* ====================================================== */
.bottom-bar {
  background-color: #243763;
  height: clamp(20px, 4vh, 35px);
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.footer-text {
  color: #fff;
  font-weight: 600;
  font-size: clamp(12px, 1.3vw, 15px);
  text-align: center;
  letter-spacing: 0.5px;
}

/* ====================================================== */
/* 8. 접근성 향상 */
/* ====================================================== */
button:focus-visible,
a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(245, 197, 99, 0.4);
  transition: box-shadow 0.2s ease;
}

/* ====================================================== */
/* 9. 공통 모달 스타일 */
/* ====================================================== */

/* 전체 오버레이 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 999;
}

/* 활성화 시 */
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* 콘텐츠 박스 */
.modal-content {
  position: relative;
  background: #fff;
  border-radius: 20px;
  width: 90%;
  max-width: 700px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 30px 40px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  animation: modalFadeIn 0.3s ease;
}

/* 닫기 버튼 */
.close-button {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  font-size: 28px;
  font-weight: bold;
  color: #666;
  cursor: pointer;
  transition: color 0.2s;
}

.close-button:hover {
  color: var(--main-orange);
}

/* 구분선 */
.modal-divider {
  border: none;
  height: 1px;
  background: #ddd;
  margin: 20px 0;
}

/* 스크롤바 */
.modal-content::-webkit-scrollbar {
  width: 8px;
}
.modal-content::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}
.modal-content::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0, 0, 0, 0.4);
}

/* 반응형 */
@media (max-width: 600px) {
  .modal-content {
    width: 95%;
    padding: 25px 20px;
  }
}

/* 모달 애니메이션 */
@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ====================================================== */
/* 10. 반응형 */
/* ====================================================== */
@media (max-width: 1100px) {
  .nav-toggle {
    display: flex;
  }

  .nav-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fffdf6;
    flex-direction: column;
    width: 100%;
    max-height: 0;
    overflow: hidden;
    border-bottom: 2px solid var(--main-yellow);
    transition: max-height 0.4s ease;
  }

  .nav-menu.open {
    max-height: 320px;
    padding: 20px 0;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  }

  .nav-btn {
    width: 90%;
    margin: 0 auto 10px;
    text-align: center;
  }
}

/* ====================================================== */
/* 11. 현재 페이지 표시 (Active 상태) */
/* ====================================================== */
.nav-btn.active-page {
  color: #fff !important;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.nav-btn.active-page:hover {
  transform: scale(1.05);
  filter: brightness(1.05);
}

.nav-btn.my-ai-plans.active-page {
  background: var(--main-orange-light);
  border-color: var(--main-orange-light);
  box-shadow: 0 0 10px rgba(255, 208, 161, 0.6);
}

.nav-btn.my-reviews.active-page {
  background: var(--main-yellow-light);
  border-color: var(--main-yellow-light);
  box-shadow: 0 0 10px rgba(255, 232, 156, 0.6);
}

.nav-btn.ai-plan.active-page {
  background: var(--main-orange);
  border-color: var(--main-orange);
  box-shadow: 0 0 10px rgba(255, 155, 107, 0.6);
}

.nav-btn.reviews.active-page {
  background: var(--main-yellow);
  border-color: var(--main-yellow);
  box-shadow: 0 0 10px rgba(245, 197, 99, 0.6);
}
