/* TourSure Tour List Styles */


:root {
  --tsl-primary: #5B21B6;
  --tsl-primary-light: #7C3AED;
  --tsl-primary-dark: #4C1D95;
  --tsl-secondary: #EC4899;
  --tsl-success: #10B981;
  --tsl-warning: #F59E0B;
  --tsl-danger: #EF4444;
  --tsl-info: #3B82F6;
  --tsl-gray-50: #F9FAFB;
  --tsl-gray-100: #F3F4F6;
  --tsl-gray-200: #E5E7EB;
  --tsl-gray-300: #D1D5DB;
  --tsl-gray-400: #9CA3AF;
  --tsl-gray-500: #6B7280;
  --tsl-gray-600: #4B5563;
  --tsl-gray-700: #374151;
  --tsl-gray-800: #1F2937;
  --tsl-gray-900: #111827;
  --tsl-radius: 8px;
  --tsl-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --tsl-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --tsl-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.tsl-container {
  max-width: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--tsl-gray-900);
}

/* Header */
.tsl-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--tsl-gray-200);
}

.tsl-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--tsl-gray-900);
  margin: 0;
}

.tsl-stats {
  display: flex;
  gap: 24px;
}

.tsl-stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tsl-stat-label {
  color: var(--tsl-gray-500);
  font-size: 14px;
}

.tsl-stat-value {
  font-weight: 600;
  color: var(--tsl-primary);
  font-size: 18px;
}

/* Filters */
.tsl-filters {
  background: var(--tsl-gray-50);
  border-radius: var(--tsl-radius);
  padding: 20px;
  margin-bottom: 24px;
}

.tsl-filter-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.tsl-filter-group {
  display: flex;
  gap: 12px;
  flex: 1;
}

.tsl-filter-input,
.tsl-filter-select {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--tsl-gray-300);
  border-radius: var(--tsl-radius);
  font-size: 14px;
  transition: all 0.2s;
  background: white;
}

.tsl-filter-input:focus,
.tsl-filter-select:focus {
  outline: none;
  border-color: var(--tsl-primary);
  box-shadow: 0 0 0 3px rgba(91, 33, 182, 0.1);
}

.tsl-filter-input-sm {
  width: 80px;
  padding: 8px;
}

.tsl-filter-range {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tsl-filter-range label {
  font-size: 14px;
  color: var(--tsl-gray-600);
  font-weight: 500;
}

.tsl-filter-checkbox {
  display: flex;
  gap: 16px;
  align-items: center;
}

.tsl-filter-checkbox label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--tsl-gray-700);
  cursor: pointer;
}

.tsl-filter-actions {
  display: flex;
  gap: 8px;
}

/* Buttons */
.tsl-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: var(--tsl-radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.tsl-btn-primary {
  background: var(--tsl-primary);
  color: white;
}

.tsl-btn-primary:hover {
  background: var(--tsl-primary-light);
  transform: translateY(-1px);
  box-shadow: var(--tsl-shadow-md);
}

.tsl-btn-secondary {
  background: white;
  color: var(--tsl-gray-700);
  border: 1px solid var(--tsl-gray-300);
}

.tsl-btn-secondary:hover {
  background: var(--tsl-gray-50);
}

.tsl-btn-link {
  background: none;
  border: none;
  color: var(--tsl-primary);
  cursor: pointer;
  font-size: 14px;
  padding: 4px 0;
}

.tsl-btn-link:hover {
  color: var(--tsl-primary-dark);
  text-decoration: underline;
}

.tsl-icon {
  width: 16px;
  height: 16px;
}

/* Table */
.tsl-table-wrapper {
  background: white;
  border-radius: var(--tsl-radius);
  box-shadow: var(--tsl-shadow);
  overflow: hidden;
  margin-bottom: 24px;
}

.tsl-table {
  width: 100%;
  border-collapse: collapse;
}

.tsl-table thead {
  background: var(--tsl-gray-50);
  border-bottom: 2px solid var(--tsl-gray-200);
}

.tsl-table th {
  padding: 12px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--tsl-gray-600);
  white-space: nowrap;
}

.tsl-table th.sortable {
  cursor: pointer;
  user-select: none;
}

.tsl-table th.sortable:hover {
  color: var(--tsl-primary);
}

.tsl-sort-icon {
  opacity: 0.5;
  font-size: 10px;
  margin-left: 4px;
}

.tsl-table tbody tr {
  border-bottom: 1px solid var(--tsl-gray-100);
  transition: background 0.2s;
}

