/* ===============================================================================================
 * TRANSACTION SLIDER - Horizontal scrollable recent transactions
 * ===============================================================================================
 */

/* Wrapper for the slider with fade indicators */
.lofi-transaction-slider-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  max-width: 100%;
}

/* Main horizontal slider container */
.lofi-transaction-slider {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  padding: 4px 4px 12px 4px;
  margin: 0 -4px;
  
  /* Hide scrollbar but keep functionality */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
  
  /* Enable touch scrolling */
  -webkit-overflow-scrolling: touch;
  
  /* Snap scrolling for better UX */
  scroll-snap-type: x mandatory;
  scroll-padding: 0 12px;
}

/* Hide scrollbar for Chrome, Safari */
.lofi-transaction-slider::-webkit-scrollbar {
  display: none;
}

/* Transaction item in slider - preserving original structure */
.lofi-transaction-slider .lofi-transaction-item {
  flex: 0 0 auto;
  width: 280px;
  min-width: 280px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(42, 45, 94, 0.9);
  border: 1px solid rgba(138, 138, 237, 0.2);
  border-radius: 10px;
  transition: all 0.2s ease;
  scroll-snap-align: center;
  
  /* Prevent text selection on drag */
  user-select: none;
  -webkit-user-select: none;
}

.lofi-transaction-slider .lofi-transaction-item:hover {
  background: rgba(138, 138, 237, 0.15);
  border-color: rgba(138, 138, 237, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Active transaction indicator */
.lofi-transaction-slider .lofi-transaction-item.active {
  background: rgba(138, 138, 237, 0.2);
  border-color: rgba(138, 138, 237, 0.5);
  box-shadow: 0 0 0 2px rgba(79, 118, 255, 0.3);
}

/* Make transactions clickable */
.lofi-transaction-slider .lofi-transaction-item {
  cursor: pointer;
}

/* Transaction icon - original styling */
.lofi-transaction-slider .lofi-transaction-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}

.lofi-transaction-slider .lofi-transaction-item.success .lofi-transaction-icon {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.lofi-transaction-slider .lofi-transaction-item.pending .lofi-transaction-icon {
  background: rgba(255, 170, 0, 0.1);
  color: #ffaa00;
  animation: pulse 2s infinite;
}

.lofi-transaction-slider .lofi-transaction-item.failed .lofi-transaction-icon {
  background: rgba(255, 68, 68, 0.1);
  color: #ff4444;
}

/* Transaction details - original styling */
.lofi-transaction-slider .lofi-transaction-details {
  flex: 1;
  min-width: 0; /* Allow text truncation */
}

.lofi-transaction-slider .lofi-transaction-pair {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lofi-transaction-slider .lofi-transaction-time {
  font-size: 12px;
  color: #8898cd;
  margin-top: 2px;
}

/* Transaction link - original styling */
.lofi-transaction-slider .lofi-transaction-link {
  color: #8898cd;
  text-decoration: none;
  transition: color 0.2s ease;
  font-size: 18px;
  flex-shrink: 0;
}

.lofi-transaction-slider .lofi-transaction-link:hover {
  color: #4F76FF;
}

/* Fade indicators for scroll */
.lofi-slider-fade-left,
.lofi-slider-fade-right {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40px;
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.3s ease;
}

.lofi-slider-fade-left {
  left: 0;
  background: linear-gradient(to right, rgba(14, 16, 48, 0.9) 0%, transparent 100%);
}

.lofi-slider-fade-right {
  right: 0;
  background: linear-gradient(to left, rgba(14, 16, 48, 0.9) 0%, transparent 100%);
}

/* No transactions state */
.lofi-no-transactions {
  width: 100%;
  text-align: center;
  color: #8898cd;
  padding: 20px;
  font-size: 13px;
  font-style: italic;
}

/* Recent section adjustments */
.lofi-recent-section {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(138, 138, 237, 0.1);
}

.lofi-recent-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding: 0 4px;
}

.lofi-recent-header h3 {
  font-size: 14px;
  font-weight: 700;
  margin: 0;
  font-family: 'Gluten', 'Comic Sans MS', cursive;
  color: #ffffff;
}

/* Transaction controls styling */
.lofi-transaction-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Navigation buttons - subtle styling */
.lofi-tx-nav {
  background: rgba(138, 138, 237, 0.1);
  border: 1px solid rgba(138, 138, 237, 0.2);
  color: #8898cd;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.lofi-tx-nav:hover:not(:disabled) {
  background: rgba(138, 138, 237, 0.2);
  border-color: rgba(138, 138, 237, 0.4);
  color: #ffffff;
}

.lofi-tx-nav:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Transaction counter - subtle styling */
.lofi-tx-counter {
  font-size: 12px;
  color: #8898cd;
  font-weight: 500;
  font-family: 'Gluten', 'Comic Sans MS', cursive;
  min-width: 40px;
  text-align: center;
}

.lofi-clear-recent {
  background: none;
  border: none;
  color: #8898cd;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease;
  font-family: 'Gluten', 'Comic Sans MS', cursive;
  text-transform: uppercase;
  padding: 4px 8px;
}

.lofi-clear-recent:hover {
  color: #ff4444;
}

/* Pulse animation for pending transactions */
@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .lofi-transaction-slider .lofi-transaction-item {
    width: 240px;
    min-width: 240px;
    padding: 10px;
  }
  
  .lofi-transaction-slider {
    gap: 10px;
  }
  
  .lofi-transaction-slider .lofi-transaction-icon {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }
  
  .lofi-transaction-slider .lofi-transaction-pair {
    font-size: 13px;
  }
  
  .lofi-transaction-slider .lofi-transaction-time {
    font-size: 11px;
  }
  
  .lofi-slider-fade-left,
  .lofi-slider-fade-right {
    width: 30px;
  }
}

/* Touch device optimizations */
@media (pointer: coarse) {
  .lofi-transaction-slider .lofi-transaction-item {
    /* Larger touch targets */
    padding: 14px;
  }
  
  .lofi-transaction-slider {
    /* More space between cards for touch */
    gap: 14px;
    padding-bottom: 16px;
  }
  
  .lofi-tx-nav {
    width: 32px;
    height: 32px;
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .lofi-transaction-slider {
    scroll-behavior: auto;
  }
  
  .lofi-transaction-card {
    transition: none;
  }
  
  .lofi-transaction-card.pending .lofi-transaction-status-icon {
    animation: none;
  }
}