/* public/frontend/css/route-search.css */

body {
  background-image: url('https://zhanzhang.sogou.com/api/wxapp/file/link?uuid=6238adc4a9a1166e78da36ca0fd465f1.jpg');
  background-size: cover;
  background-attachment: fixed;
  background-position: center;
  min-height: 100vh;
  margin: 0;
}

.route-search-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  font-family: Arial, sans-serif;
  background-color: rgba(255, 255, 255, 0.9); /* Add transparency to content background */
  min-height: 100vh;
  box-shadow: 0 0 20px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
}

.site-header {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.site-logo {
  height: 50px; /* Adjust as needed */
  margin-right: 15px;
}

.route-search-container h2 {
  margin-bottom: 0; /* Remove bottom margin as it's now in flex container */
  color: #333;
}

.site-footer {
  margin-top: auto;
  padding-top: 30px;
  border-top: 1px solid #ddd;
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
  text-align: center;
  padding-bottom: 20px;
}

.footer-qrcode-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.footer-qrcode-item a {
  display: block;
  transition: transform 0.2s;
}

.footer-qrcode-item a:hover {
  transform: scale(1.05);
}

.footer-qrcode-img {
  width: 120px;
  height: 120px;
  aspect-ratio: 1 / 1; /* Force 1:1 aspect ratio */
  object-fit: contain;
  border: 1px solid #eee;
  background-color: white;
  padding: 5px;
  border-radius: 4px;
}

.footer-qrcode-label {
  margin-top: 10px;
  font-size: 14px;
  color: #555;
  font-weight: bold;
}

.search-tabs {
  display: flex;
  margin-bottom: 15px;
  gap: 10px;
}

.tab-btn {
  padding: 8px 20px;
  background-color: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  color: #555;
  transition: all 0.2s;
}

.tab-btn:hover {
  background-color: #e9ecef;
}

.tab-btn.active {
  background-color: #007bff;
  color: white;
  border-color: #007bff;
}

.search-form {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  align-items: center;
}

#searchInput {
  flex: 1;
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  min-width: 300px;
}

#searchBtn {
  padding: 10px 20px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
}

#searchBtn:hover {
  background-color: #0056b3;
}

.loading {
  text-align: center;
  padding: 40px;
  font-size: 18px;
  color: #666;
}

.hidden {
  display: none;
}

.error-message {
  color: #dc3545;
  padding: 10px;
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 4px;
  margin-bottom: 20px;
}

.results-info {
  margin-bottom: 20px;
  font-weight: bold;
  color: #555;
}

.routes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  color: #666;
  font-size: 18px;
}

.route-card {
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background: white;
  cursor: pointer; /* 增加手型光标提示可点击 */
}

.route-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.route-image {
  height: 200px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f8f9fa;
}

.route-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.no-image {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6c757d;
  font-size: 16px;
  background-color: #f8f9fa;
}

.route-info {
  padding: 15px;
}

.route-title {
  margin: 0 0 10px 0;
  font-size: 18px;
  font-weight: bold;
  color: #333;
  line-height: 1.3;
}

.route-id-container {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  font-size: 13px;
  background-color: #f0f2f5;
  padding: 4px 8px;
  border-radius: 4px;
  width: fit-content;
}

.route-id-label {
  color: #666;
  margin-right: 5px;
}

.route-id-value {
  font-weight: bold;
  font-family: monospace;
  color: #333;
  margin-right: 10px;
  font-size: 14px;
}

.copy-id-btn {
  background: none;
  border: 1px solid #ccc;
  border-radius: 3px;
  padding: 2px 6px;
  font-size: 11px;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
}

.copy-id-btn:hover {
  background-color: #e9ecef;
  color: #333;
  border-color: #bbb;
}

.copy-id-btn.copied {
  background-color: #28a745;
  color: white;
  border-color: #28a745;
}

.route-distance {
  color: #007bff;
  font-weight: bold;
  margin: 5px 0;
  font-size: 16px;
}

.route-city {
  color: #6c757d;
  margin: 5px 0;
  font-size: 14px;
}

.route-details {
  margin: 10px 0;
  padding: 10px;
  background-color: #f8f9fa;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.4;
}

.route-actions {
  margin-top: 10px;
}

.download-btn {
  background-color: #28a745;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
}

.download-btn:hover {
  background-color: #218838;
}

.share-route-btn {
  background-color: #17a2b8;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
  margin-left: 10px;
}

.share-route-btn:hover {
  background-color: #138496;
}

.share-route-btn.copied {
  background-color: #6c757d;
}

.route-details p {
  margin: 3px 0;
}

.route-date {
  color: #6c757d;
  font-size: 14px;
  margin: 10px 0 0 0;
}

.load-more-container {
  display: none;
  justify-content: center;
  margin: 30px 0;
}

.load-more-container.show {
  display: flex;
}

.load-more-btn {
  padding: 10px 40px;
  background-color: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 20px;
  cursor: pointer;
  font-size: 16px;
  color: #555;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.load-more-btn:hover {
  background-color: #e9ecef;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.load-more-btn:active {
  transform: translateY(0);
}

.pagination-container {
  margin-top: 20px;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pagination-btn {
  padding: 8px 12px;
  background-color: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  min-width: 40px;
  text-align: center;
}

.pagination-btn:hover:not(:disabled):not(.active) {
  background-color: #e9ecef;
}

.pagination-btn.active {
  background-color: #007bff;
  color: white;
  border-color: #007bff;
}

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

.pagination-ellipsis {
  padding: 8px 4px;
  color: #6c757d;
}

.scroll-to-top-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: #007bff;
  color: white;
  border: none;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  z-index: 1000;
  opacity: 1;
}

.scroll-to-top-btn:hover {
  background-color: #0056b3;
  transform: translateY(-3px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.scroll-to-top-btn.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
}

.share-btn {
  position: fixed;
  bottom: 90px; /* Above the scroll to top button */
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: #28a745;
  color: white;
  border: none;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  z-index: 1000;
}

.share-btn:hover {
  background-color: #218838;
  transform: translateY(-3px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.share-btn.copied {
  background-color: #6c757d;
  font-size: 12px;
}

@media (max-width: 768px) {
  .scroll-to-top-btn {
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  .share-btn {
    bottom: 70px;
    right: 20px;
    width: 40px;
    height: 40px;
    font-size: 12px;
  }

  .search-form {
    flex-direction: column;
    align-items: stretch;
  }
  
  #searchInput {
    min-width: auto;
  }
  
  .routes-grid {
    grid-template-columns: 1fr;
  }
  
  .pagination {
    gap: 5px;
  }
  
  .pagination-btn {
    padding: 6px 10px;
    font-size: 13px;
  }
  
  .route-image {
    height: 150px;
  }
  
  .site-footer {
    gap: 20px;
  }

  .footer-qrcode-img {
    width: 80px;
    height: 80px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .routes-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
