/* ============================================
   Property Search Page Styles
   ============================================ */

/* Property Image Aspect Ratio Fix - Only for property-grid sections */
.property-grid .property-image {
    position: relative;
    width: 100%;
    padding-top: 66.67%; /* 3:2 aspect ratio */
    overflow: hidden;
}

.property-grid .property-image .property-slider,
.property-grid .property-image .property-slider a,
.property-grid .property-image .property-slider img.bg-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Property Cards - Equal Height */
.property-grid .col-xl-4,
.property-grid .col-md-6 {
    display: flex;
    margin-bottom: 30px;
}

.property-grid .property-box {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.property-grid .property-details {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.property-grid .property-details p {
    flex-grow: 1;
}

.property-grid .property-details ul,
.property-grid .property-btn {
    margin-top: auto;
}

/* Agency Logo Badge */
.agency-logo-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: white;
    border-radius: 4px;
    padding: 4px 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

.agency-logo-badge img {
    max-width: 50px;
    max-height: 35px;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
}

/* Property Type Badge */
.location-type-wrapper {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.property-location {
    color: #666;
    font-size: 14px;
}

/* Property Type Badge - ONLY for property cards (not main property detail) */
.property-box .property-type-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

/* Sidebar Filter Form */
.advance-card .form-group {
    margin-bottom: 15px;
}

.advance-card .form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.advance-card .form-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* ============================================
   Loading States & Animations
   ============================================ */

/* Loading Overlay */
.search-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.search-loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Results Container Transitions */
.property-results-container {
    transition: opacity 0.3s ease;
}

.property-results-container.loading {
    opacity: 0.4;
    pointer-events: none;
}

/* Property Cards Fade-In Animation */
.property-box.fade-in {
    animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger animation delays for cards */
.property-box.fade-in:nth-child(1) { animation-delay: 0.05s; }
.property-box.fade-in:nth-child(2) { animation-delay: 0.1s; }
.property-box.fade-in:nth-child(3) { animation-delay: 0.15s; }
.property-box.fade-in:nth-child(4) { animation-delay: 0.2s; }
.property-box.fade-in:nth-child(5) { animation-delay: 0.25s; }
.property-box.fade-in:nth-child(6) { animation-delay: 0.3s; }
.property-box.fade-in:nth-child(7) { animation-delay: 0.35s; }
.property-box.fade-in:nth-child(8) { animation-delay: 0.4s; }
.property-box.fade-in:nth-child(9) { animation-delay: 0.45s; }

/* ============================================
   Skeleton Loaders
   ============================================ */

.skeleton-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.skeleton-image {
    width: 100%;
    height: 260px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-content {
    padding: 20px;
    flex-grow: 1;
}

.skeleton-line {
    height: 16px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 12px;
}

.skeleton-line.title {
    width: 80%;
    height: 20px;
}

.skeleton-line.subtitle {
    width: 60%;
    height: 16px;
}

.skeleton-line.price {
    width: 40%;
    height: 24px;
    margin-bottom: 16px;
}

.skeleton-line.text {
    width: 100%;
}

.skeleton-line.text-short {
    width: 70%;
}

.skeleton-features {
    display: flex;
    gap: 16px;
    margin: 16px 0;
}

.skeleton-feature {
    width: 60px;
    height: 16px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton-button {
    width: 100%;
    height: 40px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    margin-top: 16px;
}

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

/* ============================================
   Toast Notifications
   ============================================ */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    min-width: 300px;
    max-width: 500px;
    padding: 16px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    pointer-events: all;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.hide {
    opacity: 0;
    transform: translateX(100%);
}

.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
}

.toast-success .toast-icon {
    background: #28a745;
}

.toast-error .toast-icon {
    background: #dc3545;
}

.toast-warning .toast-icon {
    background: #ffc107;
    color: #333;
}

.toast-info .toast-icon {
    background: #17a2b8;
}

.toast-content {
    flex-grow: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 14px;
    color: #333;
}

.toast-message {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #999;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.toast-close:hover {
    color: #333;
}

/* ============================================
   Result Counter Animation
   ============================================ */

.result-count {
    transition: all 0.3s ease;
}

.result-count.updating {
    opacity: 0.5;
    transform: scale(0.95);
}

/* ============================================
   Sticky Filter Sidebar
   ============================================ */

@media (min-width: 992px) {
    .sticky-filter-sidebar {
        position: sticky;
        top: 100px;
        max-height: calc(100vh - 120px);
        overflow-y: auto;
    }
}

/* ============================================
   Search Button States
   ============================================ */

.search-btn-loading {
    position: relative;
    pointer-events: none;
}

.search-btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ============================================
   Responsive Adjustments
   ============================================ */

@media (max-width: 767px) {
    .toast-container {
        left: 20px;
        right: 20px;
    }

    .toast {
        min-width: auto;
        width: 100%;
    }
    
    .search-loading-spinner {
        width: 50px;
        height: 50px;
    }
}
