/* ============================================
   TRANSACTIONS SECTION - PREMIUM DESIGN
   FULL WIDTH SECTION + 1450px CONTAINER
   IMPROVED CARD LAYOUT
   ============================================ */

/* ---------- Section Base ---------- */
.trans-section-new {
  width: 100%;
  position: relative;
  overflow: hidden;
  padding: clamp(60px, 6vw, 110px) 0;
  background: transparent;
  box-sizing: border-box;
  min-height: auto;
}

/* Background layers full cover */
.trans-section-new .section-background,
.trans-section-new .section-background-overlay {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
  transform: scale(1.03);
  pointer-events: none;
}

/* Extra dark overlay for readability */
.trans-section-new::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 500px at 15% 15%, rgba(0, 212, 255, 0.18), transparent 60%),
    radial-gradient(900px 500px at 85% 25%, rgba(16, 185, 129, 0.14), transparent 60%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.45));
}

/* Ensure content above backgrounds */
.trans-section-new .container {
  position: relative;
  z-index: 1;
}

/* ---------- Container width: 1450px max ---------- */
.trans-section-new > .container {
  max-width: 1450px !important;
  width: 100% !important;
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(16px, 2.2vw, 44px);
  padding-right: clamp(16px, 2.2vw, 44px);
  box-sizing: border-box;
}

/* ---------- Section Header ---------- */
.trans-section-new .section-header {
  max-width: 1000px;
  margin: 0 0 clamp(24px, 3vw, 40px) 0;
}

.trans-section-new .section-title-left {
  margin: 0 0 12px 0;
  line-height: 1.15;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  font-family: 'Saira', sans-serif;
}

.trans-section-new .section-title-left .title-white {
  color: #ffffff;
}

.trans-section-new .section-title-left .gradient-text {
  background: linear-gradient(135deg, #00d4ff 0%, #10b981 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.trans-section-new .section-description-left {
  margin: 0;
  opacity: 0.88;
  line-height: 1.65;
  font-size: clamp(14px, 1.8vw, 16px);
  color: rgba(255, 255, 255, 0.85);
  max-width: 900px;
}

/* ---------- Grid Container ---------- */
.trans-container-new {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(18px, 2.4vw, 40px);
  box-sizing: border-box;
}

/* ---------- Transaction Box ---------- */
.trans-box-new {
  width: 100%;
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
              box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
              border-color 0.4s ease;
  box-sizing: border-box;
}

/* Soft gradient glow on hover */
.trans-box-new::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 26px;
  background: linear-gradient(135deg,
    rgba(0, 212, 255, 0.6),
    rgba(16, 185, 129, 0.4),
    rgba(59, 130, 246, 0.4)
  );
  opacity: 0;
  filter: blur(14px);
  z-index: -1;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.trans-box-new:hover {
  transform: translateY(-8px);
  border-color: rgba(0, 212, 255, 0.4);
  box-shadow: 0 28px 80px rgba(0, 212, 255, 0.18), 0 20px 60px rgba(0, 0, 0, 0.4);
}

.trans-box-new:hover::before {
  opacity: 0.9;
}

/* ---------- Box Header ---------- */
.trans-box-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 26px;
  background: linear-gradient(90deg, rgba(0, 212, 255, 0.15), rgba(255, 255, 255, 0.04));
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.trans-icon-new {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  font-size: 24px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.3);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
              box-shadow 0.4s ease;
}

.trans-icon-new.deposits-icon {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.trans-icon-new.withdrawals-icon {
  background: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%);
}

.trans-box-new:hover .trans-icon-new {
  transform: scale(1.12) rotate(8deg);
  box-shadow: 0 18px 40px rgba(0, 212, 255, 0.25);
}

.trans-box-title {
  margin: 0;
  font-size: clamp(19px, 2vw, 22px);
  font-weight: 800;
  color: rgba(255, 255, 255, 0.98);
  font-family: 'Saira', sans-serif;
  letter-spacing: 0.3px;
}