.tsl-table tbody tr:hover {
  background: var(--tsl-gray-50);
}

.tsl-table td {
  padding: 12px;
  font-size: 14px;
  color: var(--tsl-gray-700);
}

/* Status Column */
.tsl-status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.tsl-status-publish {
  background: var(--tsl-success);
}

.tsl-status-draft {
  background: var(--tsl-gray-400);
}

.tsl-status-pending {
  background: var(--tsl-warning);
}

/* Tour Code */
.tsl-tour-code {
  font-weight: 600;
  color: var(--tsl-primary);
}

/* Tour Title */
.tsl-tour-title {
  font-weight: 500;
  color: var(--tsl-gray-900);
  line-height: 1.4;
}

.tsl-tour-subtitle {
  font-size: 12px;
  color: var(--tsl-gray-500);
  margin-top: 2px;
}

/* Tour Type Badge */
.tsl-type-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  background: var(--tsl-primary);
  color: white;
  margin: 2px 2px 2px 0;
  white-space: nowrap;
}

.tsl-type-domestic {
  background: var(--tsl-success);
}

.tsl-type-international {
  background: var(--tsl-info);
}

.tsl-type-cruise {
  background: var(--tsl-secondary);
}

.tsl-type-adventure {
  background: var(--tsl-warning);
}

/* Duration */
.tsl-duration {
  display: flex;
  flex-direction: column;
}

.tsl-duration-main {
  font-weight: 600;
  color: var(--tsl-gray-800);
}

.tsl-duration-sub {
  font-size: 11px;
  color: var(--tsl-gray-500);
}

/* Destinations */
.tsl-destinations {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tsl-destination-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
}

.tsl-destination-country {
  font-weight: 500;
  color: var(--tsl-gray-700);
}

.tsl-destination-city {
  color: var(--tsl-gray-500);
}

/* Flight Info */
.tsl-flight-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--tsl-radius);
  font-size: 12px;
  font-weight: 500;
}

.tsl-flight-lowcost {
  background: #FEF3C7;
  color: #92400E;
}

.tsl-flight-fullservice {
  background: #DBEAFE;
  color: #1E40AF;
}

.tsl-flight-charter {
  background: #E9D5FF;
  color: #6B21A8;
}

/* Features */
.tsl-features {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tsl-feature-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: var(--tsl-gray-100);
  color: var(--tsl-gray-600);
  font-size: 12px;
  font-weight: 600;
  position: relative;
}

.tsl-feature-icon.active {
  background: var(--tsl-primary);
  color: white;
}

.tsl-feature-icon[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--tsl-gray-800);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  margin-bottom: 4px;
  z-index: 10;
}

.tsl-promo-tag {
  background: linear-gradient(135deg, #EC4899, #F59E0B);
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
}

/* Actions */
.tsl-actions {
  display: flex;
  gap: 6px;
}

.tsl-action-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
}

.tsl-action-view {
  background: var(--tsl-info);
  color: white;
}

.tsl-action-view:hover {
  background: #2563EB;
}

.tsl-action-edit {
  background: var(--tsl-gray-200);
  color: var(--tsl-gray-700);
}

.tsl-action-edit:hover {
  background: var(--tsl-gray-300);
}

/* Skeleton Loading */
.tsl-skeleton {
  padding: 20px;
}

.tsl-skeleton-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.tsl-skeleton-cell {
  height: 20px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 4px;
  flex: 1;
}

.tsl-skeleton-sm {
  flex: 0.5;
}

.tsl-skeleton-lg {
  flex: 2;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* No Results */
.tsl-no-results {
  text-align: center;
  padding: 60px 20px;
}

.tsl-no-results-icon {
  width: 64px;
  height: 64px;
  stroke: var(--tsl-gray-300);
  margin: 0 auto 16px;
}

.tsl-no-results p {
  color: var(--tsl-gray-500);
  margin-bottom: 20px;
}

/* Pagination */
.tsl-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

.tsl-page-btn {
  padding: 8px 12px;
  border: 1px solid var(--tsl-gray-300);
  background: white;
  border-radius: var(--tsl-radius);
  color: var(--tsl-gray-700);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
}

.tsl-page-btn:hover {
  border-color: var(--tsl-primary);
  color: var(--tsl-primary);
}

.tsl-page-btn.active {
  background: var(--tsl-primary);
  color: white;
  border-color: var(--tsl-primary);
}

.tsl-page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Responsive */
@media (max-width: 1024px) {
  .tsl-filter-row {
    flex-direction: column;
  }

  .tsl-filter-group {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .tsl-table {
    font-size: 12px;
  }

  .tsl-table th,
  .tsl-table td {
    padding: 8px;
  }

  .tsl-th-destination,
  .tsl-th-features {
    display: none;
  }

  .tsl-table td:nth-child(6),
  .tsl-table td:nth-child(8) {
    display: none;
  }
}


/* Featured Image Column - Updated to 80x80px */
.tsl-th-image {
  width: 90px;
  min-width: 90px;
}

.tsl-featured-image {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.tsl-featured-image:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tsl-image-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--tsl-gray-200), var(--tsl-gray-100));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tsl-gray-400);
  font-size: 24px;
  cursor: pointer;
  transition: all 0.2s;
}

