/* Infinite Scroll Pagination Styles */

.infinite-scroll-controls {
    margin-top: 2rem;
}

#infinite-scroll-trigger {
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#load-more-btn {
    min-width: 200px;
    position: relative;
    transition: all 0.3s ease;
}

#load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

#load-more-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

#end-of-results {
    padding: 2rem 1rem;
    border-radius: 8px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
}

#end-of-results p {
    margin: 0;
    font-size: 1.1rem;
}

#end-of-results i {
    color: #28a745;
}

/* Loading spinner styles */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Smooth property card animations */
.properties .col-lg-4,
.properties .col-md-6 {
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.properties .col-lg-4:nth-child(1),
.properties .col-md-6:nth-child(1) { animation-delay: 0.1s; }
.properties .col-lg-4:nth-child(2),
.properties .col-md-6:nth-child(2) { animation-delay: 0.2s; }
.properties .col-lg-4:nth-child(3),
.properties .col-md-6:nth-child(3) { animation-delay: 0.3s; }
.properties .col-lg-4:nth-child(4),
.properties .col-md-6:nth-child(4) { animation-delay: 0.4s; }
.properties .col-lg-4:nth-child(5),
.properties .col-md-6:nth-child(5) { animation-delay: 0.5s; }
.properties .col-lg-4:nth-child(6),
.properties .col-md-6:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive improvements */
@media (max-width: 768px) {
    #load-more-btn {
        min-width: 100%;
        padding: 0.75rem 1.5rem;
    }
    
    .infinite-scroll-controls {
        margin-top: 1.5rem;
    }
    
    #end-of-results {
        padding: 1.5rem 1rem;
    }
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    #end-of-results {
        background-color: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .properties .col-lg-4,
    .properties .col-md-6 {
        animation: none;
        opacity: 1;
    }
    
    #load-more-btn:hover {
        transform: none;
    }
}

/* Focus styles for accessibility */
#load-more-btn:focus {
    outline: 2px solid var(--color-primary, #007bff);
    outline-offset: 2px;
}

/* Loading state styles */
.loading-more .properties {
    pointer-events: none;
    opacity: 0.7;
}

/* Error state styles */
.load-error {
    padding: 1rem;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    color: #721c24;
    text-align: center;
    margin-top: 1rem;
}

/* ============================================
   Unified Category Select Styles
   ============================================ */

/* Style the unified category select */
#unified_category_select {
    font-size: 0.95rem;
}

/* Style optgroups */
#unified_category_select optgroup {
    font-weight: bold;
    color: #495057;
    background-color: #f8f9fa;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Style options within optgroups */
#unified_category_select optgroup option {
    font-weight: normal;
    color: #212529;
    background-color: white;
    padding-left: 1rem;
    text-transform: none;
    letter-spacing: normal;
}

/* Type-level options (All Residential, etc.) */
#unified_category_select option[value^="type_"] {
    font-weight: 600;
    color: #0d6efd;
    background-color: #f0f8ff;
}

/* All categories option */
#unified_category_select option[value="all"] {
    font-weight: bold;
    color: #198754;
    background-color: #f0fff4;
}

/* Individual category options */
#unified_category_select option:not([value="all"]):not([value^="type_"]) {
    padding-left: 1.5rem;
    color: #495057;
}

/* Hover states for better UX */
#unified_category_select option:hover {
    background-color: #e9ecef !important;
}

/* Focus states for accessibility */
#unified_category_select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Mobile responsive */
@media (max-width: 768px) {
    #unified_category_select {
        font-size: 1rem;
    }
    
    #unified_category_select optgroup {
        font-size: 0.85rem;
    }
}
