/* ========================================
   Mobile Search UX Improvements
   Prevents endless scrolling on mobile
   ======================================== */

/* ========================================
   HIDE SECTIONS ON MOBILE
   ======================================== */
@media (max-width: 768px) {
    /* Hide "Catégories populaires" section on mobile homepage */
    .featured-categories {
        display: none !important;
    }
}

/* ========================================
   COMPACT CARD VIEW FOR MOBILE
   ======================================== */
@media (max-width: 768px) {
    
    /* Search results grid - single column on mobile */
    .search-results-grid,
    .business-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    /* Compact business card on mobile */
    .business-card.card {
        display: flex;
        flex-direction: row;
        padding: 0;
        border-radius: 12px;
        overflow: hidden;
        min-height: auto;
    }
    
    /* Compact image container */
    .business-card .business-image-container {
        width: 100px;
        min-width: 100px;
        height: 100px;
        flex-shrink: 0;
    }
    
    .business-card .business-image,
    .business-card .business-placeholder {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 12px 0 0 12px;
    }
    
    .business-card .business-placeholder i {
        font-size: 1.5rem !important;
    }
    
    .business-card .business-placeholder span {
        font-size: 1rem !important;
    }
    
    /* Hide badges on compact mobile view */
    .business-card .business-badges {
        position: absolute;
        top: 4px;
        left: 4px;
        right: auto;
    }
    
    .business-card .badge {
        font-size: 0.6rem !important;
        padding: 2px 4px !important;
    }
    
    /* Compact info section */
    .business-card .business-info.card-body {
        padding: 0.75rem !important;
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .business-card .business-header {
        margin-bottom: 0.25rem !important;
    }
    
    .business-card .business-title {
        font-size: 0.95rem !important;
        line-height: 1.2 !important;
        margin: 0 !important;
    }
    
    .business-card .business-title a {
        display: -webkit-box;
        -webkit-line-clamp: 1;
        line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .business-card .business-category {
        font-size: 0.75rem !important;
        margin-top: 2px !important;
    }
    
    .business-card .business-location {
        font-size: 0.75rem !important;
        margin: 0.25rem 0 !important;
    }
    
    /* Hide less important elements on compact mobile */
    .business-card .business-address,
    .business-card .business-price,
    .business-card .business-excerpt,
    .business-card .business-features,
    .business-card .business-quick-actions {
        display: none !important;
    }
    
    /* Compact actions - only show main CTA */
    .business-card .business-actions {
        display: flex;
        gap: 0.5rem;
        margin-top: 0.5rem !important;
        padding: 0 !important;
    }
    
    .business-card .business-actions .btn {
        padding: 0.4rem 0.6rem !important;
        font-size: 0.75rem !important;
        flex: 0 0 auto;
    }
    
    /* Only show "Voir" and "Appeler" buttons on compact mobile */
    .business-card .business-actions .btn-whatsapp,
    .business-card .business-actions .btn-secondary {
        display: none !important;
    }
    
    .business-card .business-actions .btn i {
        margin-right: 4px;
    }
}

/* ========================================
   PAGINATION CONTROLS
   ======================================== */
.search-pagination-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 0;
    margin-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.pagination-info {
    text-align: center;
    color: #6b7280;
    font-size: 0.9rem;
}

.pagination-info strong {
    color: #374151;
}

.pagination-progress {
    width: 100%;
    max-width: 300px;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}

.pagination-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #00b894, #00a085);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.load-more-btn {
    background: linear-gradient(135deg, #00b894 0%, #00a085 100%) !important;
    color: white !important;
    padding: 0.875rem 2rem !important;
    border-radius: 25px !important;
    border: none !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    box-shadow: 0 4px 12px rgba(0, 184, 148, 0.3);
    transition: all 0.3s ease;
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 184, 148, 0.4);
}

.load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ========================================
   RESULTS HEADER MOBILE
   ======================================== */
@media (max-width: 768px) {
    .search-results-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.75rem !important;
    }
    
    .search-results-header h2 {
        font-size: 1.25rem !important;
    }
    
    .results-count {
        font-size: 0.85rem !important;
    }
    
    #clear-search {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   VIEW MODE TOGGLE
   ======================================== */
.view-mode-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.view-mode-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.view-mode-btn.active {
    border-color: #00b894;
    background: rgba(0, 184, 148, 0.1);
    color: #00b894;
}

.view-mode-btn:hover:not(.active) {
    border-color: #d1d5db;
    background: #f9fafb;
}

@media (max-width: 768px) {
    .view-mode-toggle {
        display: none; /* Hide on mobile - always use compact view */
    }
}

/* ========================================
   RESULTS SUMMARY BAR
   ======================================== */
.results-summary-bar {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.results-summary-bar .summary-text {
    color: #166534;
    font-size: 0.9rem;
    font-weight: 500;
}

.results-summary-bar .summary-text strong {
    color: #15803d;
}

.results-summary-bar .filter-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-tag {
    background: white;
    border: 1px solid #86efac;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    color: #166534;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-tag .remove-filter {
    cursor: pointer;
    color: #dc2626;
    font-weight: bold;
}

/* ========================================
   NO MORE RESULTS MESSAGE
   ======================================== */
.no-more-results {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
    background: #f9fafb;
    border-radius: 12px;
    margin-top: 1rem;
}

.no-more-results i {
    font-size: 2rem;
    color: #00b894;
    margin-bottom: 0.5rem;
}

.no-more-results p {
    margin: 0;
    font-size: 0.95rem;
}

/* ========================================
   LOADING STATE IMPROVEMENT
   ======================================== */
.loading-spinner {
    padding: 3rem !important;
}

.loading-spinner i {
    color: #00b894 !important;
}

/* Skeleton loading cards */
.skeleton-card {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    gap: 1rem;
    animation: pulse 1.5s infinite;
}

.skeleton-image {
    width: 100px;
    height: 100px;
    background: #e5e7eb;
    border-radius: 8px;
}

.skeleton-content {
    flex: 1;
}

.skeleton-line {
    height: 12px;
    background: #e5e7eb;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.skeleton-line.short {
    width: 60%;
}

.skeleton-line.medium {
    width: 80%;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
