/* 기본 설정 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Noto Sans KR", sans-serif;
  background: linear-gradient(180deg, #b3d9ff 0%, #e6f3ff 100%);
  min-height: 100vh;
  color: #2d2d2d;
}

.container {
  max-width: 445px;
  margin: 0 auto;
  background: linear-gradient(180deg, #b3d9ff 0%, #e6f3ff 100%);
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

/* 헤더 스타일 */
.header {
  position: relative;
  text-align: center;
  background-image: url("images/mangom_background.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  min-height: 350px;
}

/* 제목 섹션 스타일 */
.title-section {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 445px;
  z-index: 1000;
  /* background: rgba(179, 217, 255, 0.7); */
  /* backdrop-filter: blur(7px); */
  transition: all 0.3s ease;
}

#info-icon {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
}

#info-icon:hover {
  transform: translateY(-50%) scale(1.1);
}

.title-section.scrolled {
  background: rgb(151, 200, 249);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.title-img {
  height: 50px;
  object-fit: contain;
}

.face-img {
  height: 45px;
  object-fit: contain;
  margin-right: 10px;
}

/* 환영 섹션 스타일 */
.welcome-section {
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: 36%;
  left: 40%;
  transform: translate(-50%, -50%);
  z-index: 5;
}

.speech-bubble {
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 20px;
  padding: 12px 18px;
  position: relative;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  border: 2px solid #b3d9ff;
  animation: fadeIn 1s ease-in-out;
}

.speech-bubble span {
  font-size: 14px;
  font-weight: 500;
  color: #2d2d2d;
  white-space: nowrap;
}

@keyframes fadeIn {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.social-icons {
  display: flex;
  justify-content: center;
  gap: 10px;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  margin-bottom: 15px;
}

.social-icon {
  max-height: 36px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 25px;
  background: rgba(47, 79, 127, 0.2);
  backdrop-filter: blur(5px);
  color: #2f4f7f;
  text-decoration: none;
  font-size: 16px;
  transition: all 0.3s ease;
}

.social-icon:hover {
  background: rgba(47, 79, 127, 0.3);
  color: #1e3a5f;
  transform: translateY(-2px);
}

.icon-label {
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

/* 메인 콘텐츠 */
.main-content {
  padding: 25px;
}

/* 링크 카드들 */
.links-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.link-card {
  display: flex;
  align-items: center;
  padding: 16px;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  border-radius: 16px;
  text-decoration: none;
  color: #2d2d2d;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

a.link-card:hover {
  background: rgba(240, 248, 255, 0.9);
  transform: translateZ(0) scale(1.05);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.card-image {
  width: 90px;
  height: 90px;
  background: linear-gradient(135deg, #b3d9ff, #87ceeb);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 18px;
  flex-shrink: 0;
  transition: all 0.3s ease;
  position: relative;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  z-index: 2;
}

.card-image i {
  font-size: 24px;
  color: white;
  position: absolute;
  z-index: 1;
}

.card-img:not([src=""]):not([src*="data:"]) + i {
  display: none;
}

/* 이미지 로드 실패 시 아이콘 표시 */
.card-img[data-failed="true"] {
  display: none;
}

.card-img[data-failed="true"] + i {
  display: block !important;
}

.card-content {
  flex: 1;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 6px 0;
  color: #2d2d2d;
  display: flex;
  align-items: center;
  gap: 5px;
}

.title-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.card-description {
  font-size: 14px;
  color: #666;
  margin: 0;
  line-height: 1.4;
}

/* 모바일 최적화 */
@media (max-width: 480px) {
  .container {
    max-width: 100%;
  }

  .title-section {
    max-width: 480px;
  }

  /* .main-content {
    padding: 0 20px 40px;
  } */

  .link-card {
    padding: 18px;
  }

  .card-image {
    width: 75px;
    height: 75px;
    margin-right: 15px;
  }

  .card-image i {
    font-size: 20px;
  }

  .card-title {
    font-size: 16px;
  }

  .card-description {
    font-size: 13px;
  }

  .speech-bubble {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 18px;
  }

  .speech-bubble span {
    font-size: 13px;
  }

  .title-img {
    height: 45px;
  }

  .face-img {
    height: 35px;
    margin-right: 8px;
  }
}

/* 터치 디바이스 최적화 */
@media (hover: none) and (pointer: coarse) {
  .link-card:active {
    background: rgba(255, 255, 255, 0.98);
    transform: scale(0.98);
  }

  .social-icon:active {
    background: rgba(179, 217, 255, 0.3);
    transform: translateY(1px);
  }
}

/* 스크롤바 스타일링 */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
  background: rgba(179, 217, 255, 0.8);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(179, 217, 255, 1);
}

/* 로딩 애니메이션 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 카드 로딩 애니메이션 */
.card-loading {
  opacity: 0;
  transform: translateY(30px);
}

.card-loaded {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* 커스텀 알림창 스타일 */
.custom-alert {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.custom-alert.show {
  display: flex;
  opacity: 1;
}

.alert-content {
  position: relative;
  background: white;
  padding: 25px;
  border-radius: 20px;
  width: 90%;
  max-width: 320px;
  margin: auto;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

.custom-alert.show .alert-content {
  transform: translateY(0);
}

.alert-content i {
  font-size: 40px;
  color: #b3d9ff;
  margin-bottom: 15px;
}

.alert-content p {
  font-size: 15px;
  line-height: 1.5;
  color: #2d2d2d;
  margin-bottom: 20px;
}

.alert-close-btn {
  background: #4a90e2;
  color: white;
  border: none;
  padding: 10px 25px;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.alert-close-btn:hover {
  background: #357abd;
  transform: translateY(-2px);
}

.alert-img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  display: block;
  margin-left: auto;
  margin-right: auto;
}
