/* ==========================================================================
   ANIMATIONS & SCROLL-TRIGGER SYSTEM (Ngoại Ngữ Khởi Nguyên)
   ========================================================================== */

/* 1. Reveal on scroll (Lướt đến đâu load đến đó) */
.reveal {
  opacity: 0;
  transform: translateY(var(--reveal-y, 26px));
  transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1), transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal.reveal-in {
  opacity: 1;
  transform: translateY(0) !important;
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.93) translateY(20px);
  transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1), transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-scale.reveal-in {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-left.reveal-in {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-right.reveal-in {
  opacity: 1;
  transform: translateX(0);
}

/* 2. Keyframe Animations */
@keyframes floatySlow {
  0%, 100% {
    transform: translateY(0px) scale(1);
  }
  50% {
    transform: translateY(-20px) scale(1.05);
  }
}

@keyframes floaty {
  0%, 100% {
    transform: translateY(0px) scale(1);
  }
  50% {
    transform: translateY(-12px) scale(1.03);
  }
}

@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.animate-shake {
  animation: shakeError 0.45s ease-in-out;
}

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

.animate-menu-down {
  animation: menuFadeDown 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-floaty-slow {
  animation: floatySlow 7s ease-in-out infinite;
}

.animate-floaty {
  animation: floaty 4.5s ease-in-out infinite;
}

/* 3. Card Interactivity & Transitions */
.hover-lift {
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease, border-color 0.35s ease;
}

.hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 35px -10px rgba(162, 36, 126, 0.12), 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

/* 4. Custom Select Dropdown Styling (Bo góc toàn diện) */
.custom-dropdown-container {
  position: relative;
  width: 100%;
}

.custom-dropdown-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  border: 1.5px solid rgba(162, 36, 126, 0.35);
  background-color: #ffffff;
  font-size: 0.875rem;
  color: #1c1917;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.custom-dropdown-btn:focus,
.custom-dropdown-btn.open {
  border-color: #a2247e;
  box-shadow: 0 0 0 3px rgba(162, 36, 126, 0.15);
}

.custom-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow-y: auto;
  background: #ffffff;
  border-radius: 1.25rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 20px 35px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
  z-index: 60;
  padding: 0.4rem;
  scrollbar-width: thin;
  scrollbar-color: #e2e8f0 transparent;
}

.custom-dropdown-menu::-webkit-scrollbar {
  width: 6px;
}

.custom-dropdown-menu::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 9999px;
}

/* Ẩn scrollbar đồng bộ cho tất cả các trình duyệt */
.hide-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.hide-scrollbar::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.custom-dropdown-item {
  display: block;
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.35;
  color: #334155;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.custom-dropdown-item:hover,
.custom-dropdown-item.focused {
  background-color: #1877F2;
  color: #ffffff !important;
}

.custom-dropdown-item.selected {
  background-color: #1877F2;
  color: #ffffff !important;
  font-weight: 700;
}

.custom-dropdown-item.selected .item-sub,
.custom-dropdown-item:hover .item-sub {
  color: rgba(255, 255, 255, 0.85) !important;
}

/* 5. Button Shine Effect */
.btn-shine {
  position: relative;
  overflow: hidden;
}

.btn-shine::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(60deg, transparent, rgba(255,255,255,0.3), transparent);
  transform: rotate(30deg) translateY(-100%);
  transition: transform 0.75s;
}

.btn-shine:hover::after {
  transform: rotate(30deg) translateY(100%);
}

/* 6. Chinese watermark glyphs - Sắc nét rõ ràng từng nét thư pháp */
.chinese-glyph {
  font-family: 'ZCOOL XiaoWei', 'Noto Serif SC', 'Songti SC', 'SimSun', serif;
  user-select: none;
  pointer-events: none;
  color: rgba(162, 36, 126, 0.08) !important;
  -webkit-text-stroke: 1.5px rgba(162, 36, 126, 0.38);
  text-shadow: 0 4px 20px rgba(162, 36, 126, 0.1);
  font-weight: 900;
  line-height: 1;
}

/* 7. Image Transition */
img {
  max-width: 100%;
}


