/* 한국어 주석: EnvioSign 공용 애니메이션 스타일 */

/* 기본 애니메이션 클래스 */
.animate-on-scroll {
   opacity: 0;
   transform: translateY(30px);
   transition: all 0.6s ease-out;
}

.animate-on-scroll.animate-in {
   opacity: 1;
   transform: translateY(0);
}

/* 페이드 인 애니메이션 */
.fade-in {
   animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
   from {
      opacity: 0;
      transform: translateY(20px);
   }

   to {
      opacity: 1;
      transform: translateY(0);
   }
}

/* 슬라이드 업 애니메이션 */
.slide-up {
   animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
   from {
      opacity: 0;
      transform: translateY(50px);
   }

   to {
      opacity: 1;
      transform: translateY(0);
   }
}

/* 슬라이드 인 (좌측에서) */
.slide-in-left {
   animation: slideInLeft 0.8s ease-out;
}

@keyframes slideInLeft {
   from {
      opacity: 0;
      transform: translateX(-50px);
   }

   to {
      opacity: 1;
      transform: translateX(0);
   }
}

/* 슬라이드 인 (우측에서) */
.slide-in-right {
   animation: slideInRight 0.8s ease-out;
}

@keyframes slideInRight {
   from {
      opacity: 0;
      transform: translateX(50px);
   }

   to {
      opacity: 1;
      transform: translateX(0);
   }
}

/* 스케일 인 애니메이션 */
.scale-in {
   animation: scaleIn 0.5s ease-out;
}

@keyframes scaleIn {
   from {
      opacity: 0;
      transform: scale(0.8);
   }

   to {
      opacity: 1;
      transform: scale(1);
   }
}

/* 플로팅 애니메이션 */
.float {
   animation: float 3s ease-in-out infinite;
}

@keyframes float {

   0%,
   100% {
      transform: translateY(0px);
   }

   50% {
      transform: translateY(-10px);
   }
}

/* 펄스 애니메이션 */
.pulse {
   animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

   0%,
   100% {
      transform: scale(1);
   }

   50% {
      transform: scale(1.05);
   }
}

/* 바운스 애니메이션 */
.bounce {
   animation: bounce 1s ease-in-out;
}

@keyframes bounce {

   0%,
   20%,
   53%,
   80%,
   100% {
      transform: translateY(0);
   }

   40%,
   43% {
      transform: translateY(-10px);
   }

   70% {
      transform: translateY(-5px);
   }

   90% {
      transform: translateY(-2px);
   }
}

/* 회전 애니메이션 */
.rotate {
   animation: rotate 2s linear infinite;
}

@keyframes rotate {
   from {
      transform: rotate(0deg);
   }

   to {
      transform: rotate(360deg);
   }
}

/* 흔들기 애니메이션 */
.shake {
   animation: shake 0.5s ease-in-out;
}

@keyframes shake {

   0%,
   100% {
      transform: translateX(0);
   }

   10%,
   30%,
   50%,
   70%,
   90% {
      transform: translateX(-5px);
   }

   20%,
   40%,
   60%,
   80% {
      transform: translateX(5px);
   }
}

/* 타이핑 효과 */
.typewriter {
   overflow: hidden;
   border-right: 2px solid #3b82f6;
   white-space: nowrap;
   animation: typing 3s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
   from {
      width: 0;
   }

   to {
      width: 100%;
   }
}

@keyframes blink-caret {

   from,
   to {
      border-color: transparent;
   }

   50% {
      border-color: #3b82f6;
   }
}

/* 그라데이션 애니메이션 */
.gradient-animation {
   background: linear-gradient(-45deg, #3b82f6, #10b981, #f59e0b, #ef4444);
   background-size: 400% 400%;
   animation: gradientShift 4s ease infinite;
}

@keyframes gradientShift {
   0% {
      background-position: 0% 50%;
   }

   50% {
      background-position: 100% 50%;
   }

   100% {
      background-position: 0% 50%;
   }
}

/* 로딩 스피너 */
.loading-spinner {
   display: inline-block;
   width: 20px;
   height: 20px;
   border: 2px solid #f3f3f3;
   border-top: 2px solid #3b82f6;
   border-radius: 50%;
   animation: spin 1s linear infinite;
}

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

   100% {
      transform: rotate(360deg);
   }
}

/* 점 로딩 애니메이션 */
.loading-dots {
   display: inline-block;
}

.loading-dots::after {
   content: '';
   animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {

   0%,
   20% {
      content: '';
   }

   40% {
      content: '.';
   }

   60% {
      content: '..';
   }

   80%,
   100% {
      content: '...';
   }
}

/* 헤더 스크롤 애니메이션 */
.header-hidden {
   transform: translateY(-100%);
   transition: transform 0.3s ease-in-out;
}

.header-scrolled {
   background-color: rgba(255, 255, 255, 0.95);
   backdrop-filter: blur(10px);
   box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
   transition: all 0.3s ease-in-out;
}

/* 카드 호버 효과 */
.card-hover {
   transition: all 0.3s ease;
   cursor: pointer;
}

.card-hover:hover {
   transform: translateY(-5px);
   box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

/* 버튼 애니메이션 */
.btn-animated {
   position: relative;
   overflow: hidden;
   transition: all 0.3s ease;
}

.btn-animated::before {
   content: '';
   position: absolute;
   top: 0;
   left: -100%;
   width: 100%;
   height: 100%;
   background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
   transition: left 0.5s;
}

.btn-animated:hover::before {
   left: 100%;
}

.btn-animated:hover {
   transform: translateY(-2px);
   box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* 텍스트 하이라이트 애니메이션 */
.text-highlight {
   background: linear-gradient(120deg, #a8edea 0%, #fed6e3 100%);
   background-repeat: no-repeat;
   background-size: 100% 0.2em;
   background-position: 0 88%;
   transition: background-size 0.25s ease-in;
}

.text-highlight:hover {
   background-size: 100% 88%;
}

/* 진행률 바 애니메이션 */
.progress-animated .progress-bar {
   animation: progressFill 2s ease-in-out;
}

@keyframes progressFill {
   from {
      width: 0%;
   }
}

/* 모달 애니메이션 */
.modal.fade .modal-dialog {
   transform: scale(0.8);
   transition: transform 0.3s ease-out;
}

.modal.show .modal-dialog {
   transform: scale(1);
}

/* 툴팁 애니메이션 */
.tooltip-animated {
   position: relative;
   cursor: pointer;
}

.tooltip-animated::after {
   content: attr(data-tooltip);
   position: absolute;
   bottom: 100%;
   left: 50%;
   transform: translateX(-50%) translateY(-5px);
   background: #333;
   color: white;
   padding: 5px 10px;
   border-radius: 4px;
   font-size: 12px;
   white-space: nowrap;
   opacity: 0;
   visibility: hidden;
   transition: all 0.3s ease;
   z-index: 1000;
}

.tooltip-animated:hover::after {
   opacity: 1;
   visibility: visible;
   transform: translateX(-50%) translateY(-10px);
}

/* 반응형 애니메이션 비활성화 */
@media (max-width: 768px) {

   .float,
   .pulse,
   .card-hover:hover,
   .btn-animated:hover {
      animation: none;
      transform: none;
   }

   .animate-on-scroll {
      opacity: 1;
      transform: translateY(0);
   }
}

/* 접근성: 애니메이션 비활성화 설정 존중 */
@media (prefers-reduced-motion: reduce) {

   *,
   *::before,
   *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
   }
}