/**
 * Ticket Search Form Styles
 *
 * @package MT_Ticket_Bus
 */

.mt-ticket-search-form-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.mt-ticket-search-form {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.mt-search-form-wrapper {
  display: flex;
  gap: 1rem;
  position: relative;
}

.mt-search-form-left {
  flex: 1 1 0;
  min-width: 0;
}

.mt-search-form-right {
  flex: 0 0 auto;
  position: relative;
  padding-left: 1rem;
  display: flex;
  align-items: flex-end;
}

.mt-search-form-right::before {
  content: "";
  position: absolute;
  left: 0;
  top: -1rem;
  bottom: -1rem;
  width: 1px;
  background-color: #e5e7eb;
}

.mt-search-form-row {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
  margin: 0;
}

.mt-search-form-row > .mt-search-field {
  display: flex;
  flex-direction: column;
}

.mt-search-form-row:first-child {
  margin-bottom: 0.5rem;
}

.mt-ticket-search-title {
  margin: 0;
  padding: 0;
  line-height: 0.8;
}

.mt-search-field {
  flex: 1 1 0;
  min-width: 150px;
  position: relative;
}

.mt-search-field label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: #374151;
}

.mt-select2-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

/* Date input styles to match Select2 */
.mt-search-field .mt-date-input {
  width: 100%;
  height: 48px;
  min-height: 48px;
  max-height: 48px;
  padding: 0.75rem;
  padding-right: 2.5rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.2s;
  box-sizing: border-box;
  line-height: normal;
  color: #374151;
  background-color: #fff;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  margin: 0;
  vertical-align: top;
}

.mt-search-field .mt-date-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Style calendar icon to match Select2 arrow position */
.mt-search-field .mt-date-input::-webkit-calendar-picker-indicator {
  cursor: pointer;
  position: absolute;
  right: 0.75rem;
  width: 20px;
  height: 20px;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.mt-search-field .mt-date-input:hover::-webkit-calendar-picker-indicator {
  opacity: 1;
}

/* For Firefox */
.mt-search-field .mt-date-input::-moz-calendar-picker-indicator {
  cursor: pointer;
  margin-right: 0.5rem;
}

/* Select2 Custom Styles */
.mt-search-field .select2-container {
  width: 100% !important;
  display: block;
}

.mt-search-field .select2-container--default .select2-selection--single {
  height: 48px;
  min-height: 48px;
  max-height: 48px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 0.75rem;
  transition: border-color 0.2s;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  margin: 0;
}

.mt-search-field .select2-container--default .select2-selection--single:focus,
.mt-search-field
  .select2-container--default.select2-container--focus
  .select2-selection--single {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  outline: none;
}

.mt-search-field
  .select2-container--default
  .select2-selection--single
  .select2-selection__rendered {
  line-height: normal;
  padding: 0;
  color: #374151;
  display: flex;
  align-items: center;
  height: 100%;
}

.mt-search-field
  .select2-container--default
  .select2-selection--single
  .select2-selection__arrow {
  height: 100%;
  right: 0.75rem;
}

.mt-search-field
  .select2-container--default.select2-container--disabled
  .select2-selection--single {
  background-color: #f3f4f6;
  cursor: not-allowed;
}

.mt-search-field .select2-dropdown {
  border: 1px solid #d1d5db;
  border-radius: 6px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin-top: 2px;
}

.mt-search-field .select2-results__option {
  padding: 0.75rem 1rem;
  transition: background-color 0.2s;
}

.mt-search-field .select2-results__option--highlighted {
  background-color: #f3f4f6;
  color: #111827;
}

.mt-search-field .select2-results__option[aria-selected="true"] {
  background-color: #eff6ff;
  color: #3b82f6;
}

.mt-search-field .select2-search--dropdown .select2-search__field {
  border: 1px solid #d1d5db;
  border-radius: 4px;
  padding: 0.5rem;
  margin: 0.5rem;
  width: calc(100% - 1rem);
}

.mt-search-field .select2-search--dropdown .select2-search__field:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.mt-search-submit {
  flex: 0 0 auto;
}

.mt-search-button {
  height: 48px;
  min-height: 48px;
  max-height: 48px;
  padding: 0.75rem 2rem;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
  white-space: nowrap;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mt-search-button:hover {
  background: #2563eb;
}

.mt-search-button:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

/* Search Results Styles */
.mt-search-results-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.mt-search-results-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #e5e7eb;
}

.mt-search-results-header h1 {
  font-size: 1.875rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #111827;
}

.mt-search-results-info {
  color: #6b7280;
  font-size: 0.875rem;
}

.mt-search-results-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.mt-search-result-item {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.mt-result-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.mt-result-route {
  flex: 1 1 0;
}

.mt-result-route-name {
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 0.25rem;
}

.mt-result-route-stations {
  color: #6b7280;
  font-size: 0.875rem;
}

.mt-result-time-price {
  text-align: right;
}

.mt-result-time {
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 0.25rem;
}

.mt-result-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: #059669;
}

.mt-result-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem;
  background: #f9fafb;
  border-radius: 6px;
}

.mt-result-detail-item {
  display: flex;
  flex-direction: column;
}

.mt-result-detail-label {
  font-size: 0.75rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.mt-result-detail-value {
  font-size: 0.875rem;
  color: #111827;
  font-weight: 500;
}

.mt-result-paid-extras-wrapper {
  margin-top: 1rem;
  border-top: 1px solid #e5e7eb;
  padding-top: 1rem;
}

.mt-result-seats-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  margin-top: 1rem;
  border-bottom: 1px solid #e5e7eb;
  flex-wrap: wrap;
}

