/* ==========================================
   SEKCJA: WPŁATY W CZASIE RZECZYWISTYM
   ========================================== */

.payments-live-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 80px 0;
  position: relative;
  overflow: hidden;
}

.payments-live-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.payments-live-section .section-header {
  position: relative;
  z-index: 1;
}

.payments-live-section .section-label {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  backdrop-filter: blur(10px);
}

.payments-live-section .section-title {
  color: white;
}

.payments-live-section .section-subtitle {
  color: rgba(255, 255, 255, 0.95);
}

/* Nagłówek z przyciskiem odświeżania */
.payments-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.payments-stats {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.payments-stat-item {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  padding: 12px 20px;
  border-radius: 12px;
  color: white;
  font-size: 0.9375rem;
  font-weight: 600;
}

.payments-stat-item .stat-icon {
  margin-right: 8px;
  font-size: 1.125rem;
}

.payments-controls {
  display: flex;
  gap: 12px;
}

.payments-refresh-btn {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.payments-refresh-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.payments-refresh-btn .refresh-icon {
  font-size: 1.125rem;
}

/* Kontener z wpłatami */
.payments-container {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  max-height: 600px;
  overflow-y: auto;
  position: relative;
}

/* Custom scrollbar */
.payments-container::-webkit-scrollbar {
  width: 8px;
}

.payments-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.payments-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 10px;
}

.payments-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* Lista wpłat */
#payments-live-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Pojedyncza wpłata */
.payment-item {
  background: white;
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.payment-item:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.payment-avatar {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-light);
}

.payment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.payment-details {
  flex: 1;
  min-width: 0;
}

.payment-user {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.payment-comment {
  font-size: 0.875rem;
  color: var(--text-light);
  font-style: italic;
  margin: 4px 0;
  line-height: 1.4;
}

.payment-time {
  font-size: 0.8125rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.time-icon {
  font-size: 0.875rem;
}

.payment-amount {
  flex-shrink: 0;
  text-align: right;
}

.amount-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-text);
  line-height: 1;
}

.amount-currency {
  display: block;
  font-size: 0.875rem;
  color: var(--text-light);
  margin-top: 2px;
}

/* Przycisk "Załaduj więcej" */
.payments-load-more {
  text-align: center;
  margin-top: 24px;
}

.load-more-btn {
  background: white;
  color: var(--primary-text);
  border: 2px solid white;
  padding: 12px 32px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.load-more-btn:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* Loader */
.payments-loader {
  display: none;
  justify-content: center;
  align-items: center;
  padding: 40px;
  color: white;
  font-size: 1.125rem;
}

.loader-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Błąd */
.payments-error {
  display: none;
  background: rgba(255, 107, 107, 0.2);
  border: 2px solid rgba(255, 107, 107, 0.5);
  color: white;
  padding: 16px;
  border-radius: 12px;
  text-align: center;
  margin-top: 16px;
}

/* Brak wpłat */
.no-payments {
  text-align: center;
  padding: 60px 20px;
  color: white;
  font-size: 1.125rem;
  opacity: 0.7;
}

/* Info o auto-refresh */
.payments-info {
  text-align: center;
  margin-top: 24px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.875rem;
}

.payments-info .info-icon {
  margin-right: 6px;
}

/* Responsive */
@media (max-width: 968px) {
  .payments-header {
    flex-direction: column;
    align-items: stretch;
  }

  .payments-stats {
    justify-content: center;
  }

  .payments-controls {
    justify-content: center;
  }

  .payments-container {
    padding: 20px;
    max-height: 500px;
  }

  .payment-item {
    padding: 12px 16px;
  }

  .amount-value {
    font-size: 1.25rem;
  }
}

@media (max-width: 640px) {
  .payments-live-section {
    padding: 60px 0;
  }

  .payment-item {
    flex-wrap: wrap;
    gap: 12px;
  }

  .payment-avatar {
    width: 40px;
    height: 40px;
  }

  .payment-amount {
    width: 100%;
    text-align: left;
    padding-top: 8px;
    border-top: 1px solid var(--bg-light);
  }

  .payments-container {
    padding: 16px;
    max-height: 400px;
  }

  .payments-stat-item {
    font-size: 0.875rem;
    padding: 10px 16px;
  }
}
