/* ========================================
   TourSure Order Management - Airbnb Style
   ======================================== */

/* Container */
.toursure-order-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Header */
.toursure-order-header {
  margin-bottom: 32px;
}

.toursure-order-header h2 {
  margin: 0 0 24px;
  font-size: 32px;
  font-weight: 700;
  color: #222222;
  letter-spacing: -0.5px;
}

/* Filter Buttons Wrapper - Split into 2 Groups */
.toursure-order-filters-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

/* Filter Button Groups */
.toursure-order-filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.toursure-order-filters-type {
  justify-content: flex-start;
}

.toursure-order-filters-payment {
  justify-content: flex-end;
}

.toursure-filter-btn {
  padding: 10px 20px;
  background-color: #ffffff;
  border: 1px solid #dddddd;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  color: #222222;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.toursure-filter-btn:hover {
  border-color: #222222;
  background-color: #f7f7f7;
}

.toursure-filter-btn.active {
  background: linear-gradient(135deg, #4c1d95 0%, #581c87 100%);
  border-color: #4c1d95;
  color: #ffffff;
}

/* Payment filter buttons - Yellow theme */
.toursure-order-filters-payment .toursure-filter-btn {
  background-color: #ffffff;
  border-color: #f59e0b;
  color: #92400e;
}

.toursure-order-filters-payment .toursure-filter-btn:hover {
  border-color: #d97706;
  background-color: #fef3c7;
}

.toursure-order-filters-payment .toursure-filter-btn.active {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  border-color: #f59e0b;
  color: #1f2937;
  font-weight: 700;
}

/* Loading State */
.toursure-order-loading {
  text-align: center;
  padding: 60px 20px;
}

.toursure-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #4c1d95;
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: toursure-spin 1s linear infinite;
}

@keyframes toursure-spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.toursure-order-loading p {
  margin: 0;
  font-size: 16px;
  color: #717171;
}

/* Empty State */
.toursure-order-empty {
  text-align: center;
  padding: 80px 20px;
  background-color: #f7f7f7;
  border-radius: 16px;
}

.toursure-order-empty p {
  margin: 0;
  font-size: 18px;
  color: #717171;
}

/* Error State */
.toursure-order-error {
  text-align: center;
  padding: 40px 20px;
  background-color: #fff5f5;
  border: 1px solid #feb2b2;
  border-radius: 12px;
}

.toursure-order-error p {
  margin: 0;
  color: #c53030;
  font-size: 16px;
}

/* Order List Grid - 4 Columns */
.toursure-order-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

@media (max-width: 1200px) {
  .toursure-order-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .toursure-order-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .toursure-order-list {
    grid-template-columns: 1fr;
  }
}

/* Order Card - Airbnb Style - Reduced 20% */
.toursure-order-card {
  background-color: #ffffff;
  border: 1px solid #ebebeb;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s ease;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.toursure-order-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border-color: #dddddd;
}

/* Disabled Card State */
.toursure-order-card.disabled {
  opacity: 0.6;
  filter: grayscale(100%);
  cursor: not-allowed;
  pointer-events: none;
}

.toursure-order-card.disabled:hover {
  transform: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-color: #ebebeb;
}

/* Card Header - Reduced 20% */
.toursure-order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
  border-bottom: 1px solid #ebebeb;
}

