@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css");

body, html {
  margin: 0;
  padding: 0;
  overflow: hidden;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif;
}
.container {
  position: relative;
  width: 100vw;
  height: 100vh;
}
video {
  width: 100%;
  height: 100%;
  /* cover에서 contain으로 변경 */
  /* object-fit: contain;  */
  background-color: black; /* 비디오 주변 여백을 위한 배경색 추가 */
  z-index: 1;
  /* 비디오 출력시 뒷배경 삭제 하는 경우 주석 해제 */
  object-fit: cover; 
}

.overlay {
  position: absolute;
  top: 20px;
  left: 20px;
  color: white;
  font-size: 2em;
  background: rgba(0, 0, 0, 0.5);
  padding: 10px;
  border-radius: 5px;
  z-index: 2;
}
.fullscreen-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 5px;
  cursor: pointer;
  font-size: clamp(1rem, 2.4vw, 1.5rem); /* 반응형 텍스트 크기 */
  z-index: 2;
}
.fullscreen-btn:hover {
  background: rgba(0, 0, 0, 0.7);
}
.scrolling-text-container {
    position: fixed;
    bottom:0px;
      /* bottom: 60px; */
    left: 0;
    width: 100%;
    overflow: hidden;
    height: 40px;
    z-index: 2;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
  }

  .scrolling-text-container-2 {
    position: absolute;
      bottom: 60px;
    left: 0;
    width: 100%;
    overflow: hidden;
    height: 40px;
    z-index: 2;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
  }


  .scrolling-text-container-3 {
    position: absolute;
    bottom: 120px;
    left: 0;
    width: 100%;
    overflow: hidden;
    height: 80px;
    z-index: 2;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
  }

  /* 스크롤링 텍스트 */
  .scrolling-text {
    color: white;
    font-size: clamp(1.5rem, 2.8vw, 2rem); /* 반응형 텍스트 크기 */
    white-space: nowrap;
    position: absolute;
    animation: scrollText 20s linear infinite;
    top: 50%;
    transform: translateY(-50%);
  }
