/* ====== 기본 리셋 및 레이아웃 ====== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Pretendard", "Apple SD Gothic Neo",
    "Malgun Gothic", "Nanum Gothic", "Noto Sans", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #222;
  background: #fff;
}

/* ====== 링크 ====== */
a {
  color: #222;
  text-decoration: none;
  transition: color 0.2s;
  background: transparent;
}

a:hover,
a:focus {
  color: #555;
  text-decoration: underline;
  outline: none;
}

/* ====== 이미지 ====== */
img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 0;
  vertical-align: middle;
}

.img-circle {
  border-radius: 50%;
}

/* ====== 버튼 ====== */
button,
input[type="button"],
input[type="submit"] {
  font-family: inherit;
  font-size: 1em;
  padding: 10px 25px;
  border: 1px solid #222;
  border-radius: 3px;
  background: #fff;
  color: #222;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

button:hover,
input[type="button"]:hover,
input[type="submit"]:hover {
  border-color: #222;
  background: #f6f6f6;
}

button:focus {
  outline: 2px solid #1a6dff;
}

/* ====== 입력 폼 ====== */
input,
select,
textarea {
  font-family: inherit;
  font-size: 1em;
  color: inherit;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 2px;
  padding: 8px;
  outline: none;
  transition: border-color 0.2s;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #1a6dff;
}

/* ====== 로딩 및 에러 상태 스타일 ====== */
.loading-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 400px;
  background: #f6f6f6;
  border: 1px solid #eee;
  color: #666;
  font-size: 14px;
  border-radius: 3px;
  margin: 20px 0;
}

.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #ddd;
  border-top: 2px solid #222;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 10px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.error-message {
  background: #ffeaa7;
  border: 1px solid #fdcb6e;
  color: #d63031;
  padding: 15px;
  border-radius: 3px;
  margin: 20px 0;
  text-align: center;
}

/* ====== 텍스트 유틸 ====== */
.text-center {
  text-align: center;
}
.text-left {
  text-align: left;
}
.text-sm {
  font-size: 0.88em;
}
.text-gray {
  color: #888;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ====== 유틸 ====== */
.inline-block {
  display: inline-block;
}
.rounded {
  border-radius: 50%;
}

/* ====== 커스텀 레이아웃 ====== */
.container {
  display: flex;
  min-height: 100vh;
}

/* 사이드바 */
.sidebar {
  width: 280px;
  background: #fff;
  border-right: 1px solid #eee;
  padding: 32px 24px;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 1000;
  transition: transform 0.3s ease;
}

.profile {
  text-align: center;
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid #eee;
}

.profile-pic {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #222;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 600;
  margin: 0 auto 16px;
}

.profile-name {
  font-size: 1.25em;
  font-weight: 600;
  color: #222;
  margin-bottom: 4px;
}

.profile-title {
  font-size: 0.9em;
  color: #666;
}

/* 네비게이션 메뉴 */
.nav-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item {
  margin-bottom: 8px;
}

.nav-link {
  display: block;
  padding: 12px 16px;
  color: #666;
  text-decoration: none;
  border-radius: 3px;
  transition: all 0.2s ease;
  cursor: pointer;
  font-size: 0.95em;
}

.nav-link:hover,
.nav-link.active {
  background: #f6f6f6;
  color: #222;
  text-decoration: none;
}

.nav-link.active {
  background: #222;
  color: #fff;
}

/* 검색 기능 */
.search-section {
  margin: 24px 0;
  padding-top: 24px;
  border-top: 1px solid #eee;
}

.search-container {
  position: relative;
}

.search-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 3px;
  font-size: 0.9em;
  background: #fff;
  transition: border-color 0.2s ease;
}

.search-input:focus {
  border-color: #222;
  outline: none;
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 3px 3px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1001;
  display: none;
}

.search-results.show {
  display: block;
}

.search-result-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.2s ease;
}

.search-result-item:hover {
  background: #f6f6f6;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-title {
  font-size: 0.85em;
  font-weight: 600;
  color: #222;
  margin-bottom: 4px;
}

.search-result-desc {
  font-size: 0.75em;
  color: #666;
  line-height: 1.4;
}

.search-no-results {
  padding: 16px;
  text-align: center;
  color: #666;
  font-size: 0.85em;
}

/* 언어 토글 */
.language-toggle {
  margin-top: 32px;
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid #eee;
}

.lang-btn {
  background: transparent;
  border: 1px solid #ddd;
  padding: 6px 12px;
  margin: 0 4px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.85em;
  transition: all 0.2s ease;
}

.lang-btn.active {
  background: #222;
  color: #fff;
  border-color: #222;
}

/* 메인 콘텐츠 */
.main-content {
  margin-left: 280px;
  flex: 1;
  padding: 32px;
  min-height: 100vh;
}

.section {
  display: none;
  animation: fadeIn 0.3s ease;
}

