/* =============================================
   VIETTECH CORP - ANIMATIONS STYLESHEET
   Keyframes & Animation Utilities
   ============================================= */

/* --- Keyframe Definitions --- */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-24px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes scaleInBounce {
  0% { opacity: 0; transform: scale(0.6); }
  70% { transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes rotateIn {
  from { opacity: 0; transform: rotate(-15deg) scale(0.9); }
  to { opacity: 1; transform: rotate(0) scale(1); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes spinSlow {
  to { transform: rotate(360deg); }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); animation-timing-function: cubic-bezier(0.8, 0, 1, 1); }
  50% { transform: translateY(-20px); animation-timing-function: cubic-bezier(0, 0, 0.2, 1); }
}

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

@keyframes heartbeat {
  0% { transform: scale(1); }
  14% { transform: scale(1.1); }
  28% { transform: scale(1); }
  42% { transform: scale(1.1); }
  70% { transform: scale(1); }
}

@keyframes wiggle {
  0%, 7% { transform: rotateZ(0); }
  15% { transform: rotateZ(-15deg); }
  20% { transform: rotateZ(10deg); }
  25% { transform: rotateZ(-10deg); }
  30% { transform: rotateZ(6deg); }
  35% { transform: rotateZ(-4deg); }
  40%, 100% { transform: rotateZ(0); }
}

@keyframes ripple {
  0% { transform: scale(0); opacity: 1; }
  100% { transform: scale(4); opacity: 0; }
}

@keyframes shimmerSlide {
  from { background-position: -200% center; }
  to { background-position: 200% center; }
}

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

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

@keyframes drawLine {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes expandHeight {
  from { max-height: 0; opacity: 0; }
  to { max-height: 500px; opacity: 1; }
}

@keyframes morphBg {
  0% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
  50% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
  100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
}

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

@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blinkCursor {
  50% { border-color: transparent; }
}

@keyframes floatSlow {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33% { transform: translateY(-10px) rotate(2deg); }
  66% { transform: translateY(-5px) rotate(-1deg); }
}

@keyframes particleFloat {
  0% { transform: translateY(0) translateX(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(-100px) translateX(20px) rotate(360deg); opacity: 0; }
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 5px rgba(29,132,181,0.4), 0 0 20px rgba(29,132,181,0.2); }
  50% { box-shadow: 0 0 20px rgba(29,132,181,0.8), 0 0 60px rgba(29,132,181,0.4); }
}

@keyframes textGlow {
  0%, 100% { text-shadow: 0 0 10px rgba(29,132,181,0.5); }
  50% { text-shadow: 0 0 30px rgba(29,132,181,1), 0 0 60px rgba(29,132,181,0.5); }
}

@keyframes borderDance {
  0% { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}

@keyframes slideRight {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

@keyframes zoomInOut {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* --- Animation Utility Classes --- */

.animate-fadeIn { animation: fadeIn 0.6s ease forwards; }
.animate-fadeInUp { animation: fadeInUp 0.6s ease forwards; }
.animate-fadeInDown { animation: fadeInDown 0.6s ease forwards; }
.animate-fadeInLeft { animation: fadeInLeft 0.6s ease forwards; }
.animate-fadeInRight { animation: fadeInRight 0.6s ease forwards; }
.animate-scaleIn { animation: scaleIn 0.5s ease forwards; }
.animate-scaleInBounce { animation: scaleInBounce 0.6s cubic-bezier(0.34,1.56,0.64,1) forwards; }
.animate-spin { animation: spin 1s linear infinite; }
.animate-spinSlow { animation: spinSlow 8s linear infinite; }
.animate-bounce { animation: bounce 1.2s infinite; }
.animate-pulse { animation: pulse 2s cubic-bezier(0.4,0,0.6,1) infinite; }
.animate-heartbeat { animation: heartbeat 1.5s ease infinite; }
.animate-wiggle { animation: wiggle 1s ease; }
.animate-float { animation: floatSlow 6s ease-in-out infinite; }
.animate-glowPulse { animation: glowPulse 2.5s ease-in-out infinite; }
.animate-gradientShift {
  background-size: 300% 300%;
  animation: gradientShift 4s ease infinite;
}
.animate-zoomInOut { animation: zoomInOut 6s ease-in-out infinite; }
.animate-morphBg { animation: morphBg 8s ease-in-out infinite; }

/* Delay utilities */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }

/* Duration utilities */
.duration-300 { animation-duration: 0.3s; }
.duration-500 { animation-duration: 0.5s; }
.duration-700 { animation-duration: 0.7s; }
.duration-1000 { animation-duration: 1s; }
.duration-2000 { animation-duration: 2s; }

/* --- Hero Slider --- */
.hero-slider {
  position: relative;
  overflow: hidden;
  height: 600px;
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease, transform 1s ease;
  transform: scale(1.02);
}

.slide.active {
  opacity: 1;
  transform: scale(1);
  z-index: 1;
}

.slide-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(6,24,64,0.85) 0%, rgba(10,36,99,0.6) 50%, rgba(29,132,181,0.3) 100%);
}

.slide-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  align-items: center;
}

.slide-text {
  max-width: 650px;
}

.slide-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(230,57,70,0.9);
  color: #fff;
  padding: 6px 16px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
  animation: fadeInDown 0.6s 0.2s both;
}

.slide-title {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 900;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 1rem;
  animation: fadeInUp 0.7s 0.3s both;
}

.slide-title span {
  background: linear-gradient(90deg, #f4a261, #e63946);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.slide-desc {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.85);
  margin-bottom: 2rem;
  line-height: 1.7;
  animation: fadeInUp 0.7s 0.4s both;
}

.slide-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  animation: fadeInUp 0.7s 0.5s both;
}

/* Slider Controls */
.slider-dots {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.slider-dot {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
}

.slider-dot.active {
  width: 28px;
  background: #fff;
}

.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  border: 1.5px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  color: #fff;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
}

.slider-arrow:hover {
  background: rgba(255,255,255,0.3);
  transform: translateY(-50%) scale(1.1);
}

.slider-arrow.prev { left: 24px; }
.slider-arrow.next { right: 24px; }

/* --- Partner/Client Carousel --- */
.carousel-track-wrapper {
  overflow: hidden;
  position: relative;
}

.carousel-track-wrapper::before,
.carousel-track-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 80px;
  z-index: 2;
  pointer-events: none;
}