/* 스크롤링 애니메이션 */
@keyframes scrollText {
  from {
    transform: translate(100%, -50%);
  }
  to {
    transform: translate(-100%, -50%);
  }
}
/* 중앙 텍스트 스타일 */
.center-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: clamp(1.5rem, 4vw, 3rem); /* 반응형 텍스트 크기 */
  font-weight: bold;
  text-align: center;
  opacity: 0;
  z-index: 3;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
  animation: none;
  width: 80%;
}
/* 페이드 인/아웃 애니메이션 */
@keyframes fadeInOut {
  0% { opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}
/* 두 번째 영상용 텍스트 하이라이트 애니메이션 */
@keyframes highlight {
  0% { background-position: -100% 0; }
  100% { background-position: 200% 0; }
}
/* 두 번째 영상용 색상 변화 애니메이션 - 흰색에서 검은색으로 변경 */
@keyframes colorShift {
  0% { color: #ffffff; }     /* 밝은 흰색 */
  25% { color: #f5f5f5; }    /* 거의 흰색 */
  50% { color: #333333; }    /* 어두운 회색 */
  75% { color: #000000; }    /* 검은색 */
  100% { color: #ffffff; }   /* 다시 밝은 흰색으로 */
}

/* 두 번째 영상용 텍스트 배경 애니메이션 */
@keyframes backgroundFade {
  0% { background-color: rgba(0, 0, 0, 0.6); }   /* 흰색 텍스트용 어두운 배경 */
  25% { background-color: rgba(0, 0, 0, 0.5); }  /* 흰색 텍스트용 어두운 배경 */
  50% { background-color: rgba(255, 255, 255, 0.7); }  /* 어두운 텍스트용 밝은 배경 */
  75% { background-color: rgba(255, 255, 255, 0.8); }  /* 검은색 텍스트용 밝은 배경 */
  100% { background-color: rgba(0, 0, 0, 0.6); }  /* 다시 어두운 배경으로 */
}

/* 두 번째 영상용 텍스트 스타일 수정 */
.highlight-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: clamp(1.8rem, 4vw, 3.5rem); /* 반응형 텍스트 크기 */
  font-weight: bold;
  text-align: center;
  z-index: 3;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  width: 80%;
  padding: 20px;
  border-radius: 10px;
}

/* 하이라이트 효과는 배경에 적용 */
.highlight-text::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: highlight 3s infinite;
  z-index: -1;
}

.typing-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: clamp(1.5rem, 4vw, 3rem); /* 반응형 텍스트 크기 */
  font-weight: bold;
  text-align: center;
  z-index: 3;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
  width: 80%;
  overflow: hidden;
  white-space: nowrap;
  border-right: 0.15em solid white;
  margin: 0 auto;
  letter-spacing: 0.15em;
}

/* 전체 화면에서도 z-index가 제대로 작동하도록 추가 */
.container:fullscreen video {
  z-index: 1;
}
.container:fullscreen .overlay,
.container:fullscreen .fullscreen-btn,
.container:fullscreen .scrolling-text-container,
.container:fullscreen .center-text,
.container:fullscreen .highlight-text {
  z-index: 2;
}
/* Safari용 전체 화면 선택자 */
.container:-webkit-full-screen video {
  z-index: 1;
}
  .container:-webkit-full-screen .overlay,
  .container:-webkit-full-screen .fullscreen-btn,
  .container:-webkit-full-screen .scrolling-text-container,
  .container:-webkit-full-screen .center-text,
  .container:-webkit-full-screen .highlight-text {
    z-index: 2;
}
/* 타이핑 커서 깜빡임 애니메이션 */
@keyframes blink-caret {
  from, to { border-color: transparent }
  50% { border-color: white; }
}

/* 전체 화면에서도 z-index가 제대로 작동하도록 추가 */
.container:fullscreen .typing-text {
  z-index: 2;
}

/* Safari용 전체 화면 선택자 */
.container:-webkit-full-screen .typing-text {
  z-index: 2;
}

/* 네 번째 영상용 슬라이드 텍스트 스타일 */
.slide-text {
  position: absolute;
  top: 50%;
  color: white;
  font-size: clamp(1.5rem, 4vw, 3rem); /* 반응형 텍스트 크기 */
  font-weight: bold;
  white-space: nowrap;
  z-index: 3;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
  animation: slideLeftToRight 8s linear infinite;
  opacity: 0;
}

/* 슬라이드 애니메이션 정의 */
@keyframes slideLeftToRight {
  0% {
    transform: translateX(100vw);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateX(-100vw);
    opacity: 0;
  }
}

/* 네 번째 영상용 고정 텍스트 스타일 */
.fixed-text {
  position: absolute;
  bottom: 60px;
  left: 20px;
  color: white;
  font-size: clamp(1.2rem, 3vw, 2rem); /* 반응형 텍스트 크기 */
  font-weight: bold;
  z-index: 3;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
  background: rgba(0, 0, 0, 0.5);
  padding: 10px 15px;
  border-radius: 5px;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

/* 전체 화면에서도 z-index가 제대로 작동하도록 추가 */
.container:fullscreen .slide-text,
.container:fullscreen .fixed-text {
  z-index: 2;
}

/* Safari용 전체 화면 선택자 */
.container:-webkit-full-screen .slide-text,
.container:-webkit-full-screen .fixed-text {
  z-index: 2;
}

/* 다섯 번째 영상용 텍스트 전환 애니메이션 스타일 */
.text-transition-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  font-size: 2.4em;
  font-weight: bold;
  color: white;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  display: none;
  width: auto;
}

.text-transition__container {
  display: flex;
  flex-direction: row;
  align-items: center; /* 세로 중앙 정렬 */
  justify-content: center;
  min-width: 500px; /* 최소 너비 설정 */
}

.text-transition__text {
  margin: 0 15px 0 0;
  padding: 10px 0;
  white-space: nowrap;
  line-height: 1.2; /* 라인 높이 추가 */
}

.text-transition__list {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  height: 50px;
  overflow: hidden;
  min-width: 300px; /* 최소 너비 설정 */
  display: flex; /* flex 추가 */
  align-items: center; /* 세로 중앙 정렬 */
}

.text-transition__item {
  position: absolute;
  top: 50%; /* 수직 중앙 배치 */
  left: 0;
  width: 100%;
  padding: 0; /* 패딩 제거 */
  white-space: nowrap;
  opacity: 0;
  transform: translateY(-50%) translateY(100%); /* 수직 중앙 정렬 + 위치 조정 */
  transition: opacity 0.5s ease, transform 0.5s ease;
  line-height: 1.2; /* 라인 높이 추가 */
}

.text-transition__item.active {
  opacity: 1;
  transform: translateY(-50%); /* 수직 중앙 정렬 */
}

/* .text-transition-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  height: 160px;
  overflow: hidden;
  z-index: 3;
  font-family: 'Lato', sans-serif;
  font-size: 35px;
  line-height: 40px;
  color: #ecf0f1;
  display: none;
} */

/* .text-transition__container {
  font-weight: 600;
  overflow: hidden;
  height: 40px;
  padding: 0 40px;
  position: relative;
  color:#000000;
}

.text-transition__container:before {
  content: '[';
  position: absolute;
  left: 0;
}

.text-transition__container:after {
  content: ']';
  position: absolute;
  right: 0;
}

.text-transition__container:after, 
.text-transition__container:before {
  position: absolute;
  top: 0;
  color: #000000;
  font-size: 42px;
  line-height: 40px;
  animation: opacity 2s infinite;
}

.text-transition__text {
  display: inline;
  float: left;
  margin: 0;
}

.text-transition__list {
  margin-top: 0;
  padding-left: 110px;
  text-align: left;
  list-style: none;
  animation: change 10s infinite;
  font-weight: 700;
}

.text-transition__item {
  line-height: 40px;
  margin: 0;
}

@keyframes opacity {
  0%, 100% {opacity: 0;}
  50% {opacity: 1;}
}

@keyframes change {
  0%, 12.66%, 100% {transform: translate3d(0, 0, 0);}
  16.66%, 29.32% {transform: translate3d(0, -25%, 0);}
  33.32%, 45.98% {transform: translate3d(0, -50%, 0);}
  49.98%, 62.64% {transform: translate3d(0, -75%, 0);}
  66.64%, 79.3% {transform: translate3d(0, -50%, 0);}
  83.3%, 95.96% {transform: translate3d(0, -25%, 0);}
} */

/* 전체 화면에서도 z-index가 제대로 작동하도록 추가 */
.container:fullscreen .text-transition-container {
  z-index: 2;
}

/* Safari용 전체 화면 선택자 */
.container:-webkit-full-screen .text-transition-container {
  z-index: 2;
}

/* 여섯 번째 영상용 슬라이드 애니메이션 스타일 */
.slide-animation-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  max-width: 800px;
  height: 300px;
  position: relative;
  overflow: hidden;
  z-index: 3;
  display: none;
}

.slide-bar {
  position: absolute;
  top: 50%;
  left: 100px;
  transform: translateY(-50%) rotateZ(15deg);
  width: 10px;
  height: 600px;
  z-index: 10;
}

.bar {
  width: 100%;
  height: 150px;
  border-radius: 100px;
  background-color: var(--black);
}

.text-block {
  position: absolute;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background-color: var(--white);
}

.text-block h1 {
  font-family: "Pretendard", sans-serif;
  font-size: clamp(2.5rem, 4vw, 5rem);
  font-weight: 800;
  font-style: italic;
  letter-spacing: 2px;
  position: relative;
  perspective: 500px;
  transform-style: preserve-3d;
  color: var(--black);
}

.text-block h1::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100px;
  left: 0;
  background: radial-gradient(var(--black), transparent 70%);
  transform: translateY(100px) rotateX(-60deg);
  opacity: 0.3;
}

#textone {
  z-index: 6;
  clip-path: polygon(0 0, 18% 0, 8% 100%, 0% 100%);
}

