/* Search Page Styles */
.search-page {
    min-height: 100vh;
    background: #f8fafc;
}

/* Search Header */
.search-header {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 2rem 0;
}

.search-header-content {
    margin-bottom: 2rem;
}

.search-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.search-query {
    color: #667eea;
}

.search-stats {
    color: #6b7280;
}

/* Search Form */
.search-form-container {
    background: #f9fafb;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
}

.advanced-search-form {
    margin: 0;
}

.search-fields {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 1rem;
    align-items: end;
}

.search-field {
    display: flex;
    flex-direction: column;
}

.search-label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.search-input-container {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    z-index: 2;
}

.search-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: white;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    transition: all 0.2s ease;
}

.search-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-btn {
    padding: 0.875rem 1.5rem;
    white-space: nowrap;
}

/* Search Suggestions */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.suggestion-item {
   display: flex;
   align-items: center;
   gap: 0.75rem;
   padding: 0.75rem 1rem;
   cursor: pointer;
   transition: background-color 0.2s ease;
   border-bottom: 1px solid #f3f4f6;
}

.suggestion-item:hover {
   background: #f9fafb;
}

.suggestion-item:last-child {
   border-bottom: none;
}

.suggestion-type {
   margin-left: auto;
   font-size: 0.75rem;
   color: #6b7280;
   background: #f3f4f6;
   padding: 0.25rem 0.5rem;
   border-radius: 4px;
}

/* Filters */
.filters-toggle {
   margin-top: 1rem;
}

.filters-btn {
   display: flex;
   align-items: center;
   gap: 0.5rem;
   background: none;
   border: none;
   color: #667eea;
   font-weight: 600;
   cursor: pointer;
   padding: 0.5rem 0;
   transition: color 0.2s ease;
}

.filters-btn:hover {
   color: #5a67d8;
}

.toggle-icon {
   transition: transform 0.2s ease;
}

.filters-btn.active .toggle-icon {
   transform: rotate(180deg);
}

.search-filters {
   margin-top: 1rem;
   padding-top: 1rem;
   border-top: 1px solid #e5e7eb;
}

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

.filter-group {
   display: flex;
   flex-direction: column;
}

.filter-label {
   font-weight: 600;
   color: #374151;
   margin-bottom: 0.75rem;
   font-size: 0.875rem;
}

.rating-filters {
   display: flex;
   flex-direction: column;
   gap: 0.5rem;
}

.rating-filter {
   display: flex;
   align-items: center;
   cursor: pointer;
   padding: 0.5rem;
   border-radius: 6px;
   transition: background-color 0.2s ease;
}

.rating-filter:hover {
   background: #f3f4f6;
}

.rating-filter input[type="radio"] {
   display: none;
}

.rating-filter input[type="radio"]:checked + .rating-display {
   color: #667eea;
   font-weight: 600;
}

.rating-display {
   display: flex;
   align-items: center;
   gap: 0.5rem;
   color: #6b7280;
   transition: color 0.2s ease;
}

.checkbox-filters {
   display: flex;
   flex-direction: column;
   gap: 0.5rem;
}

.checkbox-filter {
   display: flex;
   align-items: center;
   gap: 0.75rem;
   cursor: pointer;
   padding: 0.5rem;
   border-radius: 6px;
   transition: background-color 0.2s ease;
}

.checkbox-filter:hover {
   background: #f3f4f6;
}

.checkbox-filter input[type="checkbox"] {
   display: none;
}

.checkbox-custom {
   width: 16px;
   height: 16px;
   border: 2px solid #d1d5db;
   border-radius: 4px;
   position: relative;
   transition: all 0.2s ease;
   flex-shrink: 0;
}

.checkbox-filter input[type="checkbox"]:checked + .checkbox-custom {
   background: #667eea;
   border-color: #667eea;
}

.checkbox-filter input[type="checkbox"]:checked + .checkbox-custom::after {
   content: '';
   position: absolute;
   left: 3px;
   top: 0px;
   width: 6px;
   height: 10px;
   border: solid white;
   border-width: 0 2px 2px 0;
   transform: rotate(45deg);
}

.filter-select {
   padding: 0.75rem;
   border: 2px solid #e5e7eb;
   border-radius: 6px;
   background: white;
   font-size: 0.875rem;
   width: 100%;
}

