/* 기본 폰트 설정 */
body {
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* PC 광고 배너 */
.pc-ad-container {
  display: block;
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 160px;
  height: 600px;
  z-index: 10;
}

/* 모바일 광고 배너 */
.mobile-ad-banner {
  display: none;
  position: relative;
  width: 320px;
  height: 50px;
  margin: 0 auto 0.5rem auto;
}

.pc-ad-container.left {
  left: 0;
}

.pc-ad-container.right {
  right: 0;
}

/* 메인 컨텐츠 영역 설정 */
main {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 20px;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e0 #edf2f7;
}

main::-webkit-scrollbar {
  width: 8px;
}

main::-webkit-scrollbar-track {
  background: #edf2f7;
}

main::-webkit-scrollbar-thumb {
  background-color: #cbd5e0;
  border-radius: 4px;
}

/* 광고 배너 설정 */
#ad-banner {
  width: 100%;
  background-color: white;
  border-top: 1px solid #e5e7eb;
  padding: 1rem;
}

/* 애니메이션 */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 애니메이션 적용 클래스 */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

#page-content {
  animation: fadeIn 0.5s ease-in;
}

/* 네비게이션 스타일 */
.nav-container {
  background: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 0.5rem 1rem;
  position: relative;
  z-index: 30;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
}

.nav-brand {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.brand-link {
  font-size: 1.75rem;
  font-weight: bold;
  text-decoration: none;
  color: #333;
  white-space: nowrap;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.mobile-toggle span {
  display: block;
  width: 25px;
  height: 3px;
  background: #333;
  margin: 5px 0;
  transition: 0.3s;
}

.nav-menu {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-left: 1rem;
}

.nav-start {
  display: flex;
  gap: 2rem;
  margin-left: 2rem;
}

.nav-item {
  text-decoration: none;
  color: #333;
  padding: 0.5rem 1rem;
  font-size: 1.25rem;
  white-space: nowrap;
}

.nav-item:hover {
  background-color: #f5f5f5;
}

.nav-icon-text {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.nav-icon-text i {
  font-size: 1.1rem;
}

.nav-icon-text img {
  width: 20px;
  height: auto;
}

/* 언어 드롭다운 */
.lang-dropdown {
  position: relative;
}

.lang-button {
  background: none;
  border: none;
  padding: 0.5rem 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  left: auto;
  transform: translateX(0);
  background: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  min-width: 150px;
  z-index: 31;
  max-height: calc(100vh - 100%);
  overflow-y: auto;
  max-width: calc(100vw - 2rem);
}

.lang-dropdown.active .dropdown-menu {
  display: block;
}

.dropdown-item {
  display: block;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: #333;
}

.dropdown-item:hover {
  background: #f5f5f5;
}

/* 모바일 스타일 (768px 이하) */
@media (max-width: 768px) {
  .brand-link {
    font-size: 1.5rem;
  }

  .nav-item {
    font-size: 1.25rem;
  }

  .mobile-toggle {
    display: block;
  }

  .mobile-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .mobile-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .mobile-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    flex-direction: column;
    align-items: stretch;
    margin-left: 0;
  }

  .nav-menu.active {
    display: block;
  }

  .nav-start {
    flex-direction: column;
    gap: 0;
    margin-left: 0;
  }

  .nav-item {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    white-space: normal;
  }

  .nav-end {
    border-top: 1px solid #eee;
  }

  .lang-dropdown {
    width: 100%;
  }

  .lang-button {
    width: 100%;
    justify-content: flex-start;
    padding: 1rem;
  }

  .dropdown-menu {
    position: static;
    max-height: none;
    overflow: visible;
    box-shadow: none;
    border-top: 1px solid #eee;
  }

  .dropdown-item {
    padding: 1rem;
    border-bottom: 1px solid #eee;
  }

  .lang-selector {
    width: 100%;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #eee;
  }

  .nav-item.is-active {
    background-color: rgba(0, 0, 0, 0.1);
  }

  .nav-item.is-active::after {
    display: none;
  }

  .mobile-ad-banner {
    display: block;
  }

  .pc-ad-container {
    display: none;
  }

  .main-container {
    padding: 0 10px;
    gap: 8px;
  }

  #content-area.container {
    padding: 0.25rem 0.5rem !important;
  }
}

/* 로딩 스피너 */
.loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #3273dc;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

/* 로딩 스크린 */
#loading-screen.modal {
  display: none;
}

#loading-screen.modal.is-active {
  display: flex;
  animation: fadeIn 0.3s ease-out;
}

#loading-screen.modal .modal-content {
  width: auto;
  max-width: 400px;
  margin: 0 auto;
}

#loading-screen.modal .box {
  padding: 2rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
}

#loading-screen.modal .icon.is-large {
  height: 4rem;
  width: 4rem;
  margin-bottom: 1rem;
}

#loading-screen.modal .fa-spinner {
  color: #3273dc;
  animation: spin 1s linear infinite;
}

/* 모달 공통 스타일 */
.modal {
  z-index: 2000 !important;
}

.modal-background {
  z-index: 2001;
}

.modal-card {
  z-index: 2002;
  position: relative;
}

.modal-content {
  z-index: 2002;
  position: relative;
}

/* 모달 애니메이션 */
.modal.is-active {
  display: flex;
  animation: fadeIn 0.3s ease-out;
}

.modal.is-active .modal-card,
.modal.is-active .modal-content {
  animation: slideIn 0.3s ease-out;
}

/* 컨텐츠 영역 */
#content-area.container {
  max-width: 1440px !important;
  width: 95%;
  margin: 0 auto;
  padding: 0.5rem 1rem !important;
}

/* 트랜지션 효과 */
.nav-menu,
.dropdown-menu,
.mobile-toggle span {
  transition: all 0.3s ease-in-out;
}

/* 언어 선택기 스타일 */
.lang-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lang-label {
  font-size: 1rem;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
}

/* 네비게이션 아이템 활성화 스타일 */
.nav-item.is-active {
  background-color: rgba(0, 0, 0, 0.05);
  font-weight: 600;
  position: relative;
}

.nav-item.is-active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: currentColor;
  opacity: 0.5;
}

/* 메인 레이아웃 컨테이너 */
.main-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 컨텐츠 영역 */
#content-area {
  flex: 1;
  min-width: 0; /* flexbox 오버플로우 방지 */
  width: 100%; /* 전체 너비 사용 */
}