#texttwo {
  z-index: 4;
  clip-path: polygon(0 0, 91% 0, 81% 100%, 0% 100%);
}

#changeColorBtn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 3px solid var(--black);
  background-color: var(--white);
  position: absolute;
  bottom: 20%;
  left: 50%;
  transform: translateX(-50%);
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.3s;
  z-index: 11;
}

#changeColorBtn:hover {
  opacity: 1;
}

/* 전체 화면에서도 z-index가 제대로 작동하도록 추가 */
.container:fullscreen .slide-animation-container,
.container:fullscreen #changeColorBtn {
  z-index: 2;
}

/* Safari용 전체 화면 선택자 */
.container:-webkit-full-screen .slide-animation-container,
.container:-webkit-full-screen #changeColorBtn {
  z-index: 2;
}


@media (max-width: 480px) {
  .center-text {
    font-size: 1.2rem; /* 모바일 세로 모드에서 더 작은 크기 */
  }

  .highlight-text {
    font-size: 1.5rem; /* 모바일 세로 모드에서 더 작은 크기 */
  }

  .typing-text {
    font-size: 1.2rem; /* 모바일 세로 모드에서 더 작은 크기 */
  }

  .fixed-text {
    font-size: 1rem; /* 모바일 세로 모드에서 더 작은 크기 */
  }

  .slide-text {
    font-size: 1.2rem; /* 모바일 세로 모드에서 더 작은 크기 */
  }
}
/* 로고 이미지 스타일 */
.logo {
    display: flex;
    align-items: center;
    padding: 10px 0;
}

.logo-image {
    width: auto; /* 비율 유지 */
    max-width: 200px; /* 최대 너비 제한 */
    object-fit: contain; /* 이미지 비율 유지 */
    transition: transform 0.3s ease;
}

.logo-image:hover {
    transform: scale(1.05); /* 호버 시 약간 확대 */
}

/* 모바일 네비게이션 로고 이미지 */
.mobile-nav-logo {
    display: flex;
    align-items: center;
}

.mobile-nav-logo-image {
    height: 32px; /* 모바일에서는 조금 더 작게 */
    width: auto;
    max-width: 150px;
    object-fit: contain;
}