.tsl-image-placeholder:hover {
  background: linear-gradient(135deg, var(--tsl-primary), var(--tsl-primary-light));
  color: white;
  transform: scale(1.05);
}

/* Responsive - ซ่อน column image บน mobile */
@media (max-width: 768px) {
  .tsl-th-image {
    display: none;
  }

  .tsl-table td:first-child {
    display: none;
  }
}


/* Tour Sure Code Column */
.tsl-th-sure-code {
  min-width: 100px;
}

.tsl-tour-sure-code {
  font-weight: 500;
  color: var(--tsl-primary-light);
  font-size: 13px;
  display: inline-block;
  padding: 2px 6px;
  background: var(--tsl-gray-50);
  border-radius: 4px;
}

.tsl-tour-sure-code.empty {
  color: var(--tsl-gray-400);
  background: transparent;
}

/* Responsive - ซ่อนบนมือถือ */
@media (max-width: 768px) {

  .tsl-th-image,
  .tsl-th-sure-code,
  .tsl-th-destination,
  .tsl-th-features {
    display: none;
  }

  .tsl-table td:nth-child(1),
  .tsl-table td:nth-child(4),
  .tsl-table td:nth-child(8),
  .tsl-table td:nth-child(10) {
    display: none;
  }
}

/* Delete Button Style */
.tsl-action-delete {
  background: var(--tsl-danger);
  color: white;
}

.tsl-action-delete:hover {
  background: #DC2626;
  transform: translateY(-1px);
}

/* Modal Styles */
.tsl-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
}

.tsl-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.tsl-modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.tsl-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--tsl-gray-200);
}

.tsl-modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--tsl-gray-900);
}

.tsl-modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--tsl-gray-400);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.tsl-modal-close:hover {
  background: var(--tsl-gray-100);
  color: var(--tsl-gray-600);
}

.tsl-modal-body {
  padding: 24px;
}

.tsl-modal-warning {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: #FEF2F2;
  border-left: 4px solid var(--tsl-danger);
  border-radius: 8px;
  margin-bottom: 20px;
}

.tsl-modal-warning-icon {
  width: 24px;
  height: 24px;
  stroke: var(--tsl-danger);
  flex-shrink: 0;
}

.tsl-modal-warning p {
  margin: 0;
  color: #991B1B;
  font-weight: 500;
}

.tsl-modal-tour-info {
  background: var(--tsl-gray-50);
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.tsl-modal-tour-info p {
  margin: 8px 0;
  font-size: 14px;
  color: var(--tsl-gray-700);
}

.tsl-modal-tour-info strong {
  color: var(--tsl-gray-900);
}

.tsl-modal-form label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--tsl-gray-700);
}

.tsl-modal-input {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--tsl-gray-300);
  border-radius: var(--tsl-radius);
  font-size: 14px;
  transition: all 0.2s;
  box-sizing: border-box;
}

.tsl-modal-input:focus {
  outline: none;
  border-color: var(--tsl-primary);
  box-shadow: 0 0 0 3px rgba(91, 33, 182, 0.1);
}

.tsl-modal-input.tsl-input-error {
  border-color: var(--tsl-danger);
}

.tsl-modal-error {
  margin-top: 8px;
  padding: 8px 12px;
  background: #FEE2E2;
  color: #991B1B;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
}

.tsl-modal-footer {
  display: flex;
  gap: 12px;
  padding: 20px 24px;
  border-top: 1px solid var(--tsl-gray-200);
  justify-content: flex-end;
}

.tsl-btn-danger {
  background: var(--tsl-danger);
  color: white;
}

.tsl-btn-danger:hover:not(:disabled) {
  background: #DC2626;
  transform: translateY(-1px);
  box-shadow: var(--tsl-shadow-md);
}

