/* ============================================================
   ROUTES - Route Creator Styles
   Scene Locations Theme
   ============================================================ */

#route-creator-wrapper {
  max-width: 1920px;
  margin: 0 auto;
  font-family: var(--sl-font-family);
}

/* Panel de filtros */
#route-filters-panel {
  background: var(--sl-color-secondary);
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  margin-bottom: 15px;
}

#route-filters-panel h2 {
  margin: 0 0 30px 0;
  color: white;
  font-weight: 300;
  font-size: 22px;
  border-bottom: 1px solid var(--sl-color-primary);
  padding-bottom: 15px;
  font-family: var(--sl-font-family);
}

.route-filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.route-filter-group label {
  display: block;
  font-weight: 500;
  font-size: 15px;
  margin-bottom: 8px;
  color: white;
  font-family: var(--sl-font-family);
}

.route-filter-group label span {
  color: var(--sl-color-text);
  font-weight: 400;
  font-size: 13px;
}

.route-filter-group select,
.route-filter-group input[type="text"] {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--sl-color-accent);
  background-color: var(--sl-color-bg-input, #202c49);
  color: var(--sl-color-text);
  border-radius: 5px;
  font-size: 14px;
  font-family: var(--sl-font-family);
  transition: var(--sl-transition-fast);
  box-sizing: border-box;
}

.route-filter-group select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath fill='%23999' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 8px;
  padding-right: 30px;
}

.route-filter-group select:focus,
.route-filter-group input:focus {
  outline: none;
  border-color: var(--sl-color-primary);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Custom-select overrides for route creator */
.route-filter-group .custom-select-trigger {
  padding: 10px;
  background-color: var(--sl-color-bg-input, #202c49);
  border: 1px solid var(--sl-color-accent);
  border-radius: 5px;
  min-height: auto;
  color: var(--sl-color-text);
  font-size: 14px;
}

.route-filter-group .custom-select-trigger:hover {
  border-color: var(--sl-color-primary);
}

.route-filter-group .custom-select-wrapper.open .custom-select-trigger {
  border-color: var(--sl-color-primary);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.route-filter-group .custom-select-arrow {
  width: 8px;
  height: 8px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath fill='%23999' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 8px;
  margin-left: 10px;
}

.route-filter-group .custom-select-arrow svg {
  display: none;
}

.route-filter-group .custom-select-dropdown {
  background-color: #121a30;
  border: 1px solid var(--sl-color-border);
}

.route-filter-group .custom-select-search input {
  background-color: var(--sl-color-bg-input, #202c49);
  border: 1px solid var(--sl-color-border);
  color: var(--sl-color-text);
  font-size: 14px !important;
}

.route-filter-group .custom-select-option {
  color: var(--sl-color-text);
}

.route-filter-group .custom-select-option:hover {
  background-color: #2a3552;
}

/* Starting point section */
.route-starting-point {
  margin-bottom: 20px;
}

.route-starting-point label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: white;
  font-family: var(--sl-font-family);
}

.route-start-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

#use-my-location {
  flex: 1;
  min-width: 200px;
  padding: 12px 20px;
  background: var(--sl-color-primary);
  color: white;
  border: none;
  border-radius: 5px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--sl-transition-fast);
  font-family: var(--sl-font-family);
}

#use-my-location:hover {
  background: #2980b9;
}

#custom-start-point {
  flex: 2;
  min-width: 300px;
  padding: 12px;
  border: 1px solid var(--sl-color-border);
  background-color: var(--sl-color-bg-input, #202c49);
  color: white !important;
  border-radius: 5px;
  font-size: 14px;
  font-family: var(--sl-font-family);
}

#custom-start-point::placeholder {
  color: var(--sl-color-text) !important;
}

#start-point-status {
  margin: 8px 0 0 0;
  font-size: 13px;
  color: var(--sl-color-hover);
  font-family: var(--sl-font-family);
}

/* Action buttons */
.route-action-buttons {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

#create-route-btn {
  width: 100%;
  padding: 15px 30px;
  background: linear-gradient(135deg, var(--sl-color-primary) 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--sl-transition-fast);
  font-family: var(--sl-font-family);
}

#create-route-btn:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

#create-route-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

#export-gpx-btn,
#share-route-btn,
#google-maps-btn {
  flex: 1;
  padding: 15px 30px;
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--sl-transition-fast);
  font-family: var(--sl-font-family);
}

#export-gpx-btn {
  background: #2ecc71;
}

#export-gpx-btn:hover {
  background: #27ae60;
  transform: translateY(-2px);
}