.toursure-order-type-badge {
  display: inline-block;
  padding: 5px 11px;
  background: linear-gradient(135deg, #4c1d95 0%, #581c87 100%);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.toursure-order-date {
  font-size: 11px;
  font-weight: 600;
  color: #717171;
}

/* Card Body - Reduced 20% */
.toursure-order-card-body {
  padding: 16px;
}

.toursure-order-service-name {
  margin: 0 0 16px;
  font-size: 14px;
  font-weight: 700;
  color: #222222;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Order Details - Reduced 20% */
.toursure-order-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toursure-order-detail-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #484848;
  line-height: 1.4;
}

.toursure-order-detail-item .toursure-icon {
  flex-shrink: 0;
  color: #717171;
  width: 13px;
  height: 13px;
}

.toursure-order-detail-item span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Card Footer - Reduced 20% */
.toursure-order-card-footer {
  padding: 12px 16px;
  background-color: #f9fafb;
  border-top: 1px solid #ebebeb;
}

.toursure-order-status-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Status Badges - Reduced 20% */
.toursure-order-status,
.toursure-order-payment {
  display: inline-block;
  padding: 5px 10px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 12px;
  text-align: center;
  white-space: nowrap;
}

/* Order Status Colors */
.toursure-order-status.status-new {
  background-color: #e0e7ff;
  color: #4338ca;
}

.toursure-order-status.status-contacted {
  background-color: #dbeafe;
  color: #1e40af;
}

.toursure-order-status.status-follow_up {
  background-color: #fef3c7;
  color: #92400e;
}

.toursure-order-status.status-closed {
  background-color: #d1fae5;
  color: #065f46;
}

.toursure-order-status.status-cancelled {
  background-color: #fee2e2;
  color: #991b1b;
}

/* Payment Status Colors */
.toursure-order-payment.payment-wait,
.toursure-order-payment.payment-pending {
  background-color: #fef3c7;
  color: #92400e;
}

.toursure-order-payment.payment-pay,
.toursure-order-payment.payment-paid {
  background-color: #d1fae5;
  color: #065f46;
}

.toursure-order-payment.payment-cancelled {
  background-color: #fee2e2;
  color: #991b1b;
}

/* Login Required */
.toursure-order-login-required {
  text-align: center;
  padding: 80px 20px;
  background-color: #f7f7f7;
  border-radius: 16px;
}

.toursure-order-login-required p {
  margin: 0;
  font-size: 18px;
  color: #717171;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .toursure-order-container {
    padding: 20px;
  }

  .toursure-order-header h2 {
    font-size: 28px;
  }

  .toursure-order-list {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .toursure-order-container {
    padding: 16px;
  }

  .toursure-order-header h2 {
    font-size: 24px;
    margin-bottom: 20px;
  }

  .toursure-order-filters-wrapper {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .toursure-order-filters {
    gap: 8px;
    justify-content: center;
  }

  .toursure-order-filters-type,
  .toursure-order-filters-payment {
    justify-content: center;
  }

  .toursure-filter-btn {
    padding: 8px 16px;
    font-size: 13px;
  }

  .toursure-order-list {
    gap: 16px;
  }

  .toursure-order-card-body {
    padding: 16px;
  }

  .toursure-order-service-name {
    font-size: 16px;
  }

  .toursure-order-detail-item {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .toursure-order-header h2 {
    font-size: 22px;
  }

  .toursure-order-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .toursure-order-status-group {
    flex-direction: column;
    gap: 6px;
  }

  .toursure-order-status,
  .toursure-order-payment {
    width: 100%;
  }
}

/* ========================================
   Payment Slip Upload Modal
   ======================================== */

/* Make payment button clickable */
.toursure-order-payment.clickable {
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.toursure-order-payment.clickable:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.toursure-order-payment.clickable::after {
  content: ' \2191';
  font-size: 10px;
  margin-left: 4px;
}

/* Modal Overlay */
.toursure-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toursure-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

/* Modal Content */
.toursure-modal-content {
  position: relative;
  background: #ffffff;
  border-radius: 16px;
  max-width: 500px;
  width: calc(100% - 32px);
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  padding: 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  z-index: 1;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Modal Header */
.toursure-modal-content h3 {
  margin: 0 0 12px;
  font-size: 24px;
  font-weight: 700;
  color: #222222;
}

.toursure-modal-desc {
  margin: 0 0 24px;
  font-size: 14px;
  color: #717171;
  line-height: 1.6;
}

/* Close Button */
.toursure-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: #f7f7f7;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  color: #717171;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toursure-modal-close:hover {
  background: #ebebeb;
  color: #222222;
  transform: rotate(90deg);
}

/* Form */
#toursure-payment-slip-form {
  margin-bottom: 20px;
}

.toursure-payment-form-group {
  margin-bottom: 20px;
}

.toursure-payment-form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #222222;
}

.toursure-payment-form-group label .required {
  color: #dc2626;
}

.toursure-payment-form-group input[type="file"] {
  width: 100%;
  padding: 12px;
  border: 2px dashed #dddddd;
  border-radius: 12px;
  font-size: 14px;
  color: #484848;
  background: #f7f7f7;
  cursor: pointer;
  transition: all 0.2s ease;
}

.toursure-payment-form-group input[type="file"]:hover {
  border-color: #4c1d95;
  background: #ffffff;
}

.toursure-payment-form-group input[type="file"]:focus {
  outline: none;
  border-color: #4c1d95;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(76, 29, 149, 0.1);
}

.toursure-payment-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #717171;
}

/* Payment Message */
.toursure-payment-message {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
}

.toursure-payment-message.error {
  background: #fee2e2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.toursure-payment-message.success {
  background: #d1fae5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

/* Form Actions */
.toursure-payment-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.toursure-payment-cancel,
.toursure-payment-submit {
  flex: 1;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.toursure-payment-cancel {
  background: #f7f7f7;
  color: #717171;
}

.toursure-payment-cancel:hover {
  background: #ebebeb;
  color: #222222;
}

.toursure-payment-submit {
  background: linear-gradient(135deg, #4c1d95 0%, #581c87 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(76, 29, 149, 0.3);
}

.toursure-payment-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(76, 29, 149, 0.4);
}

.toursure-payment-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Payment Notice */
.toursure-payment-notice {
  padding: 16px;
  background: #fef3c7;
  border-left: 4px solid #f59e0b;
  border-radius: 8px;
  font-size: 13px;
  color: #92400e;
  line-height: 1.6;
}

.toursure-payment-notice p {
  margin: 0;
}

.toursure-payment-notice strong {
  font-weight: 700;
}

/* Body Lock when Modal Open */
body.toursure-modal-open {
  overflow: hidden;
}

/* Responsive */
@media (max-width: 480px) {
  .toursure-modal-content {
    padding: 24px;
    max-width: calc(100% - 24px);
  }

  .toursure-modal-content h3 {
    font-size: 20px;
  }

  .toursure-payment-actions {
    flex-direction: column;
  }

  .toursure-payment-cancel,
  .toursure-payment-submit {
    width: 100%;
  }
}
