/**
 * Dynamic Package Tabs Styles
 * Styles for lazy-loaded package cards with animations
 */

/* ==========================================
   Loading Skeleton
   ========================================== */

.package-card.skeleton {
  background: #f5f5f5;
  animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-header {
  height: 180px;
  background: linear-gradient(
    90deg,
    #e0e0e0 0%,
    #f0f0f0 50%,
    #e0e0e0 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 12px 12px 0 0;
}

.skeleton-body {
  padding: 20px;
}

.skeleton-title {
  height: 24px;
  width: 70%;
  background: linear-gradient(
    90deg,
    #e0e0e0 0%,
    #f0f0f0 50%,
    #e0e0e0 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  margin-bottom: 12px;
}

.skeleton-price {
  height: 20px;
  width: 50%;
  background: linear-gradient(
    90deg,
    #e0e0e0 0%,
    #f0f0f0 50%,
    #e0e0e0 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  margin-bottom: 16px;
}

.skeleton-speed {
  height: 60px;
  width: 100%;
  background: linear-gradient(
    90deg,
    #e0e0e0 0%,
    #f0f0f0 50%,
    #e0e0e0 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

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

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

/* ==========================================
   Empty State
   ========================================== */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
  width: 100%;
}

.empty-state img {
  width: 200px;
  height: auto;
  margin-bottom: 24px;
  opacity: 0.6;
}

.empty-state p {
  font-size: 16px;
  color: #666;
  margin: 0;
}

/* ==========================================
   Cards Container Transitions
   ========================================== */

.package-cards-grid .swiper-wrapper {
  transition: opacity 0.3s ease-in-out;
}

/* Card entrance animation */
.package-card {
  animation: fadeInUp 0.4s ease-out forwards;
  opacity: 0;
}

.package-card:nth-child(1) {
  animation-delay: 0.1s;
}

.package-card:nth-child(2) {
  animation-delay: 0.2s;
}

.package-card:nth-child(3) {
  animation-delay: 0.3s;
}

.package-card:nth-child(4) {
  animation-delay: 0.4s;
}

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

/* ==========================================
   Tab Active State Enhancement
   ========================================== */

.package-tab {
  position: relative;
  transition: all 0.3s ease;
}

/* Đã bỏ đường gạch xanh phía dưới tab active */

@keyframes slideIn {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

/* Loading indicator for tab */
.package-tab.loading {
  pointer-events: none;
  opacity: 0.6;
}

.package-tab.loading::before {
  content: '';
  position: absolute;
  top: 50%;
  right: 8px;
  width: 12px;
  height: 12px;
  border: 2px solid #4564ED;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  transform: translateY(-50%);
}

@keyframes spin {
  to {
    transform: translateY(-50%) rotate(360deg);
  }
}

/* ==========================================
   Responsive Adjustments
   ========================================== */

@media (max-width: 768px) {
  .empty-state {
    padding: 60px 20px;
  }

  .empty-state img {
    width: 150px;
  }

  .skeleton-header {
    height: 140px;
  }
}

/* ==========================================
   Smooth Height Transitions
   ========================================== */

.package-cards-grid {
  min-height: 400px;
  position: relative;
}

/* ==========================================
   Card Hover Effects
   ========================================== */

.package-card:not(.skeleton):hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.package-card {
  transition: all 0.3s ease;
}

/* ==========================================
   Tab Badge (Optional - for showing item count)
   ========================================== */

.package-tab .tab-badge {
  display: inline-block;
  background: #e8f0ff;
  color: #4564ED;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 6px;
  vertical-align: middle;
}

.package-tab.active .tab-badge {
  background: #4564ED;
  color: white;
}

/* ==========================================
   Loading Overlay (Alternative style)
   ========================================== */

.package-cards-grid.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================
   Success Animation (when cards load)
   ========================================== */

@keyframes successPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(69, 100, 237, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(69, 100, 237, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(69, 100, 237, 0);
  }
}

.package-card.just-loaded {
  animation: successPulse 0.6s ease-out;
}
