/* ===== 1. RESULT CARDS WITH ANIMATIONS ===== */
.result-card {
  position: relative;
  padding: 10px 14px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(15, 18, 25, 0.9), rgba(10, 12, 18, 0.95));
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
  overflow: hidden;
  cursor: pointer;
}

.result-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--border-color);
  transition: background 0.2s ease;
}

.result-card.approved::before {
  background: linear-gradient(180deg, #22c55e, #16a34a);
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.4);
}

.result-card.declined::before {
  background: linear-gradient(180deg, #ef4444, #dc2626);
}

.result-card.threed::before {
  background: linear-gradient(180deg, #f59e0b, #d97706);
}

.result-card.timeout::before {
  background: linear-gradient(180deg, #6b7280, #4b5563);
}

/* Slide-in animation */
.result-card {
  animation: slideInResult 0.3s ease-out;
}

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

/* Hover effect */
.result-card:hover {
  transform: translateX(4px);
  border-color: rgba(255, 255, 255, 0.15);
  background: linear-gradient(135deg, rgba(20, 23, 30, 0.95), rgba(12, 14, 20, 0.98));
}

/* Approved special styling */
.result-card.approved {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(10, 12, 18, 0.95));
  border-color: rgba(34, 197, 94, 0.25);
}

.result-card.approved:hover {
  box-shadow: 0 0 25px rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.4);
}

/* Pulse animation for new approved */
@keyframes pulseApproved {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
}

.result-card.approved.new {
  animation: slideInResult 0.3s ease-out, pulseApproved 0.8s ease-in-out 3;
}

/* Result card content */
.result-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.result-pan {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--text-primary);
}

.result-phone {
  font-size: 10px;
  color: var(--text-muted);
  font-family: monospace;
}

/* Result badge */
.result-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 9999px;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

.result-badge i {
  width: 10px;
  height: 10px;
}

.result-badge.approved {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.result-badge.declined {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.result-badge.threed {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.result-badge.timeout {
  background: rgba(107, 114, 128, 0.2);
  color: #9ca3af;
}

/* Expandable detail */
.result-detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  font-size: 10px;
  color: var(--text-muted);
}

.result-card.expanded .result-detail {
  max-height: 100px;
  padding-top: 8px;
  margin-top: 8px;
  border-top: 1px solid var(--border-color);
}

/* Copied feedback */
.result-card.copied {
  background: rgba(34, 197, 94, 0.15) !important;
}

.result-card.copied::after {
  content: '✓ Copiado';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--success);
  color: white;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  animation: fadeInOut 0.8s ease;
}

@keyframes fadeInOut {
  0%, 100% { opacity: 0; }
  20%, 80% { opacity: 1; }
}

/* ===== 2. INPUT VALIDATIONS ===== */
input.input-valid,
textarea.input-valid {
  border-color: var(--success) !important;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.1);
}

input.input-invalid,
textarea.input-invalid {
  border-color: var(--error) !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.1);
  animation: shake 0.3s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

/* Inline validation message */
.input-message {
  font-size: 10px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  animation: fadeIn 0.2s ease;
}

.input-message i {
  width: 12px;
  height: 12px;
}

.input-message.error {
  color: var(--error);
}

.input-message.success {
  color: var(--success);
}

.input-message.warning {
  color: var(--warning);
}

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

/* ===== 3. SKELETON LOADING ===== */
.skeleton {
  background: linear-gradient(90deg,
    var(--bg-surface) 25%,
    var(--bg-elevated) 50%,
    var(--bg-surface) 75%
  );
  background-size: 200% 100%;
  animation: skeleton 1.5s infinite;
  border-radius: 6px;
}

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

.skeleton-text {
  height: 14px;
  width: 100%;
}

.skeleton-text.sm {
  height: 10px;
  width: 60%;
}

.skeleton-card {
  height: 48px;
  width: 100%;
  margin-bottom: 8px;
}

/* ===== 4. PROGRESS BAR ANIMATED ===== */
.progress-bar-animated {
  position: relative;
  overflow: hidden;
}

