/* Transfer Routes Plugin - Frontend Styles */

/* Price calculator shortcode styling */
.transfer-routes-calculator {
  background: #f9f9f9;
  border: 1px solid #e1e1e1;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  max-width: 500px;
}

.transfer-routes-calculator h3 {
  color: #333;
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 20px;
}

.calculator-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.calculator-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.calculator-field label {
  font-weight: 600;
  color: #333;
  font-size: 14px;
}

.calculator-field input,
.calculator-field select {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  background: #fff;
}

.calculator-field input:focus,
.calculator-field select:focus {
  border-color: #007cba;
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

.calculator-button {
  background: #007cba;
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.calculator-button:hover {
  background: #005a87;
}

.calculator-button:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.calculator-result {
  background: #d4edda;
  border: 1px solid #c3e6cb;
  border-radius: 4px;
  padding: 15px;
  margin-top: 15px;
  text-align: center;
  display: none;
}

.calculator-result.show {
  display: block;
}

.calculated-price {
  font-size: 24px;
  font-weight: 700;
  color: #155724;
  margin-bottom: 5px;
}

.calculation-details {
  font-size: 14px;
  color: #155724;
  opacity: 0.8;
}

/* Route list styling - used in templates/frontend/route-list.php */
.transfer-routes-list {
  margin: 20px 0;
}

.tr-routes-table {
  width: 100%;
  border-collapse: collapse;
}

.tr-routes-table th,
.tr-routes-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #e1e1e1;
}

.tr-routes-table th {
  background: #f9f9f9;
  font-weight: 600;
  color: #333;
}

.tr-route-item {
  list-style: none;
  padding: 15px;
  background: #fff;
  border: 1px solid #e1e1e1;
  border-radius: 4px;
  margin-bottom: 10px;
}

.tr-no-routes {
  text-align: center;
  padding: 40px 20px;
  color: #666;
  background: #f9f9f9;
  border: 1px solid #e1e1e1;
  border-radius: 4px;
}

.tr-search-form {
  margin-bottom: 20px;
}

.tr-search-input {
  width: 100%;
  max-width: 400px;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.tr-search-button {
  background: #007cba;
  color: #fff;
  border: none;
  padding: 10px 15px;
  border-radius: 4px;
  cursor: pointer;
  margin-left: 10px;
}

.tr-search-button:hover {
  background: #005a87;
}

/* Custom Dropdown Styles - used in shortcode-manager.php */
.custom-dropdown-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.custom-dropdown-input {
  width: 100%;
  padding: 16px 80px 16px 24px !important;
  border: 2px solid #e1e1e1;
  border-radius: 6px;
  font-size: 16px;
  background: #fff;
  cursor: pointer;
  border-radius: 8px !important;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.custom-dropdown-input:focus {
  outline: none;
  border-color: #007cba;
  box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.custom-dropdown-input:hover {
  border-color: #c3c4c7;
}

.dropdown-toggle {
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: #666;
  transition: color 0.3s ease;
  z-index: 2;
}

.dropdown-arrow {
  font-size: 12px;
  transition: transform 0.3s ease;
}

.dropdown-toggle.active .dropdown-arrow {
  transform: rotate(180deg);
}

.clear-button {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: #999;
  transition: color 0.3s ease;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.clear-button:hover {
  color: #d63638;
  background: #f0f0f0;
}

.clear-icon {
  font-size: 14px;
  font-weight: bold;
}

.custom-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border-top: none;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  max-height: 300px;
  overflow: hidden;
  display: none;
}

.custom-dropdown-menu.active {
  display: block;
}

.dropdown-search {
  padding: 12px;
  border-bottom: 1px solid #e1e1e1;
  background: #f9f9f9;
}

.dropdown-search-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  background: #fff;
}

.dropdown-search-input:focus {
  outline: none;
  border-color: #007cba;
  box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

.dropdown-options {
  max-height: 200px;
  overflow-y: auto;
}

.dropdown-option {
  padding: 12px 16px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border-bottom: 1px solid #f0f0f0;
}

.dropdown-option:hover {
  background: #f5f5f5;
}

.dropdown-option:last-child {
  border-bottom: none;
}

.dropdown-option.selected {
  background: #e7f3ff;
  color: #007cba;
  font-weight: 500;
}

.dropdown-option.disabled {
  color: #999;
  cursor: not-allowed;
  background: #f9f9f9;
}

.dropdown-option.disabled:hover {
  background: #f9f9f9;
}

/* Keyboard navigation highlighting */
.dropdown-option.highlighted {
  background: #007cba !important;
  color: #fff !important;
}

.dropdown-option.highlighted:hover {
  background-color: #005a87 !important;
}

/* Search match highlighting - scoped to dropdown options only */
.dropdown-option mark {
  background-color: #ffd60a;
  color: #996f00;
  padding: 0;
  font-weight: 600;
}

.dropdown-option.highlighted mark {
  background-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

/* Autocomplete input cursor behavior */
.autocomplete-input {
  cursor: text !important;
}

.autocomplete-input:focus {
  cursor: text !important;
}

/* No results styling */
.dropdown-no-results {
  padding: 12px 16px;
  color: #666;
  font-style: italic;
  text-align: center;
  background-color: #f9f9f9;
}

/* Route Selector Shortcode Styles */

.route-selector-form {
  max-width: 100%;
}

.route-selector-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.route-selector-field {
  flex: 1;
  min-width: 180px;
}


.route-selector-field label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
}

.route-selector-input {
  width: 100%;
  background: #fff;
  border: 1px solid #e1e1e1 !important;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.route-selector-message {
  margin-top: 15px;
  padding: 10px;
  border-radius: 4px;
}

.route-selector-message .error {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
}

.route-selector-message .success {
  background: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
}

.route-selector-message .info {
  background: #d1ecf1;
  border: 1px solid #bee5eb;
  color: #0c5460;
}

/* Loading states */
.transfer-routes-loading {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

.transfer-routes-loading .spinner {
  width: 30px;
  height: 30px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #007cba;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Error states */
.transfer-routes-error {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 4px;
  padding: 15px;
  color: #721c24;
  margin: 15px 0;
}

.route-selector-actions {
  align-self: end;
}

/* Responsive design */
@media (max-width: 1200px) {

  .route-selector-actions {
    width: 100%;
  }

  .route-selector-button {
    width: 100%;
  }

  .route-selector-row {
    flex-direction: column;
  }

  .route-selector-field {
    min-width: 100%;
  }

  .transfer-routes-calculator {
    max-width: none;
  }

  .custom-dropdown-menu {
    max-height: 250px;
  }

  .dropdown-options {
    max-height: 150px;
  }
}

@media (max-width: 480px) {
  .custom-dropdown-input {
    padding: 10px 70px 10px 14px !important;
    font-size: 16px;
    /* Prevent zoom on iOS */
  }

  .dropdown-toggle {
    right: 35px;
  }
}