.section.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-title {
  font-size: 2rem;
  font-weight: 300;
  color: #222;
  margin-bottom: 32px;
}

/* 홈 섹션 - 슬라이더 */
.slider-container {
  position: relative;
  max-width: 100%;
  margin: 0 auto;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #eee;
}

.slider-wrapper {
  display: flex;
  transition: transform 0.4s ease;
}

.slide {
  min-width: 100%;
  position: relative;
}

.slide-image {
  width: 100%;
  height: 400px;
  background: #f6f6f6;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 1.1em;
  cursor: pointer;
  border-bottom: 1px solid #eee;
  position: relative;
}

.slide-content {
  padding: 24px;
  background: #fff;
}

.slide-title {
  font-size: 1.5em;
  font-weight: 600;
  color: #222;
  margin-bottom: 8px;
}

.slide-desc {
  font-size: 1em;
  color: #666;
  line-height: 1.6;
}

/* 슬라이더 이미지 */
.slide-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

.slide-fallback {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

/* 슬라이더 네비게이션 */
.slider-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #ddd;
  width: 44px;
  height: 44px;
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.2s ease;
  opacity: 0;
  color: #222;
}

.slider-container:hover .slider-nav {
  opacity: 1;
}

.slider-nav:hover {
  background: #fff;
  border-color: #222;
}

.slider-nav.prev {
  left: 16px;
}

.slider-nav.next {
  right: 16px;
}

/* 슬라이더 도트 */
.slider-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ddd;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dot.active {
  background: #222;
}

/* 포트폴리오 이미지 */
.portfolio-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

.portfolio-fallback {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

/* 포트폴리오 그리드 */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(
    auto-fit,
    minmax(300px, 1fr)
  );
  gap: 24px;
  margin-top: 24px;
}

.portfolio-item {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 6px;
  overflow: hidden;
  transition: all 0.2s ease;
  cursor: pointer;
}

.portfolio-item:hover {
  border-color: #ddd;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.portfolio-image {
  width: 100%;
  height: 200px;
  background: #f6f6f6;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 1em;
  border-bottom: 1px solid #eee;
  position: relative;
}

.portfolio-content {
  padding: 20px;
}

.portfolio-title {
  font-size: 1.1em;
  font-weight: 600;
  color: #222;
  margin-bottom: 8px;
}

.portfolio-desc {
  color: #666;
  font-size: 0.9em;
  line-height: 1.5;
}

/* About 섹션 */
.about-content {
  max-width: 700px;
  font-size: 1em;
  line-height: 1.7;
  color: #444;
}

.about-content p {
  margin-bottom: 20px;
}

/* Contact 섹션 */
.contact-info {
  display: grid;
  grid-template-columns: repeat(
    auto-fit,
    minmax(250px, 1fr)
  );
  gap: 24px;
  margin-top: 24px;
}

.contact-item {
  background: #fff;
  padding: 24px;
  border: 1px solid #eee;
  border-radius: 6px;
  text-align: center;
  transition: border-color 0.2s ease;
}

.contact-item:hover {
  border-color: #ddd;
}

.contact-icon {
  font-size: 2em;
  margin-bottom: 12px;
  color: #666;
}

.contact-title {
  font-size: 1.1em;
  font-weight: 600;
  color: #222;
  margin-bottom: 8px;
}

.contact-text {
  color: #666;
  font-size: 0.9em;
}

/* 모바일 메뉴 */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1001;
  background: #fff;
  border: 1px solid #ddd;
  width: 48px;
  height: 48px;
  border-radius: 3px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.hamburger {
  width: 20px;
  height: 2px;
  background: #222;
  transition: 0.3s;
}

/* 라이트박스 */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.lightbox.active {
  display: flex;
}

.lightbox-content {
  max-width: 90%;
  max-height: 90%;
  position: relative;
}

.lightbox-image {
  width: 100%;
  height: auto;
  max-height: 90vh;
  border-radius: 6px;
  background: #f6f6f6;
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 8px;
}

/* 라이트박스 이미지 */
.lightbox-img {
  max-width: 90%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 5px 24px rgba(0, 0, 0, 0.3);
}

.lightbox-fallback {
  background: #f6f6f6;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

/* 이미지 프레임 (플레이스홀더) */
.img-frame {
  background: #f6f6f6;
  color: #666;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  height: 100%;
  border: 1px solid #eee;
}

/* 반응형 */
@media (max-width: 991px) {
  .sidebar {
    transform: translateX(-100%);
    width: 100%;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    padding: 80px 16px 16px;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .slide-image {
    height: 300px;
  }

  .portfolio-grid {
    grid-template-columns: 1fr;
  }

  .contact-info {
    grid-template-columns: 1fr;
  }

  .section-title {
    font-size: 1.75rem;
  }

  .slider-nav {
    opacity: 1;
    width: 40px;
    height: 40px;
  }

  .slider-nav.prev {
    left: 12px;
  }

  .slider-nav.next {
    right: 12px;
  }
}