.mt-result-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  padding-top: 1rem;
  flex-wrap: wrap;
}

.mt-result-seats-count {
  font-size: 0.875rem;
  color: #6b7280;
}

.mt-result-seats-count.available {
  color: #059669;
  font-weight: 600;
}

.mt-result-seats-count.low {
  color: #f59e0b;
  font-weight: 600;
}

.mt-result-seats-count.full {
  color: #dc2626;
  font-weight: 600;
}

.mt-toggle-seatmap-button {
  padding: 0.5rem 1rem;
  background: transparent;
  color: #3b82f6;
  border: 1px solid #3b82f6;
  border-radius: 6px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.mt-toggle-seatmap-button:hover {
  background: #3b82f6;
  color: #fff;
}

.mt-result-seatmap-container {
  display: none;
  margin-top: 1rem;
  margin-bottom: 1rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.mt-result-seatmap-container.active {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.mt-result-seatmap-container .mt-seat-map-wrapper {
  flex: 1 1 0;
}

.mt-result-seatmap-container .mt-selected-seats-summary {
  flex: 1 1 0;
}

.mt-result-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.mt-result-button {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.mt-result-button:disabled,
.mt-result-button.mt-button-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.mt-result-button-add-cart {
  background: #3b82f6;
  color: #fff;
}

.mt-result-button-add-cart:hover:not(:disabled):not(.mt-button-disabled) {
  background: #2563eb;
}

.mt-result-button-buy-now {
  background: #059669;
  color: #fff;
}

.mt-result-button-buy-now:hover:not(:disabled):not(.mt-button-disabled) {
  background: #047857;
}

.mt-no-results {
  text-align: center;
  padding: 3rem;
  color: #6b7280;
}

.mt-no-results h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: #111827;
}

/* Responsive - Search Form */
@media (max-width: 768px) {
  /* Remove padding from container on mobile */
  .mt-ticket-search-form-container {
    padding: 0;
  }

  /* Remove wrapper flex layout on mobile */
  .mt-search-form-wrapper {
    flex-direction: column;
    gap: 1.5rem;
  }

  /* Remove vertical divider line on mobile */
  .mt-search-form-right::before {
    display: none;
  }

  /* Add horizontal divider and spacing on mobile */
  .mt-search-form-right {
    padding-left: 0;
    padding-top: 1.5rem;
    align-items: stretch;
    width: 100%;
    border-top: 1px solid #e5e7eb;
    margin-top: 0.5rem;
  }

  /* Make all form rows stack vertically */
  .mt-search-form-row {
    flex-direction: column;
    gap: 1rem;
  }

  /* Make all fields full width */
  .mt-search-field {
    width: 100%;
    min-width: 100%;
  }

  /* Make submit button full width */
  .mt-search-submit {
    width: 100%;
  }

  .mt-search-button {
    width: 100%;
  }
}

/* Responsive - Search Results */
@media (max-width: 768px) {
  .mt-result-header {
    flex-direction: column;
  }

  .mt-result-time-price {
    text-align: left;
  }

  .mt-result-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .mt-result-buttons {
    width: 100%;
  }

  .mt-result-button {
    flex: 1 1 0;
  }
}

/* Ticket Seats View Styles */
.mt-ticket-seats-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.mt-ticket-seats-header {
  margin-bottom: 2rem;
}

.mt-ticket-seats-title {
  font-size: 1.875rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #111827;
}

.mt-ticket-seats-description {
  font-size: 1rem;
  color: #6b7280;
  line-height: 1.6;
}

.mt-ticket-seats-form {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.mt-ticket-seats-form-row {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.mt-ticket-seats-field {
  flex: 1 1 0;
  min-width: 200px;
}

.mt-ticket-seats-field label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: #374151;
}

.mt-ticket-order-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.mt-ticket-order-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.mt-ticket-seats-submit {
  flex: 0 0 auto;
}

.mt-ticket-seats-button {
  height: 48px;
  min-height: 48px;
  max-height: 48px;
  padding: 0.75rem 2rem;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
  white-space: nowrap;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mt-ticket-seats-button:hover {
  background: #2563eb;
}

.mt-ticket-seats-result {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.mt-ticket-seats-loading,
.mt-ticket-seats-error {
  text-align: center;
  padding: 2rem;
}

.mt-ticket-seats-error .mt-error-message {
  color: #dc2626;
  font-weight: 600;
}

.mt-ticket-seats-info {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.mt-ticket-seats-route {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #111827;
}

.mt-ticket-seats-details {
  font-size: 1rem;
  color: #6b7280;
}

.mt-bus-seat-layout-view-only {
  margin-top: 1.5rem;
}

/* View-only seat styles - no hover/click effects */
.mt-seat-view-only {
  cursor: default !important;
  pointer-events: none !important;
}

.mt-seat-view-only:hover {
  transform: none !important;
  box-shadow: none !important;
}

/* Ticket seat style - special background for customer's seats */
.mt-seat-ticket {
  background-color: #3b82f6 !important;
  color: #fff !important;
  font-weight: 700 !important;
  border: 2px solid #2563eb !important;
}

.mt-seat-ticket:hover {
  background-color: #3b82f6 !important;
  transform: none !important;
}

.mt-legend-seat.mt-seat-ticket {
  background-color: #3b82f6;
  border: 2px solid #2563eb;
}

/* Responsive */
@media (max-width: 768px) {
  .mt-ticket-seats-form-row {
    flex-direction: column;
  }

  .mt-ticket-seats-field {
    width: 100%;
  }

  .mt-ticket-seats-button {
    width: 100%;
  }
}