.progress-bar-animated::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.15),
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ===== 5. STAT NUMBERS ANIMATION ===== */
.stat-number {
  font-variant-numeric: tabular-nums;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stat-number.updating {
  transform: scale(1.15);
  color: var(--accent);
}

.stat-number.highlight-success {
  color: var(--success);
  text-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

/* ===== 6. BUTTON LOADING STATE ===== */
.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.8;
}

.btn-loading > *:not(.btn-spinner) {
  opacity: 0;
}

.btn-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ===== 7. SPEED & ETA STATS ===== */
.stat-speed {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.stat-speed-value {
  font-size: 24px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  line-height: 1;
}

.stat-speed-unit {
  font-size: 10px;
  color: var(--text-muted);
}

.stat-eta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: var(--text-secondary);
}

/* ===== 8. FILTER BUTTONS ===== */
.filter-btn-group {
  display: flex;
  gap: 4px;
  padding: 3px;
  background: var(--bg-surface);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.filter-btn {
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 500;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.filter-btn:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.filter-btn.active {
  background: var(--accent);
  color: white;
}

.filter-btn i {
  width: 12px;
  height: 12px;
}

.filter-btn .count {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.15);
}

/* ===== 9. EXPORT DROPDOWN ===== */
.export-dropdown {
  position: relative;
}

.export-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  min-width: 140px;
  padding: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.15s ease;
}

.export-dropdown.open .export-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.export-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.1s ease;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.export-dropdown-item:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.export-dropdown-item i {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
}

/* ===== 10. LIVE APPROVED IMPROVED ===== */
.live-approved-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), transparent);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 8px;
  font-size: 11px;
  font-family: monospace;
  color: var(--success);
  animation: liveApprovedEnter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.live-approved-item i {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

@keyframes liveApprovedEnter {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ===== 11. NOTIFICATION BADGE ===== */
.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--error);
  color: white;
  font-size: 9px;
  font-weight: 700;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: badgePop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes badgePop {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

/* ===== 12. SESSION STATS CARD ===== */
.session-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-color);
}

.session-stat-row:last-child {
  border-bottom: none;
}

.session-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.session-stat-label i {
  width: 12px;
  height: 12px;
}

.session-stat-value {
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
}

/* ===== 13. TOAST WITH PROGRESS ===== */
.toast-with-progress {
  position: relative;
  overflow: hidden;
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
}

.toast-progress-bar {
  height: 100%;
  background: currentColor;
  opacity: 0.5;
  animation: shrink var(--toast-duration, 3000ms) linear forwards;
}

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

/* ===== 14. BIN INFO TOOLTIP ===== */
.bin-info-tooltip {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  padding: 8px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 50;
  font-size: 10px;
  animation: fadeIn 0.2s ease;
}

.bin-info-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 0;
}

.bin-info-label {
  color: var(--text-muted);
}

.bin-info-value {
  color: var(--text-primary);
  font-weight: 500;
}

/* ===== 15. CONFETTI EFFECT ===== */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.confetti {
  position: absolute;
  width: 8px;
  height: 8px;
  animation: confettiFall 3s linear forwards;
}

@keyframes confettiFall {
  0% {
    transform: translateY(-10px) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 1024px) {
  .filter-btn-group {
    flex-wrap: wrap;
  }

  .stat-speed-value {
    font-size: 20px;
  }
}

@media (max-width: 768px) {
  .result-card {
    padding: 8px 12px;
  }

  .result-pan {
    font-size: 11px;
  }

  .result-badge {
    font-size: 8px;
    padding: 2px 5px;
  }

  .filter-btn {
    padding: 3px 8px;
    font-size: 9px;
  }

  .filter-btn .count {
    display: none;
  }

  .stat-speed-value {
    font-size: 18px;
  }

  .session-stat-row {
    padding: 4px 0;
  }

  .session-stat-label {
    font-size: 10px;
  }

  .session-stat-value {
    font-size: 11px;
  }

  .live-approved-item {
    padding: 5px 8px;
    font-size: 10px;
  }

  .export-dropdown-menu {
    min-width: 120px;
  }

  .export-dropdown-item {
    padding: 6px 8px;
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .result-card {
    padding: 6px 10px;
  }

  .result-card::before {
    width: 2px;
  }

  .result-pan {
    font-size: 10px;
  }

  .result-phone {
    font-size: 9px;
  }

  .result-badge {
    font-size: 7px;
    padding: 1px 4px;
  }

  .result-badge i {
    width: 8px;
    height: 8px;
  }

  .filter-btn-group {
    gap: 2px;
    padding: 2px;
  }

  .filter-btn {
    padding: 3px 6px;
    font-size: 8px;
  }

  .stat-speed-value {
    font-size: 16px;
  }

  .stat-eta {
    font-size: 12px;
  }

  .toast {
    font-size: 11px;
    padding: 10px 12px;
  }
}