/* ---------- Items Wrapper ---------- */
.trans-items-wrapper {
  padding: 18px;
  max-height: 540px;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* Custom Scrollbar */
.trans-items-wrapper::-webkit-scrollbar {
  width: 8px;
}

.trans-items-wrapper::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  margin: 4px 0;
}

.trans-items-wrapper::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(0, 212, 255, 0.4), rgba(16, 185, 129, 0.3));
  border-radius: 20px;
  border: 2px solid rgba(0, 0, 0, 0.2);
}

.trans-items-wrapper::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(0, 212, 255, 0.6), rgba(16, 185, 129, 0.4));
}

/* ---------- Transaction Card - IMPROVED LAYOUT ---------- */
.trans-card-new {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
}

/* Card hover glow effect */
.trans-card-new::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #00d4ff, #10b981);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.trans-card-new:last-child {
  margin-bottom: 0;
}

.trans-card-new:hover {
  transform: translateX(6px);
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(0, 212, 255, 0.4);
  box-shadow: 0 12px 32px rgba(0, 212, 255, 0.16);
}

.trans-card-new:hover::before {
  opacity: 1;
}

.trans-card-new.empty-card {
  opacity: 0.6;
  cursor: default;
}

.trans-card-new.empty-card:hover {
  transform: none;
}

/* Left: Username */
.trans-username {
  flex: 0 0 auto;
  min-width: 0;
  max-width: 45%;
  font-size: 15px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.96);
  font-family: 'Saira', sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.3s ease;
  letter-spacing: 0.2px;
}

.trans-card-new:hover .trans-username {
  color: #00d4ff;
}

/* Center: Payment Icon */
.trans-payment-icon {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.14);
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.trans-payment-icon::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.4), rgba(16, 185, 129, 0.3));
  opacity: 0;
  z-index: -1;
  transition: opacity 0.3s ease;
}

.trans-card-new:hover .trans-payment-icon {
  transform: scale(1.1) rotate(-5deg);
  background: rgba(0, 212, 255, 0.18);
  border-color: rgba(0, 212, 255, 0.4);
  box-shadow: 0 8px 24px rgba(0, 212, 255, 0.2);
}

.trans-card-new:hover .trans-payment-icon::after {
  opacity: 1;
}

.trans-payment-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 1;
}

.trans-payment-icon i {
  font-size: 22px;
  color: #9ca3af;
  position: relative;
  z-index: 1;
}

/* Right: Amount Value */
.trans-value {
  flex: 0 0 auto;
  font-size: 16px;
  font-weight: 900;
  font-family: 'Saira', sans-serif;
  text-align: right;
  white-space: nowrap;
  transition: all 0.3s ease;
  letter-spacing: 0.3px;
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
}

.trans-card-new:hover .trans-value {
  transform: scale(1.08);
  background: rgba(255, 255, 255, 0.1);
}

.trans-value.positive-value {
  color: #22c55e;
  text-shadow: 0 0 12px rgba(34, 197, 94, 0.3);
}

.trans-value.negative-value {
  color: #60a5fa;
  text-shadow: 0 0 12px rgba(96, 165, 250, 0.3);
}

.trans-value.neutral-value {
  color: #a3a3a3;
}

/* ---------- Fade-up Animation ---------- */
@keyframes transFadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.trans-box-new {
  animation: transFadeUp 0.6s ease both;
}

.trans-box-new:nth-child(1) {
  animation-delay: 0.08s;
}

.trans-box-new:nth-child(2) {
  animation-delay: 0.16s;
}

/* Card stagger animation */
@keyframes cardSlideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.trans-card-new {
  animation: cardSlideIn 0.4s ease both;
}

