/**
 * Estilos para sistema de cupones
 * WC Rewards Plugin
 */

/* ============================
   SECCIÓN DE CUPONES
   ============================ */

.wc-rewards-coupons-section {
  margin-top: 30px;
}

.wc-rewards-coupons-section h3 {
  font-size: 22px;
  margin-bottom: 15px;
  color: #333;
}

.wc-rewards-coupons-section h4 {
  font-size: 18px;
  margin: 25px 0 15px;
  color: #333;
  border-bottom: 2px solid #667eea;
  padding-bottom: 10px;
}

.wc-rewards-separator {
  border: 0;
  border-top: 2px solid #e0e0e0;
  margin: 30px 0;
}

/* ============================
   GENERADOR DE CUPONES
   ============================ */

.wc-rewards-coupon-generator {
  background: #ffffff;
  border-radius: 8px;
  padding: 25px;
  margin-bottom: 30px;
}

.wc-rewards-coupon-info {
  margin-bottom: 20px;
}

.wc-rewards-info-text {
  font-size: 15px;
  color: #495057;
  margin-bottom: 10px;
}

.wc-rewards-min-info,
.wc-rewards-max-info {
  font-size: 14px;
  color: #6c757d;
  margin: 5px 0;
}

.wc-rewards-min-info strong,
.wc-rewards-max-info strong {
  color: #667eea;
}

/* ============================
   FORMULARIO
   ============================ */

.wc-rewards-coupon-form {
  background: #ffffff;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  padding: 20px;
}

.wc-rewards-form-row {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.wc-rewards-form-row label {
  font-weight: 600;
  color: #333;
  min-width: 140px;
}

.wc-rewards-form-row input[type="number"] {
  flex: 1;
  max-width: 200px;
  padding: 10px 15px;
  border: 2px solid #ced4da;
  border-radius: 5px;
  font-size: 16px;
  transition: border-color 0.3s;
}

.wc-rewards-form-row input[type="number"]:focus {
  outline: none;
  border-color: #667eea;
}

.wc-rewards-coupon-value {
  font-size: 18px;
  color: #28a745;
  font-weight: 600;
}

.wc-rewards-form-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.wc-rewards-generate-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff !important;
  border: none;
  padding: 12px 30px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 5px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.wc-rewards-generate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.wc-rewards-generate-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.wc-rewards-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* ============================
   MENSAJES
   ============================ */

.wc-rewards-coupon-message {
  margin-top: 20px;
  padding: 15px;
  border-radius: 5px;
  font-size: 14px;
}

.wc-rewards-coupon-message.wc-rewards-success {
  background: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
}

.wc-rewards-coupon-message.wc-rewards-success code {
  background: #fff;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 16px;
  font-weight: 700;
  color: #667eea;
}

.wc-rewards-coupon-message.wc-rewards-error {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
}

.wc-rewards-insufficient-points {
  background: #fff3cd;
  border: 2px solid #ffc107;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
}

.wc-rewards-insufficient-points p {
  margin-bottom: 15px;
  color: #856404;
}

/* ============================
   TABLA DE CUPONES
   ============================ */

.wc-rewards-coupons-list {
  margin: 25px 0;
}

.wc-rewards-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 1px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.wc-rewards-table thead {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}

.wc-rewards-table th {
  padding: 15px;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wc-rewards-table td {
  padding: 15px;
  border-bottom: 1px solid #e9ecef;
}

.wc-rewards-table tbody tr:last-child td {
  border-bottom: none;
}

.wc-rewards-table tbody tr:hover {
  background: #f8f9fa;
}

.wc-rewards-coupon-code {
  background: #f8f9fa;
  padding: 5px 10px;
  border-radius: 4px;
  font-family: "Courier New", monospace;
  font-size: 14px;
  font-weight: 600;
  color: #667eea;
  border: 1px solid #dee2e6;
}

.wc-rewards-expiring-soon {
  color: #dc3545;
  font-weight: 600;
}

.wc-rewards-status-used {
  display: inline-block;
  padding: 4px 12px;
  background: #6c757d;
  color: #fff;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.wc-rewards-copy-coupon {
  background: #667eea;
  color: #fff !important;
  border: none;
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s;
}

.wc-rewards-copy-coupon:hover {
  background: #5568d3;
}

.coupon-active {
  background: #ffffff;
}

.coupon-used {
  opacity: 0.7;
}

.coupon-expired {
  opacity: 0.6;
  background: #fff5f5;
}

/* ============================
   RESPONSIVE
   ============================ */

@media (max-width: 768px) {
  .wc-rewards-coupon-generator {
    padding: 15px;
  }

  .wc-rewards-form-row {
    flex-direction: column;
    align-items: stretch;
  }

  .wc-rewards-form-row label {
    min-width: auto;
  }

  .wc-rewards-form-row input[type="number"] {
    max-width: 100%;
  }

  .wc-rewards-table {
    font-size: 14px;
  }

  .wc-rewards-table th,
  .wc-rewards-table td {
    padding: 10px 8px;
  }

  .wc-rewards-table thead {
    display: none;
  }

  .wc-rewards-table tbody tr {
    display: block;
    margin-bottom: 15px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
  }

  .wc-rewards-table td {
    display: block;
    text-align: right;
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
  }

  .wc-rewards-table td:last-child {
    border-bottom: none;
  }

  .wc-rewards-table td::before {
    content: attr(data-label);
    float: left;
    font-weight: 600;
    color: #667eea;
  }

  .wc-rewards-coupon-code {
    font-size: 12px;
  }
}

/* ============================
   ANIMACIONES
   ============================ */

.wc-rewards-coupons-list {
  animation: fadeIn 0.5s ease-out;
}

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

.wc-rewards-coupon-row {
  transition: background-color 0.3s;
}