.filter-select:focus {
   outline: none;
   border-color: #667eea;
   box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filters-actions {
   display: flex;
   gap: 1rem;
   justify-content: flex-end;
}

/* Search Results */
.search-results {
   padding: 2rem 0;
}

.results-layout {
   display: grid;
   grid-template-columns: 1fr 320px;
   gap: 2rem;
   align-items: start;
}

.results-content {
   min-width: 0; /* Prevents grid overflow */
}

.results-header {
   display: flex;
   justify-content: space-between;
   align-items: center;
   margin-bottom: 1.5rem;
   padding-bottom: 1rem;
   border-bottom: 1px solid #e5e7eb;
}

.results-info {
   color: #6b7280;
}

.results-count {
   font-weight: 600;
   color: #1f2937;
}

.view-toggle {
   display: flex;
   gap: 0.5rem;
}

.view-btn {
   padding: 0.5rem;
   border: 1px solid #e5e7eb;
   background: white;
   border-radius: 6px;
   cursor: pointer;
   color: #6b7280;
   transition: all 0.2s ease;
   display: flex;
   align-items: center;
   justify-content: center;
}

.view-btn:hover,
.view-btn.active {
   background: #667eea;
   color: white;
   border-color: #667eea;
}

.results-grid {
   display: grid;
   grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
   gap: 1.5rem;
   width: 100%;
}

.results-grid.list-view {
   grid-template-columns: 1fr;
}

.results-grid.list-view .business-card {
   display: flex;
   flex-direction: row;
}

.results-grid.list-view .business-image {
   width: 200px;
   height: 150px;
   flex-shrink: 0;
}

.results-grid.list-view .business-content {
   flex: 1;
}

/* Business Cards */
.business-card {
   background: white;
   border-radius: 12px;
   overflow: hidden;
   box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
   transition: all 0.3s ease;
   border: 1px solid #e5e7eb;
   position: relative;
}

.business-card:hover {
   transform: translateY(-4px);
   box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.business-image {
   position: relative;
   height: 200px;
   overflow: hidden;
   background: #f3f4f6;
}

.business-image img {
   width: 100%;
   height: 100%;
   object-fit: cover;
   transition: transform 0.3s ease;
}

.business-card:hover .business-image img {
   transform: scale(1.05);
}

.business-image-placeholder {
   width: 100%;
   height: 100%;
   display: flex;
   align-items: center;
   justify-content: center;
   background: #f3f4f6;
   color: #9ca3af;
}

.business-badges {
   position: absolute;
   top: 0.75rem;
   left: 0.75rem;
   display: flex;
   flex-direction: column;
   gap: 0.5rem;
   z-index: 2;
}

.badge {
   display: flex;
   align-items: center;
   gap: 0.25rem;
   padding: 0.25rem 0.5rem;
   border-radius: 4px;
   font-size: 0.75rem;
   font-weight: 600;
   text-transform: uppercase;
   backdrop-filter: blur(4px);
}

.badge.verified {
   background: rgba(5, 150, 105, 0.9);
   color: white;
}

.badge.featured {
   background: rgba(245, 158, 11, 0.9);
   color: white;
}

.favorite-btn {
   position: absolute;
   top: 0.75rem;
   right: 0.75rem;
   width: 36px;
   height: 36px;
   border-radius: 50%;
   background: rgba(255, 255, 255, 0.9);
   border: none;
   display: flex;
   align-items: center;
   justify-content: center;
   cursor: pointer;
   transition: all 0.3s ease;
   color: #6b7280;
   z-index: 2;
   backdrop-filter: blur(4px);
}

.favorite-btn:hover {
   background: white;
   color: #dc2626;
   transform: scale(1.1);
}

.favorite-btn.favorited {
   color: #dc2626;
   background: rgba(255, 255, 255, 0.95);
}

.favorite-btn.animate {
   animation: heartBeat 0.3s ease;
}

@keyframes heartBeat {
   0%, 100% { transform: scale(1); }
   50% { transform: scale(1.2); }
}

.business-content {
   padding: 1.5rem;
}

.business-header {
   margin-bottom: 1rem;
}

.business-name {
   margin: 0 0 0.5rem 0;
   font-size: 1.25rem;
   font-weight: 700;
   line-height: 1.3;
}

.business-name a {
   color: #1f2937;
   text-decoration: none;
   transition: color 0.2s ease;
}

.business-name a:hover {
   color: #667eea;
}

.business-rating {
   display: flex;
   align-items: center;
   gap: 0.5rem;
   margin-top: 0.5rem;
}

.stars {
   display: flex;
   gap: 0.125rem;
}

.star {
   color: #fbbf24;
   font-size: 0.875rem;
}

.rating-score {
   font-weight: 600;
   color: #1f2937;
   font-size: 0.875rem;
}

.rating-count {
   color: #6b7280;
   font-size: 0.875rem;
}

.business-meta {
   display: ruby;
   flex-direction: column;
   gap: 0.5rem;
   margin-bottom: 1rem;
}

.business-category,
.business-location {
   display: flex;
   align-items: center;
   gap: 0.5rem;
   color: #6b7280;
   font-size: 0.875rem;
}

.business-description {
   color: #6b7280;
   margin-bottom: 1.5rem;
   line-height: 1.6;
   font-size: 0.875rem;
}

.business-actions {
   display: flex;
   gap: 0.75rem;
}

.btn-small {
   padding: 0.5rem 1rem;
   font-size: 0.875rem;
   flex: 1;
   text-align: center;
   white-space: nowrap;
}

/* Pagination */
.pagination-container {
   margin-top: 3rem;
   display: flex;
   justify-content: center;
}

.pagination {
   display: flex;
   align-items: center;
   gap: 0.5rem;
   flex-wrap: wrap;
}

.pagination-btn {
   display: flex;
   align-items: center;
   gap: 0.25rem;
   padding: 0.5rem 0.75rem;
   border: 1px solid #e5e7eb;
   background: white;
   color: #6b7280;
   text-decoration: none;
   border-radius: 6px;
   font-weight: 500;
   transition: all 0.2s ease;
   min-width: 44px;
   justify-content: center;
}

.pagination-btn:hover {
   background: #f3f4f6;
   color: #374151;
   transform: translateY(-1px);
}

.pagination-current {
   background: #667eea;
   color: white;
   border-color: #667eea;
}

.pagination-dots {
   padding: 0.5rem;
   color: #9ca3af;
}

/* No Results */
.no-results {
   text-align: center;
   padding: 4rem 2rem;
   background: white;
   border-radius: 12px;
   margin: 2rem 0;
}

.no-results-icon {
   margin-bottom: 2rem;
   color: #9ca3af;
   display: flex;
   justify-content: center;
}

.no-results h3 {
   font-size: 1.5rem;
   font-weight: 700;
   color: #1f2937;
   margin-bottom: 1rem;
}

.no-results p {
   color: #6b7280;
   margin-bottom: 2rem;
   font-size: 1.125rem;
}

.no-results-suggestions {
   text-align: left;
   background: #f9fafb;
   padding: 1.5rem;
   border-radius: 8px;
   margin: 2rem auto;
   max-width: 400px;
}

.no-results-suggestions h4 {
   font-weight: 600;
   color: #374151;
   margin-bottom: 1rem;
}

.no-results-suggestions ul {
   list-style: none;
   padding: 0;
   margin: 0;
}

.no-results-suggestions li {
   padding: 0.5rem 0;
   color: #6b7280;
   position: relative;
   padding-left: 1.5rem;
}

.no-results-suggestions li::before {
   content: '•';
   position: absolute;
   left: 0;
   color: #667eea;
   font-weight: bold;
}

.no-results-actions {
   display: flex;
   gap: 1rem;
   justify-content: center;
   flex-wrap: wrap;
}

/* Sidebar */
.search-sidebar {
   display: flex;
   flex-direction: column;
   gap: 1.5rem;
   position: sticky;
   top: 2rem;
   height: fit-content;
}

.sidebar-card {
   background: white;
   border-radius: 12px;
   padding: 1.5rem;
   border: 1px solid #e5e7eb;
   box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.sidebar-title {
   font-size: 1.125rem;
   font-weight: 700;
   color: #1f2937;
   margin-bottom: 1rem;
}

.category-list,
.city-list {
   display: flex;
   flex-direction: column;
   gap: 0.25rem;
}

.category-item,
.city-item {
   display: flex;
   justify-content: space-between;
   align-items: center;
   padding: 0.75rem;
   border-radius: 6px;
   text-decoration: none;
   color: #374151;
   transition: all 0.2s ease;
   font-size: 0.875rem;
}

.category-item:hover,
.city-item:hover {
   background: #f3f4f6;
   color: #667eea;
   transform: translateX(4px);
}

.category-count,
.city-count {
   background: #e5e7eb;
   color: #6b7280;
   padding: 0.25rem 0.5rem;
   border-radius: 12px;
   font-size: 0.75rem;
   font-weight: 600;
   min-width: 24px;
   text-align: center;
}

.recent-searches {
   display: flex;
   flex-direction: column;
   gap: 0.25rem;
}

.recent-search-item {
   display: flex;
   align-items: center;
   gap: 0.75rem;
   padding: 0.75rem;
   border-radius: 6px;
   text-decoration: none;
   color: #6b7280;
   font-size: 0.875rem;
   transition: all 0.2s ease;
}

.recent-search-item:hover {
   background: #f3f4f6;
   color: #374151;
   transform: translateX(4px);
}

/* Responsive Design */
@media (max-width: 1200px) {
   .results-layout {
       grid-template-columns: 1fr 280px;
       gap: 1.5rem;
   }
}

@media (max-width: 1024px) {
   .search-fields {
       grid-template-columns: 1fr 1fr;
       gap: 1rem;
   }
   
   .search-field:last-child {
       grid-column: 1 / -1;
   }
   
   .results-layout {
       grid-template-columns: 1fr;
       gap: 1.5rem;
   }
   
   .search-sidebar {
       order: -1;
       position: static;
       display: grid;
       grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
       gap: 1rem;
   }
   
   .results-grid {
       grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
   }
}

@media (max-width: 768px) {
   .search-header {
       padding: 1rem 0;
   }
   
   .search-title {
       font-size: 1.5rem;
       line-height: 1.3;
   }
   
   .search-form-container {
       padding: 1rem;
       margin: 0;
       border-radius: 8px;
   }
   
   .search-fields {
       grid-template-columns: 1fr;
       gap: 1rem;
   }
   
   .filters-grid {
       grid-template-columns: 1fr;
       gap: 1rem;
   }
   
   .filters-actions {
       flex-direction: column;
       gap: 0.75rem;
   }
   
   .results-grid {
       grid-template-columns: 1fr;
       gap: 1rem;
   }
   
   .results-grid.list-view .business-card {
       flex-direction: column;
   }
   
   .results-grid.list-view .business-image {
       width: 100%;
       height: 200px;
   }
   
   .business-card {
       margin-bottom: 0;
   }
   
   .business-image {
       height: 180px;
   }
   
   .business-content {
       padding: 1rem;
   }
   
   .business-actions {
       flex-direction: column;
       gap: 0.5rem;
   }
   
   .btn-small {
       width: 100%;
   }
   
   .no-results-actions {
       flex-direction: column;
       gap: 0.75rem;
   }
   
   .search-sidebar {
       grid-template-columns: 1fr;
   }
   
   .view-toggle {
       display: none;
   }
   
   .pagination {
       justify-content: center;
       gap: 0.25rem;
   }
   
   .pagination-btn {
       padding: 0.5rem;
       min-width: 40px;
       font-size: 0.875rem;
   }
}

@media (max-width: 480px) {
   .container {
       padding-left: 1rem;
       padding-right: 1rem;
   }
   
   .search-results {
       padding: 1rem 0;
   }
   
   .business-card {
       border-radius: 8px;
       box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
   }
   
   .business-image {
       height: 160px;
   }
   
   .business-content {
       padding: 1rem;
   }
   
   .business-name {
       font-size: 1.125rem;
   }
   
   .btn-small {
       padding: 0.625rem 1rem;
       font-size: 0.8rem;
   }
   
   .sidebar-card {
       padding: 1rem;
   }
   
   .no-results {
       padding: 2rem 1rem;
   }
   
   .search-sidebar {
        order: 0;
    }
   
   
}

/* Loading States */
.loading-skeleton {
   background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
   background-size: 200% 100%;
   animation: loading 1.5s infinite;
}

@keyframes loading {
   0% {
       background-position: 200% 0;
   }
   100% {
       background-position: -200% 0;
   }
}

.business-card.loading .business-image {
   background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
   background-size: 200% 100%;
   animation: loading 1.5s infinite;
}

/* Print Styles */
@media print {
   .search-header,
   .search-sidebar,
   .pagination-container,
   .business-actions,
   .favorite-btn {
       display: none;
   }
   
   .business-card {
       box-shadow: none;
       border: 1px solid #e5e7eb;
       break-inside: avoid;
       margin-bottom: 1rem;
   }
   
   .results-grid {
       grid-template-columns: repeat(2, 1fr);
       gap: 1rem;
   }
}


/* Loading Spinner */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
    color: #6b7280;
    font-weight: 500;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Toast Styles */
.toast {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.875rem;
    line-height: 1.4;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.toast-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    margin-left: 0.5rem;
    flex-shrink: 0;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Search Suggestions Highlighting */
.suggestion-item.highlighted {
    background: #f3f4f6;
    color: #374151;
}

/* Enhanced Business Card Hover Effects */
.business-card {
    transform-origin: center;
}

.business-card:hover {
    transform: translateY(-4px) scale(1.02);
}

.business-card:active {
    transform: translateY(-2px) scale(1.01);
}

/* Loading States for Images */
.business-image img.lazy {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.business-image img:not(.lazy) {
    opacity: 1;
}

/* Smooth transitions for view changes */
.results-grid {
    transition: all 0.3s ease;
}

.business-card {
    transition: all 0.3s ease;
}

/* Focus states for accessibility */
.search-input:focus,
.search-select:focus,
.filter-select:focus {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.view-btn:focus,
.pagination-btn:focus,
.btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .business-card {
        border-width: 2px;
    }
    
    .badge {
        border: 1px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}