#share-route-btn {
  background: #e74c3c;
}

#share-route-btn:hover {
  background: #c0392b;
  transform: translateY(-2px);
}

#google-maps-btn {
  background: #0078f8;
}

#google-maps-btn:hover {
  background: #0062cc;
  transform: translateY(-2px);
}

/* Loading overlay */
#route-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}

#route-loading-overlay.active {
  display: flex;
}

.route-loader-content {
  text-align: center;
  color: white;
  font-family: var(--sl-font-family);
}

.route-loader-spinner {
  width: 60px;
  height: 60px;
  margin: 0 auto 20px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid white;
  border-radius: 50%;
  animation: sl-route-spin 1s linear infinite;
}

.route-loader-progress {
  width: 300px;
  height: 6px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  margin: 20px auto;
  overflow: hidden;
}

.route-loader-bar {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  animation: sl-route-progress 2s ease-in-out infinite;
}

.route-loader-text {
  font-size: 18px;
  font-weight: 600;
  margin-top: 10px;
}

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

@keyframes sl-route-progress {
  0% { width: 0%; }
  50% { width: 70%; }
  100% { width: 100%; }
}

/* Route info panel */
#route-info-panel {
  background: var(--sl-color-secondary);
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  margin-bottom: 15px;
  display: none;
}

.route-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  text-align: center;
}

.route-info-item {
  font-family: var(--sl-font-family);
}

#route-distance,
#route-duration,
#route-locations {
  font-size: 32px;
  font-weight: 700;
}

#route-distance {
  color: #3498db;
}

#route-duration {
  color: #e74c3c;
}

#route-locations {
  color: #2ecc71;
}

.route-info-item div:last-child {
  color: var(--sl-color-text);
  margin-top: 5px;
  font-family: var(--sl-font-family);
}

/* Map */
#route-map {
  width: 100%;
  height: 600px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  position: relative;
}

#route-map #map-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 1000;
  font-family: var(--sl-font-family);
}

#route-map #map-loading > div:first-child {
  font-size: 48px;
  margin-bottom: 15px;
}

#route-map #map-loading > div:last-child {
  font-size: 18px;
  color: #7f8c8d;
}

/* Leaflet routing container */
.leaflet-routing-container {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  font-family: var(--sl-font-family);
}

/* Route gallery */
#route-gallery {
  background: var(--sl-color-secondary);
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  margin-top: 15px;
  display: none;
}

#route-gallery h3 {
  margin: 0 0 30px 0;
  color: white;
  border-bottom: 1px solid var(--sl-color-primary);
  padding-bottom: 10px;
  font-family: var(--sl-font-family);
  font-weight: 300;
}

#gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

/* Route location cards */
#route-creator-wrapper .location-card {
  position: relative;
  border: 1px solid var(--sl-color-border);
  background-color: var(--sl-color-bg-input, #202c49);
  border-radius: 8px;
  overflow: hidden;
  transition: all var(--sl-transition-normal);
  cursor: pointer;
  font-family: var(--sl-font-family);
  display: flex;
  flex-direction: column;
}

#route-creator-wrapper .location-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 20px rgba(0,0,0,0.15);
  border-color: var(--sl-color-primary);
}

#route-creator-wrapper .location-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.location-card-body {
  padding: 15px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.location-card-title {
  margin-bottom: 8px;
}

#route-creator-wrapper .location-card .location-card-body .location-card-title strong,
#route-creator-wrapper .location-card-body .location-card-title strong,
.location-card .location-card-body .location-card-title strong,
.location-card-body .location-card-title strong,
.location-card-title strong {
  font-size: 16px !important;
  color: white !important;
  font-weight: 400 !important;
  font-family: var(--sl-font-family) !important;
}

.location-card-coords {
  font-size: 12px;
  color: var(--sl-color-text);
  margin-bottom: 10px;
  font-family: var(--sl-font-family);
}

#route-creator-wrapper .location-card a {
  display: inline-block;
  padding: 8px 15px;
  background: var(--sl-color-primary) !important;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 400;
  transition: var(--sl-transition-fast);
  font-family: var(--sl-font-family);
  margin-top: auto;
}

#route-creator-wrapper .location-card a:hover {
  background-color: white !important;
  color: var(--sl-color-primary);
}

.location-number {
  position: absolute;
  top: 5px;
  left: 5px;
  z-index: 10;
  display: inline-block;
  background: var(--sl-color-primary);
  color: white;
  width: 30px;
  height: 30px;
  line-height: 30px;
  border-radius: 50%;
  text-align: center;
  font-weight: 600;
  font-family: var(--sl-font-family);
}
