/* ===================================
   MODAL DE PAGAMENTO PIX - PAGBANK
   Estilos modernos e responsivos
   =================================== */

/* Botão de Pagamento */
.payment-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 2px solid #f3f4f6;
  text-align: center;
}

.btn-pay-pix {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 16px 32px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 auto;
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
  position: relative;
  overflow: hidden;
}

.btn-pay-pix::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.btn-pay-pix:hover:not(:disabled)::before {
  left: 100%;
}

.btn-pay-pix:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(16, 185, 129, 0.4);
}

.btn-pay-pix:disabled {
  background: #d1d5db;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.payment-info-text {
  margin-top: 12px;
  color: #6b7280;
  font-size: 14px;
  font-weight: 500;
}

/* Modal de Pagamento */
.payment-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5000;
  backdrop-filter: blur(8px);
  animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    backdrop-filter: blur(0);
  }
  to {
    opacity: 1;
    backdrop-filter: blur(8px);
  }
}

.payment-modal-content {
  background: white;
  border-radius: 20px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Header do Modal */
.payment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 24px 20px;
  border-bottom: 1px solid #f3f4f6;
}

.payment-header h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: #1f2937;
}

.close-modal-btn {
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-modal-btn:hover {
  background: #f3f4f6;
  color: #374151;
  transform: rotate(90deg);
}

/* Body do Modal */
.payment-body {
  padding: 24px;
}

/* Informações do Pagamento */
.payment-info {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
  border: 1px solid #bbf7d0;
}

.payment-amount-display,
.payment-reference-display,
.payment-timer-display {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.payment-info > div:last-child {
  border-bottom: none;
}

.payment-label {
  font-size: 14px;
  color: #059669;
  font-weight: 600;
}

.payment-value {
  font-size: 24px;
  font-weight: 800;
  color: #047857;
}

.payment-reference {
  font-size: 16px;
  font-weight: 700;
  color: #047857;
  font-family: 'Courier New', monospace;
}

.payment-timer {
  font-size: 20px;
  font-weight: 700;
  color: #dc2626;
  font-family: 'Courier New', monospace;
}

/* QR Code Section */
.qr-code-section {
  text-align: center;
  margin-bottom: 24px;
}

.qr-code-section h4 {
  margin: 0 0 16px 0;
  font-size: 18px;
  font-weight: 600;
  color: #374151;
}

.qr-code-container {
  position: relative;
  display: inline-block;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  background: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.qr-code-container.loaded {
  border-color: #10b981;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.qr-code-container.error {
  border-color: #ef4444;
  background: #fef2f2;
}

#qrCodeImage {
  width: 256px;
  height: 256px;
  border-radius: 8px;
  display: block;
}

.qr-code-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 10px;
}

.qr-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e5e7eb;
  border-top: 3px solid #10b981;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 12px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Chave Pix Section */
.pix-key-section {
  margin-bottom: 24px;
}

.pix-key-section h4 {
  margin: 0 0 12px 0;
  font-size: 18px;
  font-weight: 600;
  color: #374151;
  text-align: center;
}

.pix-key-container {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.pix-key-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Courier New', monospace;
  background: #f9fafb;
  color: #374151;
  transition: all 0.3s ease;
}

.pix-key-input:focus {
  outline: none;
  border-color: #10b981;
  background: white;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.copy-pix-btn {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.copy-pix-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.copy-pix-btn:active {
  transform: translateY(0);
}

/* Status do Pagamento */
.payment-status {
  text-align: center;
  padding: 24px;
  background: #f9fafb;
  border-radius: 12px;
  margin-bottom: 24px;
  border: 1px solid #e5e7eb;
}

.status-pending svg {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.payment-status h4 {
  margin: 12px 0 8px 0;
  font-size: 20px;
  font-weight: 700;
  color: #374151;
}

.payment-status p {
  margin: 0;
  color: #6b7280;
  font-size: 14px;
  line-height: 1.5;
}

.payment-success {
  text-align: center;
  padding: 24px;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-radius: 12px;
  border: 2px solid #10b981;
}

.payment-success h4 {
  color: #047857;
  margin: 12px 0 8px 0;
}

.payment-success p {
  color: #059669;
}

.payment-expired {
  text-align: center;
  padding: 24px;
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border-radius: 12px;
  border: 2px solid #ef4444;
}

.payment-expired h4 {
  color: #dc2626;
  margin: 12px 0 8px 0;
}

.payment-expired p {
  color: #b91c1c;
}

.btn-close {
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 12px;
}

.btn-close:hover {
  background: #dc2626;
  transform: translateY(-2px);
}

/* Instruções */
.payment-instructions {
  background: #f8fafc;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #e2e8f0;
}

.payment-instructions h4 {
  margin: 0 0 16px 0;
  font-size: 18px;
  font-weight: 600;
  color: #374151;
}

.payment-instructions ol {
  margin: 0;
  padding-left: 20px;
  color: #4b5563;
  line-height: 1.6;
}

.payment-instructions li {
  margin-bottom: 8px;
}

.payment-instructions li:last-child {
  margin-bottom: 0;
}

/* Loading de Pagamento */
.payment-loading {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 6000;
  backdrop-filter: blur(8px);
}

.payment-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.payment-loading span {
  color: white;
  font-size: 18px;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Responsividade */
@media (max-width: 768px) {
  .payment-modal-content {
    width: 95%;
    max-height: 95vh;
    margin: 10px;
  }
  
  .payment-header {
    padding: 20px 20px 16px;
  }
  
  .payment-header h3 {
    font-size: 20px;
  }
  
  .payment-body {
    padding: 20px;
  }
  
  .payment-info {
    padding: 16px;
  }
  
  .payment-value {
    font-size: 20px;
  }
  
  .payment-timer {
    font-size: 18px;
  }
  
  .qr-code-container {
    padding: 12px;
  }
  
  #qrCodeImage {
    width: 200px;
    height: 200px;
  }
  
  .pix-key-container {
    flex-direction: column;
    gap: 12px;
  }
  
  .copy-pix-btn {
    justify-content: center;
  }
  
  .payment-instructions {
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .payment-modal-content {
    width: 98%;
    margin: 5px;
  }
  
  .payment-header {
    padding: 16px 16px 12px;
  }
  
  .payment-header h3 {
    font-size: 18px;
  }
  
  .payment-body {
    padding: 16px;
  }
  
  .payment-info {
    padding: 12px;
  }
  
  .payment-value {
    font-size: 18px;
  }
  
  .payment-reference {
    font-size: 14px;
  }
  
  .payment-timer {
    font-size: 16px;
  }
  
  .qr-code-container {
    padding: 8px;
  }
  
  #qrCodeImage {
    width: 180px;
    height: 180px;
  }
  
  .payment-status {
    padding: 16px;
  }
  
  .payment-status h4 {
    font-size: 18px;
  }
  
  .payment-instructions {
    padding: 12px;
  }
  
  .payment-instructions h4 {
    font-size: 16px;
  }
  
  .payment-instructions ol {
    font-size: 14px;
  }
}

/* Animações de Entrada */
.payment-modal {
  animation: modalFadeIn 0.3s ease-out;
}

.payment-modal-content {
  animation: modalSlideIn 0.3s ease-out;
}

/* Focus States */
.btn-pay-pix:focus,
.copy-pix-btn:focus,
.close-modal-btn:focus,
.btn-close:focus {
  outline: 2px solid #10b981;
  outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .payment-modal-content {
    background: #fff;
    border: 2px solid #000;
  }
  
  .btn-pay-pix {
    background: #000;
    color: #fff;
    border: 2px solid #fff;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .payment-modal,
  .payment-modal-content {
    animation: none;
  }
  
  .qr-spinner,
  .payment-spinner {
    animation: none;
  }
  
  .status-pending svg {
    animation: none;
  }
  
  .btn-pay-pix:hover,
  .copy-pix-btn:hover {
    transform: none;
  }
}