.carousel-track-wrapper::before {
  left: 0;
  background: linear-gradient(to right, white, transparent);
}

.carousel-track-wrapper::after {
  right: 0;
  background: linear-gradient(to left, white, transparent);
}

.carousel-track {
  display: flex;
  gap: 32px;
  align-items: center;
  animation: scrollTrack 25s linear infinite;
  width: max-content;
}

.carousel-track:hover {
  animation-play-state: paused;
}

@keyframes scrollTrack {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.carousel-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 32px;
  background: white;
  border-radius: 12px;
  border: 1px solid #e9ecef;
  min-width: 140px;
  height: 70px;
  flex-shrink: 0;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--gray-500, #adb5bd);
  letter-spacing: 0.5px;
}

.carousel-item:hover {
  border-color: var(--primary, #0a2463);
  color: var(--primary, #0a2463);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(10,36,99,0.12);
}

/* --- Testimonial Slider --- */
.testimonial-slide {
  display: none;
  animation: fadeIn 0.5s ease;
}

.testimonial-slide.active {
  display: block;
}

/* --- Progress / Poll Bars --- */
.poll-bar-wrapper {
  margin-bottom: 1rem;
}

.poll-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700, #495057);
  margin-bottom: 6px;
}

.poll-bar-track {
  height: 10px;
  background: #e9ecef;
  border-radius: 99px;
  overflow: hidden;
}

.poll-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #0a2463, #1d84b5);
  width: 0;
  transition: width 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* --- Lightbox --- */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.95);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.lightbox-overlay.open {
  opacity: 1;
  visibility: visible;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 80px rgba(0,0,0,0.8);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.lightbox-overlay.open .lightbox-img {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid rgba(255,255,255,0.2);
}

.lightbox-close:hover {
  background: #e63946;
  transform: rotate(90deg);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid rgba(255,255,255,0.2);
}

.lightbox-nav:hover { background: rgba(255,255,255,0.25); }
.lightbox-nav.prev { left: 20px; }
.lightbox-nav.next { right: 20px; }

.lightbox-caption {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 8px 20px;
  border-radius: 99px;
  font-size: 0.85rem;
  white-space: nowrap;
}

.lightbox-counter {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.6);
  color: rgba(255,255,255,0.8);
  padding: 6px 16px;
  border-radius: 99px;
  font-size: 0.8rem;
}

