/* Container Transport System - Frontend Styles */

.cts-container-list {
  margin: 20px 0;
}

.cts-container-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.cts-container-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.cts-container-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.cts-container-card h3 {
  margin: 0 0 15px 0;
  color: #333;
  font-size: 1.2em;
}

.cts-container-card p {
  margin: 8px 0;
  color: #666;
}

.cts-price {
  font-size: 1.1em;
  color: #2c5aa0 !important;
  font-weight: bold;
}

.cts-book-btn {
  background: #0073aa;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  margin-top: 15px;
  transition: all 0.3s ease;
  position: relative;
  z-index: 10;
  pointer-events: auto;
  display: inline-block;
  text-decoration: none;
  user-select: none;
}

.cts-book-btn:hover {
  background: #005a87;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.cts-book-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cts-book-btn:focus {
  outline: 2px solid #ff6b6b;
  outline-offset: 2px;
}

/* แก้ปัญหา pointer events */
.cts-container-card {
  position: relative;
}

.cts-container-card * {
  pointer-events: auto;
}

/* Booking Form Styles */
.cts-booking-form {
  background: #f9f9f9;
  padding: 30px;
  border-radius: 8px;
  border: 1px solid #ddd;
  max-width: 800px;
  margin: 20px 0;
}

.cts-booking-form h3 {
  margin: 0 0 25px 0;
  color: #333;
  text-align: center;
}

.cts-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

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

.cts-form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: #333;
}

.cts-form-group input,
.cts-form-group select,
.cts-form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
}

.cts-form-group input:focus,
.cts-form-group select:focus,
.cts-form-group textarea:focus {
  outline: none;
  border-color: #0073aa;
  box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

/* เอฟเฟกต์ highlight สำหรับ select */
.cts-form-group select.highlight {
  border: 3px solid #ff6b6b !important;
  box-shadow: 0 0 15px rgba(255, 107, 107, 0.6) !important;
  animation: pulse 1s ease-in-out;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}

.cts-price-summary {
  background: #fff;
  padding: 20px;
  border-radius: 4px;
  border: 1px solid #ddd;
  margin: 20px 0;
}

.cts-price-summary h4 {
  margin: 0 0 15px 0;
  color: #333;
}

.cts-price-summary p {
  margin: 8px 0;
  display: flex;
  justify-content: space-between;
}

.cts-form-submit {
  text-align: center;
  margin-top: 25px;
}

.cts-form-submit button {
  background: #0073aa;
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  transition: background-color 0.2s ease;
}

.cts-form-submit button:hover {
  background: #005a87;
}

.cts-form-submit button:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* Tracking Form Styles */
.cts-tracking-form {
  background: #f9f9f9;
  padding: 30px;
  border-radius: 8px;
  border: 1px solid #ddd;
  max-width: 600px;
  margin: 20px 0;
}

.cts-tracking-form h3 {
  margin: 0 0 25px 0;
  color: #333;
  text-align: center;
}

.cts-tracking-result {
  background: #fff;
  padding: 20px;
  border-radius: 4px;
  border: 1px solid #ddd;
  margin-top: 20px;
}

.cts-tracking-result h4 {
  margin: 0 0 15px 0;
  color: #333;
  border-bottom: 2px solid #0073aa;
  padding-bottom: 10px;
}

.cts-tracking-info p {
  margin: 10px 0;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}

.cts-tracking-info p:last-child {
  border-bottom: none;
}

/* Status Colors */
.status-pending {
  color: #dba617;
}
.status-confirmed {
  color: #0073aa;
}
.status-in_transit {
  color: #7c3aed;
}
.status-delivered {
  color: #00a32a;
}
.status-completed {
  color: #006505;
}
.status-cancelled {
  color: #d63638;
}

/* Price Calculator Styles */
.cts-price-calculator {
  background: #f9f9f9;
  padding: 30px;
  border-radius: 8px;
  border: 1px solid #ddd;
  max-width: 700px;
  margin: 20px 0;
}

.cts-price-calculator h3 {
  margin: 0 0 25px 0;
  color: #333;
  text-align: center;
}

.cts-price-result {
  background: #fff;
  padding: 20px;
  border-radius: 4px;
  border: 1px solid #ddd;
  margin-top: 20px;
}

.cts-price-item {
  background: #f0f8ff;
  padding: 15px;
  border-radius: 4px;
  border-left: 4px solid #0073aa;
  margin: 10px 0;
}

/* Messages */
.cts-success {
  background: #d1e7dd;
  color: #0f5132;
  padding: 15px;
  border-radius: 4px;
  border: 1px solid #badbcc;
  margin: 15px 0;
}

.cts-error {
  background: #f8d7da;
  color: #721c24;
  padding: 15px;
  border-radius: 4px;
  border: 1px solid #f5c2c7;
  margin: 15px 0;
}

/* Custom Fields Styles */
.cts-custom-fields-section {
  margin: 25px 0;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 4px;
  border: 1px solid #e9ecef;
}

.cts-custom-fields-section h4 {
  margin: 0 0 20px 0;
  color: #333;
  font-size: 1.1em;
  border-bottom: 2px solid #0073aa;
  padding-bottom: 8px;
}

.cts-radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cts-radio-label,
.cts-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: normal;
  cursor: pointer;
}

.cts-radio-label input,
.cts-checkbox-label input {
  width: auto;
  margin: 0;
}

.cts-field-description {
  font-size: 0.9em;
  color: #666;
  margin: 5px 0 0 0;
  font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
  .cts-container-grid {
    grid-template-columns: 1fr;
  }

  .cts-form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .cts-booking-form,
  .cts-tracking-form,
  .cts-price-calculator {
    padding: 20px;
    margin: 10px;
  }

  .cts-price-summary p {
    flex-direction: column;
    gap: 5px;
  }

  .cts-radio-group {
    gap: 12px;
  }

  .cts-radio-label,
  .cts-checkbox-label {
    padding: 8px 0;
  }
}

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

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