/**
 * Estilos para o Modal de Teste
 * Integração com API WPlay
 */

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: modalFadeIn 0.3s ease-in-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Modal Content */
.modal-content {
  background: white;
  border-radius: 10px;
  padding: 40px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: modalSlideUp 0.3s ease-out;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

@keyframes modalSlideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #666;
  transition: color 0.3s ease;
}

.modal-close:hover {
  color: #000;
}

/* Modal Headers */
.modal-content h2 {
  margin: 0 0 10px 0;
  font-size: 24px;
  color: #222;
  font-weight: 600;
}

.modal-content > p {
  color: #666;
  margin-bottom: 25px;
  font-size: 14px;
}

/* Credentials Box */
.credentials-box {
  background: #f9f9f9;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  border-left: 4px solid #16c01f;
}

.credential-item {
  margin-bottom: 20px;
}

.credential-item:last-child {
  margin-bottom: 0;
}

.credential-item label {
  display: block;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
  font-size: 14px;
}

.credential-item p {
  margin: 0;
  padding: 10px 12px;
  background: white;
  border-radius: 4px;
  color: #666;
  font-family: 'Courier New', monospace;
  word-break: break-all;
}

.credential-value {
  display: flex;
  align-items: center;
  gap: 10px;
}

.credential-value input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  background: white;
  cursor: text;
  user-select: all;
  font-size: 14px;
}

.credential-value button {
  padding: 8px 16px;
  background: #16c01f;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: background 0.3s ease;
  white-space: nowrap;
}

.credential-value button:hover {
  background: #13a01a;
}

/* Form Styles */
.modal-form {
  max-width: 400px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
  font-size: 14px;
}

.form-control {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  font-family: 'Poppins', sans-serif;
  transition: border-color 0.3s ease;
  box-sizing: border-box;
}

.form-control:focus {
  outline: none;
  border-color: #16c01f;
  box-shadow: 0 0 0 2px rgba(22, 192, 31, 0.1);
}

.form-control::placeholder {
  color: #999;
}

/* Modal Actions */
.modal-actions {
  display: flex;
  gap: 10px;
  margin: 25px 0 15px 0;
}

.modal-actions-stack {
  flex-direction: column;
}

.modal-result .modal-actions-stack a {
  width: 100%;
}

.modal-actions button,
.modal-actions a {
  flex: 1;
  padding: 12px 20px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-primary {
  background: #16c01f;
  color: white;
}

.btn-primary:hover {
  background: #13a01a;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(22, 192, 31, 0.3);
}

.btn-secondary {
  background: #f0f0f0;
  color: #333;
}

.btn-secondary:hover {
  background: #e0e0e0;
}

/* Modal Info */
.modal-info {
  background: #e8f5e9;
  border-left: 4px solid #16c01f;
  padding: 12px;
  border-radius: 4px;
  font-size: 12px;
  color: #2e7d32;
  margin: 0;
}

/* Responsivo */
@media (max-width: 600px) {
  .modal-content {
    padding: 25px;
    width: 95%;
  }

  .modal-content h2 {
    font-size: 20px;
  }

  .modal-actions {
    flex-direction: column;
  }

  .credential-value {
    flex-direction: column;
    align-items: stretch;
  }

  .credential-value input {
    width: 100%;
  }

  .credential-value button {
    width: 100%;
  }
}

/* Loading State */
.modal-content.loading {
  opacity: 0.5;
  pointer-events: none;
}

.modal-content.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 4px solid #f0f0f0;
  border-top-color: #16c01f;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}
