/* Estilos para el frontend del plugin */

/* Formulario de cupones */
.wcs-coupon-form {
  max-width: 400px;
  margin: 20px 0;
  padding: 20px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wcs-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.wcs-form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.wcs-form-group label {
  font-weight: 600;
  color: #333;
}

.wcs-form-group input {
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  transition: border-color 0.2s ease;
}

.wcs-form-group input:focus {
  outline: none;
  border-color: #2271b1;
  box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.1);
}

/* Botones */
.wcs-btn {
  display: inline-block;
  padding: 12px 24px;
  border: none;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  font-size: 16px;
}

.wcs-btn-primary {
  background: #2271b1;
  color: #fff;
}

.wcs-btn-primary:hover {
  background: #135e96;
  color: #fff;
  transform: translateY(-1px);
}

.wcs-btn-success {
  background: #00a32a;
  color: #fff;
}

.wcs-btn-success:hover {
  background: #008a20;
  color: #fff;
  transform: translateY(-1px);
}

/* Mensajes */
.wcs-message {
  padding: 12px 16px;
  border-radius: 4px;
  margin-top: 15px;
  font-weight: 500;
}

.wcs-message.success {
  background: #d1e7dd;
  color: #0f5132;
  border: 1px solid #badbcc;
}

.wcs-message.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c2c7;
}

.wcs-message.loading {
  background: #cff4fc;
  color: #055160;
  border: 1px solid #b6effb;
}

/* Formulario de canje */
.wcs-redeem-form {
  max-width: 500px;
  margin: 20px 0;
  padding: 25px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.wcs-redeem-form h3 {
  margin-top: 0;
  margin-bottom: 20px;
  color: #333;
  text-align: center;
}

/* Información de promoción */
.wcs-promotion-info {
  padding: 20px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 8px;
  margin: 20px 0;
  border-left: 4px solid #2271b1;
}

.wcs-promotion-info h3 {
  margin-top: 0;
  margin-bottom: 10px;
  color: #2271b1;
  font-size: 1.5em;
}

.wcs-promotion-info p {
  margin-bottom: 15px;
  color: #555;
  line-height: 1.6;
}

.wcs-promotion-details {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.wcs-discount {
  background: #00a32a;
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.9em;
}

.wcs-expiry {
  background: #f8f9fa;
  color: #6c757d;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9em;
  border: 1px solid #dee2e6;
}

/* Loading spinner */
.wcs-loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #2271b1;
  border-radius: 50%;
  animation: wcs-spin 1s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
  .wcs-coupon-form,
  .wcs-redeem-form {
    max-width: 100%;
    margin: 15px 0;
    padding: 15px;
  }

  .wcs-promotion-details {
    flex-direction: column;
    gap: 10px;
  }

  .wcs-discount,
  .wcs-expiry {
    text-align: center;
  }
}

/* Animaciones */
.wcs-form {
  animation: wcs-fadeIn 0.3s ease-in;
}

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

/* Estados de botón */
.wcs-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

.wcs-btn.loading {
  position: relative;
  color: transparent;
}

.wcs-btn.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: wcs-spin 1s linear infinite;
}
