/**
 * Google Places Autocomplete Enhanced Styling
 * Custom styling for the autocomplete dropdown to match the theme
 */

/* Container styling */
.pac-container {
    border-radius: 10px;
    margin-top: 5px;
    border: none;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    overflow: hidden;
    background: #ffffff;
    padding: 8px 0;
    max-height: 350px;
    overflow-y: auto;
    z-index: 9999 !important;
  }
  
  /* Item styling */
  .pac-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
    overflow: hidden;
  }
  
  .pac-item:last-child {
    border-bottom: none;
  }
  
  .pac-item:first-child {
    border-top: none;
  }
  
  .pac-item:hover {
    background-color: #f9f9f9;
  }
  
  .pac-item-selected,
  .pac-item-selected:hover {
    background-color: #FFF5E6;
  }
  
  /* Icon styling */
  .pac-icon {
    width: 22px;
    height: 22px;
    margin-right: 14px;
    flex-shrink: 0;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.8;
  }
  
  /* Match styling */
  .pac-item-query {
    font-weight: 500;
    color: #333333;
    font-size: 15px;
    line-height: 1.4;
    flex: 1;
  }
  
  .pac-matched {
    font-weight: 600;
    color: #000000;
    position: relative;
  }
  
  /* Secondary text */
  .pac-item-secondary {
    color: #666666;
    font-size: 13px;
    margin-top: 3px;
    display: inline-block !important;
    opacity: 0.8;
  }
  
  /* Scrollbar styling */
  .pac-container::-webkit-scrollbar {
    width: 6px;
  }
  
  .pac-container::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 4px;
  }
  
  .pac-container::-webkit-scrollbar-thumb {
    background: #dddddd;
    border-radius: 4px;
  }
  
  .pac-container::-webkit-scrollbar-thumb:hover {
    background: #cccccc;
  }
  
  /* Remove "Powered by Google" text */
  .pac-container:after {
    background-image: none !important;
    height: auto;
    padding: 8px 16px;
    color: #999999;
    font-size: 11px;
    font-style: italic;
    text-align: right;
    content: "Google Places";
    border-top: 1px solid #f0f0f0;
  }
  
  /* Highlighted text */
  .pac-matched {
    color: #FFA633;
    font-weight: 600;
  }
  
  /* Theme-specific styling for icons */
  .pac-icon,
  .pac-item-icon {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  .pac-icon-marker,
  .pac-icon-search {
    background-image: url("/build/img/pac/gps.png") !important;
  }
  
  .pac-icon-city {
    background-image: url("/build/img/pac/city-icon.png") !important;
  }
  
  .pac-icon-airport {
    background-image: url("/build/img/pac/airport-icon.png") !important;
  }
  
  .pac-icon-station {
    background-image: url("/build/img/pac/station-icon.png") !important;
  }
  
  .pac-icon-landmark {
    background-image: url("/build/img/pac/gps.png") !important;
  }
  
  .pac-icon-hotel {
    background-image: url("/build/img/pac/hotel-icon.png") !important;
  }
  
  /* Empty results styling */
  .pac-container:empty {
    display: none;
  }
  
  /* Animation for appearing */
  @keyframes fadeIn {
    from {
      opacity: 0;
      transform: translateY(5px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .pac-container {
    animation: fadeIn 0.2s ease-out;
  }
  
  /* Mobile responsiveness */
  @media screen and (max-width: 768px) {
    .pac-container {
      max-height: 280px;
      width: 100% !important;
      left: 0 !important;
      right: 0 !important;
      z-index: 9999 !important;
      padding: 5px 0;
      border-radius: 8px;
    }
    
    .pac-item {
      padding: 14px 16px;
      display: flex !important;
      align-items: center !important;
    }
    
    .pac-icon,
    .pac-item-query,
    .pac-item-secondary {
      display: block !important;
    }
    
    .pac-icon {
      width: 24px !important;
      height: 24px !important;
      margin-right: 12px !important;
      flex-shrink: 0 !important;
    }
    
    .pac-item-query {
      font-size: 16px;
    }
    
    .pac-item-secondary {
      font-size: 14px;
      margin-top: 4px;
      display: block !important;
    }
  }
  
  @media screen and (max-width: 480px) {
    .pac-container {
      max-height: 220px;
    }
    
    .pac-item {
      padding: 12px 14px;
    }
    
    .pac-icon {
      width: 22px !important;
      height: 22px !important;
    }
    
    .pac-item-query {
      font-size: 15px;
    }
    
    .pac-item-secondary {
      font-size: 13px;
    }
    
    .pac-container:after {
      padding: 6px 14px;
      font-size: 10px;
    }
  }
  
  /* Styling when rendered inside modal */
  .modal .pac-container {
    z-index: 10000 !important;
  }
  
  /* Dark mode support (if your app supports it) */
  @media (prefers-color-scheme: dark) {
    .dark-mode .pac-container {
      background: #1f2937;
      border-color: #374151;
      box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    }
    
    .dark-mode .pac-item {
      border-bottom: 1px solid #374151;
    }
    
    .dark-mode .pac-item:hover {
      background-color: #2d3748;
    }
    
    .dark-mode .pac-item-selected,
    .dark-mode .pac-item-selected:hover {
      background-color: #3b4659;
    }
    
    .dark-mode .pac-item-query {
      color: #e5e7eb;
    }
    
    .dark-mode .pac-matched {
      color: #FFA633;
    }
    
    .dark-mode .pac-item-secondary {
      color: #9ca3af;
    }
    
    .dark-mode .pac-container:after {
      color: #6b7280;
      border-top: 1px solid #374151;
    }
    
    .dark-mode .pac-container::-webkit-scrollbar-track {
      background: #2d3748;
    }
    
    .dark-mode .pac-container::-webkit-scrollbar-thumb {
      background: #4b5563;
    }
    
    .dark-mode .pac-container::-webkit-scrollbar-thumb:hover {
      background: #6b7280;
    }
  }
  