/* --- Timeline --- */
.timeline {
  position: relative;
  padding: 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--primary, #0a2463), var(--accent, #1d84b5));
  transform: translateX(-50%);
}

.timeline-item {
  display: grid;
  grid-template-columns: 1fr 60px 1fr;
  gap: 0;
  margin-bottom: 3rem;
  align-items: start;
}

.timeline-item:nth-child(odd) .timeline-content {
  text-align: right;
  padding-right: 2rem;
}

.timeline-item:nth-child(even) .timeline-content {
  grid-column: 3;
  text-align: left;
  padding-left: 2rem;
}

.timeline-item:nth-child(even) .timeline-empty {
  grid-column: 1;
  grid-row: 1;
}

.timeline-dot {
  width: 20px;
  height: 20px;
  background: var(--gradient-primary);
  border-radius: 50%;
  margin: 0 auto;
  border: 3px solid white;
  box-shadow: 0 0 0 3px var(--primary, #0a2463);
  position: relative;
  z-index: 1;
  margin-top: 6px;
}

.timeline-year {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--primary, #0a2463);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.timeline-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gray-900, #212529);
  margin-bottom: 0.5rem;
}

.timeline-text {
  font-size: 0.875rem;
  color: var(--gray-600, #6c757d);
  line-height: 1.7;
}

/* --- Mobile Timeline --- */
@media (max-width: 640px) {
  .timeline::before {
    left: 20px;
  }

  .timeline-item {
    grid-template-columns: 40px 1fr;
    gap: 0;
  }

  .timeline-item:nth-child(odd) .timeline-content,
  .timeline-item:nth-child(even) .timeline-content {
    text-align: left;
    padding-left: 1.5rem;
    padding-right: 0;
    grid-column: 2;
    grid-row: 1;
  }

  .timeline-dot {
    width: 16px;
    height: 16px;
    grid-column: 1;
    grid-row: 1;
  }

  .timeline-empty { display: none; }

  .hero-slider { height: 450px; }
  .slider-arrow { display: none; }
}

/* --- Org Chart --- */
.org-chart {
  text-align: center;
  overflow-x: auto;
  padding: 2rem 1rem;
}

.org-level {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 0;
  flex-wrap: wrap;
}

.org-node {
  background: white;
  border: 2px solid var(--primary, #0a2463);
  border-radius: 12px;
  padding: 12px 20px;
  min-width: 140px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary, #0a2463);
  position: relative;
  box-shadow: 0 4px 12px rgba(10,36,99,0.1);
  transition: all 0.3s ease;
}

.org-node:hover {
  background: var(--primary, #0a2463);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(10,36,99,0.2);
}

.org-node.top {
  background: var(--gradient-primary);
  color: white;
  font-size: 0.9rem;
  padding: 16px 28px;
}

.org-connector {
  display: flex;
  justify-content: center;
  padding: 0;
}

.org-connector-line {
  width: 2px;
  height: 30px;
  background: var(--primary, #0a2463);
}

.org-connector-h {
  height: 2px;
  background: var(--primary, #0a2463);
  flex: 1;
}

/* --- Tag Cloud --- */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1rem 0;
}

.tag {
  padding: 5px 14px;
  background: var(--gray-100, #f1f3f5);
  color: var(--gray-700, #495057);
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  border: 1px solid transparent;
}

.tag:hover,
.tag.active {
  background: var(--primary, #0a2463);
  color: white;
  transform: translateY(-1px);
}

/* --- Step Progress --- */
.steps {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  position: relative;
}

.steps::before {
  content: '';
  position: absolute;
  top: 24px;
  left: 10%;
  right: 10%;
  height: 2px;
  background: var(--gray-200, #e9ecef);
}

.step-item {
  flex: 1;
  text-align: center;
  position: relative;
  z-index: 1;
}

.step-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gray-200, #e9ecef);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--gray-500, #adb5bd);
  margin: 0 auto 0.75rem;
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: all 0.4s ease;
}

.step-item.done .step-circle {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 16px rgba(10,36,99,0.3);
}

.step-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gray-700, #495057);
  margin-bottom: 0.25rem;
}

.step-desc {
  font-size: 0.7rem;
  color: var(--gray-500, #adb5bd);
}

@media (max-width: 640px) {
  .steps { flex-direction: column; align-items: center; }
  .steps::before { display: none; }
}
