/**
 * Danh Sách Nhỏ 3 Giao Dịch Chạy Tự Động (Auto-Running 3-Item Live Transactions Widget)
 * Chỉ hiển thị trên 3 dịch vụ được chỉ định:
 * 1. 🛒 Tài Khoản Premium (shop.php)
 * 2. 🎭 Acc Random - Clone (clones.php)
 * 3. 🚀 Dịch Vụ Mạng Xã Hội (dvmxh.php)
 * Tác giả: Huỳnh Nguyễn Thành Đạt
 */

.vtx-ticker-strip {
  position: relative;
  width: 100%;
  margin-bottom: 1.25rem;
  background: linear-gradient(135deg, rgba(20, 27, 45, 0.94) 0%, rgba(15, 23, 42, 0.98) 100%);
  border: 1px solid var(--border-glass, rgba(255, 255, 255, 0.1));
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-sizing: border-box;
  user-select: none;
}

[data-theme="light"] .vtx-ticker-strip {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

/* 1. Header của Widget hiển thị 3 giao dịch */
.vtx-ticker-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0.45rem 0.95rem;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.14) 0%, rgba(16, 185, 129, 0.1) 100%);
  border-bottom: 1px solid var(--border-glass, rgba(255, 255, 255, 0.08));
}

[data-theme="light"] .vtx-ticker-header {
  background: #f8fafc;
  border-bottom-color: #f1f5f9;
}

.vtx-ticker-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.vtx-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: vtxPulseAnim 1.6s infinite ease-in-out;
}

@keyframes vtxPulseAnim {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1.15);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.vtx-badge-icon {
  font-size: 0.85rem;
}

.vtx-badge-text {
  font-size: 0.72rem;
  font-weight: 800;
  color: #a5b4fc;
  letter-spacing: 0.35px;
  text-transform: uppercase;
  white-space: nowrap;
}

[data-theme="light"] .vtx-badge-text {
  color: #4338ca;
}

/* 2. Khung Nhìn Viewport hiển thị ĐỒNG THỜI 3 GIAO DỊCH (3 x 36px = 108px) */
.vtx-ticker-viewport {
  height: 108px;
  overflow: hidden;
  position: relative;
  padding: 0 0.85rem;
  box-sizing: border-box;
}

.vtx-ticker-track {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 3. Từng Item Giao Dịch trong danh sách */
.vtx-ticker-item {
  height: 36px;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background-color 0.15s ease;
  padding: 0 0.25rem;
}

.vtx-ticker-item:last-child {
  border-bottom: none;
}

[data-theme="light"] .vtx-ticker-item {
  border-bottom-color: #f1f5f9;
}

.vtx-ticker-item:hover {
  background: rgba(99, 102, 241, 0.08);
}

[data-theme="light"] .vtx-ticker-item:hover {
  background: #f8fafc;
}

.vtx-ticker-item:hover .vtx-item-title {
  color: #818cf8;
}

[data-theme="light"] .vtx-ticker-item:hover .vtx-item-title {
  color: #4f46e5;
}

.vtx-item-thumb {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 6px;
  padding: 2px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

[data-theme="light"] .vtx-item-thumb {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.vtx-item-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

.vtx-item-body {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  font-size: 0.76rem;
  line-height: 1.25;
}

.vtx-buyer {
  color: #38bdf8;
  font-weight: 800;
  letter-spacing: -0.2px;
}

[data-theme="light"] .vtx-buyer {
  color: #0284c7;
}

.vtx-action {
  color: var(--text-muted, #94a3b8);
  font-weight: 500;
}

.vtx-item-title {
  color: var(--text-primary, #ffffff);
  font-weight: 800;
  letter-spacing: -0.2px;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.15s ease;
}

[data-theme="light"] .vtx-item-title {
  color: #0f172a;
}

.vtx-sep {
  color: var(--text-muted, #64748b);
  opacity: 0.6;
}

.vtx-price {
  color: #10b981;
  font-weight: 900;
  font-family: var(--font-mono, monospace);
  letter-spacing: -0.3px;
}

[data-theme="light"] .vtx-price {
  color: #059669;
}

.vtx-time {
  color: var(--text-muted, #94a3b8);
  font-size: 0.7rem;
}

.vtx-badge-check {
  display: inline-flex;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #34d399;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.08rem 0.35rem;
  border-radius: 4px;
  letter-spacing: 0.2px;
  margin-left: auto;
}

[data-theme="light"] .vtx-badge-check {
  color: #15803d;
  background: #dcfce7;
  border-color: #bbf7d0;
}

/* Tối ưu Mobile */
@media (max-width: 768px) {
  .vtx-ticker-strip {
    margin-bottom: 0.95rem;
    border-radius: 12px;
  }

  .vtx-ticker-header {
    padding: 0.38rem 0.75rem;
  }

  .vtx-badge-text {
    font-size: 0.68rem;
  }

  .vtx-ticker-viewport {
    height: 114px; /* 3 x 38px */
    padding: 0 0.65rem;
  }

  .vtx-ticker-item {
    height: 38px;
    gap: 0.45rem;
  }

  .vtx-item-thumb {
    width: 22px;
    height: 22px;
    min-width: 22px;
  }

  .vtx-item-body {
    font-size: 0.72rem;
    gap: 0.3rem;
  }

  .vtx-item-title {
    max-width: 140px;
  }

  .vtx-badge-check {
    display: none;
  }
}

@media (max-width: 480px) {
  .vtx-item-title {
    max-width: 110px;
  }

  .vtx-sep:nth-of-type(2),
  .vtx-time {
    display: none;
  }
}