.trans-card-new:nth-child(1) { animation-delay: 0.05s; }
.trans-card-new:nth-child(2) { animation-delay: 0.1s; }
.trans-card-new:nth-child(3) { animation-delay: 0.15s; }
.trans-card-new:nth-child(4) { animation-delay: 0.2s; }
.trans-card-new:nth-child(5) { animation-delay: 0.25s; }
.trans-card-new:nth-child(6) { animation-delay: 0.3s; }
.trans-card-new:nth-child(7) { animation-delay: 0.35s; }
.trans-card-new:nth-child(8) { animation-delay: 0.4s; }
.trans-card-new:nth-child(9) { animation-delay: 0.45s; }
.trans-card-new:nth-child(10) { animation-delay: 0.5s; }

/* ---------- Responsive Design ---------- */

/* Large Desktop */
@media (max-width: 1400px) {
  .trans-section-new > .container {
    max-width: 1300px !important;
  }
}

/* Desktop */
@media (max-width: 1200px) {
  .trans-section-new > .container {
    max-width: 1100px !important;
  }
  
  .trans-container-new {
    gap: clamp(16px, 2vw, 30px);
  }
}

/* Tablet */
@media (max-width: 1024px) {
  .trans-container-new {
    grid-template-columns: 1fr;
    gap: clamp(20px, 3vw, 30px);
  }

  .trans-items-wrapper {
    max-height: 460px;
  }
  
  .trans-username {
    max-width: 50%;
  }
}

/* Tablet Small */
@media (max-width: 900px) {
  .trans-section-new {
    padding: clamp(50px, 6vw, 80px) 0;
  }
  
  .trans-box-header {
    padding: 20px 22px;
  }
  
  .trans-items-wrapper {
    padding: 16px;
  }
}

/* Mobile Large */
@media (max-width: 768px) {
  .trans-section-new {
    padding: clamp(50px, 6vw, 70px) 0;
  }

  .trans-box-header {
    padding: 18px 20px;
    gap: 14px;
  }

  .trans-box-title {
    font-size: 19px;
  }

  .trans-icon-new {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    font-size: 22px;
  }

  .trans-card-new {
    padding: 14px 16px;
    gap: 14px;
    margin-bottom: 10px;
  }

  .trans-payment-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }

  .trans-username {
    font-size: 14px;
    max-width: 45%;
  }

  .trans-value {
    font-size: 15px;
    padding: 5px 10px;
  }

  .trans-items-wrapper {
    max-height: 420px;
    padding: 14px;
  }
}

/* Mobile Medium */
@media (max-width: 640px) {
  .trans-card-new {
    padding: 13px 14px;
    gap: 12px;
  }
  
  .trans-payment-icon {
    width: 42px;
    height: 42px;
  }
  
  .trans-username {
    font-size: 13.5px;
  }
  
  .trans-value {
    font-size: 14.5px;
  }
}

/* Mobile Small */
@media (max-width: 480px) {
  .trans-section-new {
    padding: clamp(40px, 5vw, 60px) 0;
  }

  .trans-section-new > .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .trans-box-header {
    padding: 16px 18px;
    gap: 12px;
  }

  .trans-icon-new {
    width: 46px;
    height: 46px;
    font-size: 20px;
    border-radius: 14px;
  }

  .trans-box-title {
    font-size: 18px;
  }

  .trans-items-wrapper {
    padding: 12px;
    max-height: 400px;
  }

  .trans-card-new {
    gap: 10px;
    margin-bottom: 10px;
    padding: 12px 14px;
    border-radius: 16px;
  }

  .trans-payment-icon {
    width: 40px;
    height: 40px;
    border-radius: 13px;
  }

  .trans-username {
    font-size: 13px;
    max-width: 42%;
  }

  .trans-value {
    font-size: 14px;
    padding: 4px 8px;
  }
}

