/**
 * Property Cards Styles
 * 
 * Unified card styling for all property listings
 * 
 * @package Olias_Property_Filter
 */

/* Properties Grid Layout */
.olias-properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Property Card Base */
.olias-property-card {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.olias-property-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.olias-property-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* Property Image */
.olias-property-image {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 2;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Location Pill */
.olias-location-pill {
    position: absolute;
    bottom: .75rem;
    left: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem !important;
    background: rgba(193, 193, 193, 0.5);
    color: #ffffff;
    padding: 0.45rem 0.75rem;
    border-radius: 50px;
    backdrop-filter: blur(8px);
}

.olias-location-pin-icon {
    width: 16px !important;
    height: auto !important;
    object-fit: contain;
}

.olias-location-pill-text {
    font-size: var(--small-fluid) !important;
    font-weight: 300;
}

/* Property Content */
.olias-property-content {
    padding: 1rem 1.5rem;
    background-color: #f3f3f3;
}

.olias-property-title {
    font-size: 1.25rem;
    font-weight: 500;
    margin: 0;
    color: #455249;
    line-height: 1.4;
    letter-spacing: -0.25px;
}

.olias-short-description {
    font-size: var(--p-fluid) !important;
    color: #666;
    margin: 0 0 1rem 0;
    line-height: 1.6;
}

/* Highlights */
.olias-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.olias-highlight-item {
    display: inline-block;
    background: #fff;
    color: #333;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: var(--small-fluid) !important;
    font-weight: 300;
}

/* Loop Results Header */
.olias-loop-results-header {
    margin-bottom: 1.5rem;
}

.olias-loop-results-count {
    font-size: 1rem;
    color: #666;
    font-weight: 500;
}

/* No Results */
.olias-no-results {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #666;
}

.olias-no-results p {
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
}

/* Load More Button */
.olias-load-more-container {
    text-align: center;
    margin-top: 2rem;
}

.olias-load-more-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.olias-load-more-btn.loading {
    pointer-events: none;
}

.olias-load-more-btn .olias-btn-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: olias-spin 0.6s linear infinite;
}

.olias-load-more-btn.loading .olias-btn-spinner {
    display: inline-block;
}

/* Card Animation - Robust Transition-Based Approach */
/* Base Card Style - Default Visible (Progressive Enhancement) */
.olias-property-card {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
    will-change: opacity, transform;
}

/* State: Pending (Hidden, ready to animate) */
.olias-property-card[data-animate="pending"] {
    opacity: 0;
    transform: translateY(12px);
    transition: none;
}

/* State: Active (Animating in) */
.olias-property-card[data-animate="active"] {
    opacity: 1;
    transform: translateY(0);
}

/* State: Complete (Cleanup after animation) */
.olias-property-card[data-animate="complete"] {
    will-change: auto;
}

/* Skeleton cards fade in smoothly */
.olias-property-card.olias-skeleton-card {
    opacity: 0;
    animation: olias-skeleton-fade-in 0.3s ease-out forwards;
}

@keyframes olias-skeleton-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Skeleton Loaders */
.olias-skeleton-card {
    pointer-events: none;
}

.olias-skeleton-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: olias-skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 50px;
}

@keyframes olias-skeleton-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Skeleton specific elements */
.olias-skeleton-card .olias-property-image {
    background-image: none !important;
}

.olias-skeleton-title {
    height: 1.75rem;
    width: 80%;
    margin-bottom: 0.75rem;
}

.olias-skeleton-description {
    height: 1.75rem;
    width: 100%;
    margin-bottom: 1rem;
}

.olias-skeleton-card .olias-highlight-item {
    height: 1.5rem;
    width: 80px;
    color: transparent;
}

/* Varying widths for visual interest */
.olias-skeleton-card .olias-highlight-item:nth-child(1) { width: 70px; }
.olias-skeleton-card .olias-highlight-item:nth-child(2) { width: 90px; }
.olias-skeleton-card .olias-highlight-item:nth-child(3) { width: 75px; }
.olias-skeleton-card .olias-highlight-item:nth-child(4) { width: 85px; }
.olias-skeleton-card .olias-highlight-item:nth-child(5) { width: 95px; }
.olias-skeleton-card .olias-highlight-item:nth-child(6) { width: 80px; }
.olias-skeleton-card .olias-highlight-item:nth-child(7) { width: 88px; }

/* Hide real content in skeleton */
.olias-skeleton-card .olias-location-pill {
    display: none;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .olias-properties-grid {
        grid-template-columns: 1fr;
    }
    
    .olias-property-image {
        min-height: 200px;
    }
    
    .olias-property-content {
        padding: 1rem;
    }
    
    .olias-property-title {
        font-size: 1.125rem;
    }
}