.tsl-btn-danger:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Modal Animation */
@keyframes modalFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes modalSlideIn {
  from {
    transform: translate(-50%, -48%);
    opacity: 0;
  }

  to {
    transform: translate(-50%, -50%);
    opacity: 1;
  }
}

.tsl-modal {
  animation: modalFadeIn 0.2s ease-out;
}

.tsl-modal-content {
  animation: modalSlideIn 0.3s ease-out;
}

/* Responsive Modal */
@media (max-width: 576px) {
  .tsl-modal-content {
    width: 95%;
    max-height: 95vh;
  }

  .tsl-modal-header,
  .tsl-modal-body,
  .tsl-modal-footer {
    padding: 16px;
  }

  .tsl-modal-footer {
    flex-direction: column;
  }

  .tsl-modal-footer .tsl-btn {
    width: 100%;
  }
}

/* ========================================
   DATES COLUMN STYLES
======================================== */
.tsl-th-dates {
  min-width: 140px;
  max-width: 180px;
}

.tsl-dates-summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 120px;
}

.tsl-dates-info {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: 12px;
  line-height: 1.4;
}

.tsl-dates-info.tsl-dates-alert {
  padding-left: 8px;
  border-left: 3px solid var(--tsl-danger);
}

.tsl-dates-total {
  font-weight: 600;
  color: var(--tsl-gray-700);
}

.tsl-dates-avail {
  color: var(--tsl-success);
  font-weight: 500;
}

.tsl-dates-almost {
  color: var(--tsl-warning);
  font-weight: 500;
}

.tsl-dates-expired {
  color: var(--tsl-gray-400);
  font-weight: 500;
}

/* Progress Bar */
.tsl-dates-progress {
  display: flex;
  height: 5px;
  background: var(--tsl-gray-200);
  border-radius: 3px;
  overflow: hidden;
  max-width: 120px;
}

.tsl-prog-avail {
  background: var(--tsl-success);
}

.tsl-prog-almost {
  background: var(--tsl-warning);
}

.tsl-prog-full {
  background: var(--tsl-danger);
}

.tsl-prog-expired {
  background: var(--tsl-gray-400);
}

/* Alert Badge */
.tsl-dates-badge-alert {
  display: inline-block;
  padding: 2px 8px;
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.tsl-dates-empty {
  color: var(--tsl-gray-400);
  font-size: 13px;
}

/* ========================================
   STAR RATING STYLES
======================================== */
.ts-star-rating-xr7 {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 8px 0;
}

.ts-star-rating-xr7 .ts-star {
  color: #D1D5DB;
  cursor: default;
  transition: all 0.15s ease;
  display: inline-flex;
}

.ts-star-rating-xr7 .ts-star.ts-star-filled {
  color: #F59E0B;
}

.ts-star-rating-xr7 .ts-star svg {
  width: 16px;
  height: 16px;
}

/* Editable stars for admin */
.ts-star-rating-xr7.ts-star-editable .ts-star {
  cursor: pointer;
}

.ts-star-rating-xr7.ts-star-editable .ts-star:hover {
  transform: scale(1.2);
}

.ts-star-rating-xr7.ts-star-editable:hover .ts-star {
  color: #FCD34D;
}

.ts-star-rating-xr7.ts-star-editable .ts-star:hover ~ .ts-star {
  color: #D1D5DB;
}

/* Hover effect - fill stars up to hovered star */
.ts-star-rating-xr7.ts-star-editable:hover .ts-star:hover,
.ts-star-rating-xr7.ts-star-editable:hover .ts-star:hover ~ .ts-star {
  color: #D1D5DB;
}

.ts-star-rating-xr7.ts-star-editable:hover .ts-star:not(:hover ~ .ts-star):not(.ts-star:hover ~ .ts-star) {
  color: #FCD34D;
}

/* Loading state */
.ts-star-rating-xr7.ts-star-loading {
  opacity: 0.6;
  pointer-events: none;
}

.ts-star-rating-xr7.ts-star-loading .ts-star {
  animation: starPulse 1s infinite;
}

@keyframes starPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Success feedback */
.ts-star-rating-xr7.ts-star-success .ts-star.ts-star-filled {
  animation: starBounce 0.3s ease;
}

@keyframes starBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

/* Hover preview for admin */
.ts-star-rating-xr7.ts-star-editable .ts-star.ts-star-hover {
  color: #FCD34D;
}