/* Extra Small */
@media (max-width: 360px) {
  .trans-card-new {
    padding: 11px 12px;
    gap: 8px;
  }

  .trans-payment-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .trans-username {
    font-size: 12.5px;
    max-width: 40%;
  }

  .trans-value {
    font-size: 13px;
    padding: 4px 7px;
  }

  .trans-icon-new {
    width: 42px;
    height: 42px;
    font-size: 18px;
  }

  .trans-box-title {
    font-size: 16px;
  }

  .trans-items-wrapper {
    padding: 10px;
    max-height: 360px;
  }
  
  .trans-box-header {
    padding: 14px 16px;
  }
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .trans-box-new,
  .trans-card-new,
  .trans-icon-new,
  .trans-payment-icon,
  .trans-username,
  .trans-value {
    animation: none !important;
    transition: none !important;
  }

  .trans-box-new::before,
  .trans-card-new::before,
  .trans-payment-icon::after {
    transition: none !important;
  }
}

/* Print Styles */
@media print {
  .trans-section-new {
    background: white !important;
    padding: 20px 0;
  }

  .trans-section-new .section-background,
  .trans-section-new .section-background-overlay,
  .trans-section-new::after {
    display: none !important;
  }

  .trans-box-new {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    page-break-inside: avoid;
    background: white !important;
  }

  .trans-box-new::before,
  .trans-card-new::before,
  .trans-payment-icon::after {
    display: none !important;
  }
  
  .trans-card-new {
    border: 1px solid #ddd !important;
    background: #f9f9f9 !important;
  }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
  .trans-box-new {
    background: rgba(255, 255, 255, 0.05);
  }
  
  .trans-card-new {
    background: rgba(255, 255, 255, 0.08);
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .trans-box-new {
    border: 2px solid rgba(255, 255, 255, 0.3);
  }
  
  .trans-card-new {
    border: 2px solid rgba(255, 255, 255, 0.2);
  }
  
  .trans-username,
  .trans-value {
    font-weight: 900;
  }
}


.trans-card-new {
  display: grid;
  grid-template-columns: 1fr 70px 120px; /* Username | Icon fixed 70px | Amount fixed 120px */
  align-items: center; /* Vertically center all */
  gap: 16px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  box-sizing: border-box;
  position: relative;
  margin-bottom: 12px;
}

/* Username column (left) */
.trans-username {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.95);
  font-family: 'Saira', sans-serif;
  transition: color 0.3s ease;
}

/* Icon column - center icon both vertically and horizontally */
.trans-payment-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.14);
  border: 2px solid rgba(255, 255, 255, 0.2);
  
  /* Center icon inside fixed width grid cell */
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  
  padding: 0; /* remove left padding */
  transition: all 0.3s ease;
}

/* Amount column - right align */
.trans-value {
  font-weight: 900;
  font-family: 'Saira', sans-serif;
  font-size: 16px;
  white-space: nowrap;
  padding-left: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  transition: background 0.3s ease, transform 0.3s ease;
  text-align: right; /* Right aligned text */
}

.trans-card-new:hover .trans-value {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.08);
}



@media (max-width: 480px) {
  /* Adjust grid columns to give username more space */
  .trans-card-new {
    grid-template-columns: 1.5fr 40px 1fr; /* Username wider, icon smaller, amount flexible */
    padding: 12px 14px;
    gap: 10px;    
  }

  /* Allow username to wrap text (2 lines max) instead of ellipsis */
  .trans-username {
    white-space: normal;       /* allow multiple lines */
    overflow-wrap: break-word; /* wrap long words */
    display: -webkit-box;
    -webkit-line-clamp: 2;     /* show at most 2 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: clip;
    max-height: 3em;           /* approx 2 lines */
    font-size: 14px;           /* slightly smaller font */
  }

  /* Slightly smaller payment icon */
  .trans-payment-icon {
    width: 36px;
    height: 36px;
    padding-left: 4px;         /* keep icon left aligned */
  }

  /* Amount column: keep right aligned but flexible */
  .trans-value {
    font-size: 14px;
    padding-left: 6px;
    text-align: right;
  }
}