/**
 * Order Cancel Manager - Frontend Styles
 */

/* ========================================
   Countdown Timer Styles
   ======================================== */

.ocm-countdown-wrapper {
  margin-top: 8px;
  padding: 8px 12px;
  background: #f0f9ff;
  border-left: 3px solid #3b82f6;
  border-radius: 4px;
}

.ocm-countdown-label {
  display: block;
  font-weight: 600;
  color: #1e40af;
  margin-bottom: 4px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ocm-countdown {
  display: inline-block;
}

.ocm-timer {
  font-size: 16px;
  font-weight: bold;
  color: #059669;
  font-family: "Courier New", monospace;
}

.ocm-timer.expiring {
  color: #dc2626;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

/* Large countdown for order details page */
.ocm-countdown-large {
  text-align: center;
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 8px;
  margin: 20px 0;
}

.ocm-countdown-large p {
  color: #fff;
  margin: 0 0 10px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.ocm-timer-large {
  display: block;
  font-size: 48px;
  font-weight: bold;
  color: #fff;
  font-family: "Courier New", monospace;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* ========================================
   Modal Styles
   ======================================== */

.ocm-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999999;
}

.ocm-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.ocm-modal-content {
  position: relative;
  max-width: 600px;
  margin: 50px auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease-out;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.ocm-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 30px;
  border-bottom: 1px solid #e5e7eb;
}

.ocm-modal-header h2 {
  margin: 0;
  font-size: 24px;
  color: #1f2937;
}

.ocm-modal-close {
  background: none;
  border: none;
  font-size: 32px;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.ocm-modal-close:hover {
  background: #f3f4f6;
  color: #1f2937;
}

.ocm-modal-body {
  padding: 30px;
}

.ocm-form-group {
  margin-bottom: 20px;
}

.ocm-form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: #374151;
  font-size: 14px;
}

.ocm-form-group label .required {
  color: #dc2626;
}

.ocm-form-group select,
.ocm-form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.ocm-form-group select:focus,
.ocm-form-group textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.ocm-warning-box {
  background: #fef3c7;
  border: 2px solid #f59e0b;
  border-radius: 6px;
  padding: 15px;
  margin: 20px 0;
  font-size: 14px;
  line-height: 1.6;
  color: #92400e;
}

.ocm-warning-box strong {
  display: block;
  margin-bottom: 5px;
  color: #b45309;
}

.ocm-modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

.ocm-modal-footer .button {
  padding: 12px 24px;
  font-size: 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 600;
}

.ocm-modal-cancel {
  background: #e5e7eb;
  color: #374151;
}

.ocm-modal-cancel:hover {
  background: #d1d5db;
}

.ocm-submit-cancel {
  background: #dc2626 !important;
  color: #fff !important;
}

.ocm-submit-cancel:hover {
  background: #b91c1c !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.ocm-submit-cancel:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ========================================
   Order Details Notice
   ======================================== */

.ocm-order-details-notice {
  margin-bottom: 30px;
}

.ocm-notice-box {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 25px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.ocm-notice-box h3 {
  margin: 0 0 15px;
  color: #fff;
  font-size: 22px;
}

.ocm-notice-box p {
  margin: 0 0 20px;
  font-size: 16px;
  opacity: 0.95;
}

.ocm-notice-box .button {
  background: #fff;
  color: #667eea;
  padding: 12px 30px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 10px;
}

.ocm-notice-box .button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* ========================================
   Result Messages
   ======================================== */

.ocm-result-message {
  padding: 15px 20px;
  border-radius: 6px;
  margin-top: 20px;
  font-size: 14px;
  line-height: 1.6;
}

.ocm-result-message.success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #10b981;
}

.ocm-result-message.error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #ef4444;
}

/* ========================================
   Guest Cancellation Page
   ======================================== */

.ocm-guest-page {
  padding: 40px 20px;
  max-width: 800px;
  margin: 0 auto;
}

.ocm-container h1 {
  font-size: 32px;
  margin-bottom: 30px;
  color: #1f2937;
}

.ocm-order-info {
  background: #f9fafb;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 30px;
  border: 1px solid #e5e7eb;
}

.ocm-order-info h2 {
  margin: 0 0 15px;
  font-size: 20px;
  color: #111827;
}

.ocm-order-info p {
  margin: 8px 0;
  font-size: 14px;
  color: #6b7280;
}

.ocm-cancel-form {
  background: #fff;
  padding: 30px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.ocm-error-box {
  background: #fee2e2;
  border: 2px solid #ef4444;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
}

.ocm-error-box p {
  margin: 10px 0;
  color: #991b1b;
}

/* ========================================
   Cancel Button in Orders Table
   ======================================== */

.woocommerce-orders-table__cell-order-actions .ocm-cancel-btn {
  background: #dc2626 !important;
  color: #fff !important;
  border-radius: 4px;
  padding: 8px 16px;
  font-size: 13px;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s;
}

.woocommerce-orders-table__cell-order-actions .ocm-cancel-btn:hover {
  background: #b91c1c !important;
  transform: translateY(-1px);
}

/* ========================================
   Loading Spinner
   ======================================== */

.ocm-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.6;
}

.ocm-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
  .ocm-modal-content {
    margin: 20px;
    max-height: calc(100vh - 40px);
  }

  .ocm-modal-header,
  .ocm-modal-body {
    padding: 20px;
  }

  .ocm-timer-large {
    font-size: 36px;
  }

  .ocm-modal-footer {
    flex-direction: column;
  }

  .ocm-modal-footer .button {
    width: 100%;
  }
}