/* 반응형 로고 크기 조정 */
@media (max-width: 768px) {
    .logo-image {
        height:45px ; /* 태블릿에서 크기 조정 */
        max-width: 180px;
    }
}

@media (max-width: 480px) {
    .logo-image {
        height: 45px; /* 모바일에서 크기 조정 */
        max-width: 150px;
    }
    
    .mobile-nav-logo-image {
        height: 28px;
        max-width: 120px;
    }
}

@media (max-width: 320px) {
    .logo-image {
        height: 45px; /* 초소형 모바일 */
        max-width: 130px;
    }
    
    .mobile-nav-logo-image {
        height: 25px;
        max-width: 100px;
    }
}

/* 로고 로딩 상태 */
.logo-image {
    opacity: 0;
    animation: logoFadeIn 0.5s ease-out 0.2s forwards;
}

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

/* 로고 이미지 로딩 실패 시 대체 텍스트 */
.logo-image[alt]:after {
    content: attr(alt);
    display: block;
    font-weight: bold;
    font-size: 1.2rem;
    color: #333;
}

/* 다크 모드 대응 (선택사항) */
@media (prefers-color-scheme: dark) {
    .logo-image {
        filter: brightness(1.1);
    }
}

.scrolling-text-container.trading-ticker {
    position: fixed;
    bottom: 0px;
    left: 0;
    width: 100%;
    overflow: hidden;
    height: 80px;
    z-index: 2;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-top: 2px solid #334155;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    margin-right: 80px;
    animation: scrollTicker 35s linear infinite;
    padding: 10px 0;
}

/* 통화쌍 이름 */
.currency-pair {
    color: #ffffff;
    font-weight: 700;
    font-size: clamp(1.3rem, 3.2vw, 1.9rem);
    margin-right: 25px;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* 가격 섹션 컨테이너 */
.price-section {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-right: 25px;
}

/* Bid/Ask 가격 그룹 */
.price-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.price-label {
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.price-label.bid {
    color: #22c55e; /* Bid 라벨은 초록색 */
}

.price-label.ask {
    color: #ef4444; /* Ask 라벨은 빨간색 */
}

.price-value {
    display: flex;
    align-items: baseline;
    gap: 1px;
}

.price-main {
    font-weight: 700;
    font-size: clamp(1.1rem, 2.8vw, 1.4rem);
}

.price-points {
    font-weight: 700;
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    margin-left: 1px;
}

.price-decimal {
    color: #94a3b8;
    font-size: clamp(0.9rem, 2.2vw, 1.1rem);
    vertical-align: super;
    margin-left: 1px;
}

/* Bid 가격 스타일 */
.bid-price .price-main,
.bid-price .price-points {
    color: #22c55e; /* Bid는 초록색 */
}

/* Ask 가격 스타일 */
.ask-price .price-main,
.ask-price .price-points {
    color: #ef4444; /* Ask는 빨간색 */
}

/* 변동율 섹션 */
.change-section {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.change-arrow {
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    font-weight: bold;
    animation: arrowPulse 2s ease-in-out infinite;
}

.change-percentage {
    font-weight: 700;
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    letter-spacing: 0.5px;
}

/* 상승/하락 색상 */
.positive .change-section {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.2);
}

.positive .change-arrow,
.positive .change-percentage {
    color: #22c55e;
}

.negative .change-section {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
}

.negative .change-arrow,
.negative .change-percentage {
    color: #ef4444;
}

.neutral .change-section {
    background: rgba(148, 163, 184, 0.1);
    border-color: rgba(148, 163, 184, 0.2);
}

.neutral .change-arrow,
.neutral .change-percentage {
    color: #94a3b8;
}

/* 애니메이션 */
@keyframes scrollTicker {
    from {
        transform: translateX(100vw);
    }
    to {
        transform: translateX(-100%);
    }
}

@keyframes arrowPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

/* 로딩 상태 */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 1.2rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* 반응형 조정 */
@media (max-width: 768px) {
    .scrolling-text-container.trading-ticker {
        height: 70px;
    }

    .ticker-item {
        margin-right: 60px;
    }

    .price-section {
        gap: 15px;
        margin-right: 20px;
    }

    .currency-pair {
        margin-right: 20px;
    }
}

@media (max-width: 480px) {
    .scrolling-text-container.trading-ticker {
        height: 65px;
    }

    .ticker-item {
        margin-right: 50px;
    }

    .price-section {
        gap: 12px;
        margin-right: 15px;
    }

    .currency-pair {
        margin-right: 15px;
    }

    .change-section {
        padding: 6px 12px;
        gap: 6px;
    }
}

/* 데모 컨트롤 */
.demo-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: rgba(30, 41, 59, 0.9);
    padding: 20px;
    border-radius: 10px;
    color: white;
}

.demo-controls button {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    margin: 5px;
}

.demo-controls button:hover {
    background: #2563eb;
}