/**
 * Property Search Styling
 * Enhanced styles for the property selection dropdown with animations and selected state
 */

.property-search-wrapper {
    position: relative;
    width: 100%;
}

.property-search-input-container {
    position: relative;
    width: 100%;
}

.property-search-input {
    width: 100%;
    padding: 14px 16px;
    padding-right: 45px; /* Make room for spinner */
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background-color: #fff;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.property-search-input:focus {
    outline: none;
    border-color: #0c5948;
    box-shadow: 0 0 0 3px rgba(12, 89, 72, 0.08), 0 1px 3px rgba(0, 0, 0, 0.1);
}

.property-search-input::placeholder {
    color: #999;
}

.property-search-spinner {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 2px solid #e0e0e0;
    border-left-color: #0c5948;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

/* Selected Property Display */
.property-selected-display {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #f9f9f9;
    padding: 16px;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.property-selected-display:hover {
    border-color: #d0d0d0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.property-selected-display .property-item-content {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.property-selected-display .property-thumbnail,
.property-selected-display .property-thumbnail-placeholder {
    width: 80px;
    height: 60px;
    border-radius: 6px;
    flex-shrink: 0;
}

.property-selected-display .property-details {
    flex: 1;
    min-width: 0;
    padding-right: 136px;
}

.property-selected-display .property-address {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
    line-height: 1.3;
}

.property-selected-display .property-pricing {
    font-size: 0.9rem;
    color: #666;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.property-remove-btn {
    background: unset;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    color: #666;
    font-size: 0.85rem;
    line-height: 1.2;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    position: absolute;
    top: 27px;
    right: 12px;
    box-shadow: unset;
    min-width: 120px;
    text-align: center;
    justify-content: center;
    box-sizing: border-box;
}

.property-remove-btn:hover {
    background-color: #fff;
    border-color: #bbb;
    color: #444;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.property-remove-btn:active {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.remove-text {
    font-weight: 500;
}

.remove-x {
    font-weight: bold;
    font-size: 1.1rem;
    color: #999;
}

/* Dropdown */
.property-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 360px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    margin-top: 2px;
}

.property-suggestions-header {
    padding: 12px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #666;
    background-color: #f8f8f8;
    border-bottom: 1px solid #eee;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.property-search-item {
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}

.property-search-item:hover {
    background-color: #f8f9fa;
    border-color: #e8e9ea;
}

.property-search-item:active {
    background-color: #f0f1f2;
}

.property-search-item:last-child {
    border-bottom: none;
    border-radius: 0 0 8px 8px;
}

.property-item-content {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.property-thumbnail,
.property-thumbnail-placeholder {
    width: 70px;
    height: 52px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    transition: opacity 0.2s ease;
    border: 1px solid #eee;
}

.property-thumbnail {
    background-color: #f8f8f8;
}

.property-thumbnail.loading {
    opacity: 0.7;
    background-color: #f8f8f8;
}

.property-thumbnail-placeholder {
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.property-thumbnail-placeholder::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTkgMkM3Ljg5NTQzIDIgNyAyLjg5NTQzIDcgNFYxNkM3IDE3LjEwNDYgNy44OTU0MyAxOCA5IDE4SDE5QzIwLjEwNDYgMTggMjEgMTcuMTA0NiAyMSAxNlY0QzIxIDIuODk1NDMgMjAuMTA0NiAyIDE5IDJIOVoiIHN0cm9rZT0iIzk5OTk5OSIgc3Ryb2tlLXdpZHRoPSIxLjUiLz4KPHBhdGggZD0iTTkgOUM5LjU1MjI4IDkgMTAgOS40NDc3MiAxMCAxMEMxMCAxMC41NTIzIDkuNTUyMjggMTEgOSAxMUM4LjQ0NzcyIDExIDggMTAuNTUyMyA4IDEwQzggOS40NDc3MiA4LjQ0NzcyIDkgOSA5WiIgZmlsbD0iIzk5OTk5OSIvPgo8cGF0aCBkPSJNMTMuNSAxNEwxMC41IDE3TDguNSAxNU03IDE4SDE5VjRIOVYxOFoiIHN0cm9rZT0iIzk5OTk5OSIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8L3N2Zz4K');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.4;
}

.property-details {
    flex: 1;
    min-width: 0;
}

.property-address {
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
    font-size: 0.95rem;
    line-height: 1.3;
}

.property-pricing {
    display: flex;
    gap: 14px;
    font-size: 0.85rem;
    color: #666;
    flex-wrap: wrap;
}

.rental-price,
.water-fee {
    white-space: nowrap;
    font-weight: 500;
}

.rental-price {
    color: #0c5948;
}

.water-fee {
    color: #777;
}

.property-search-no-results {
    padding: 20px;
    text-align: center;
    color: #777;
    font-size: 0.9rem;
    background-color: #f9f9f9;
}


/* Loading Skeletons */
.property-search-skeleton {
    padding: 12px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.skeleton-thumbnail {
    width: 60px;
    height: 45px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 3px;
    flex-shrink: 0;
}

.skeleton-content {
    flex: 1;
    min-width: 0;
}

.skeleton-address {
    height: 16px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 2px;
    margin-bottom: 6px;
    width: 80%;
}

.skeleton-pricing {
    display: flex;
    gap: 12px;
}

.skeleton-price {
    height: 14px;
    width: 80px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 2px;
}

.skeleton-water {
    height: 14px;
    width: 100px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 2px;
}

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

/* Property Search Placeholder (shows immediately from HTML) */
.property-search-placeholder {
    position: relative;
    width: 100%;
    margin-bottom: 1rem;
}

.property-search-placeholder .property-search-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--wp--preset--color--contrast);
}

.property-search-skeleton-input {
    width: 100%;
    min-height: 38px;
    border: solid 1px var(--wp--preset--color--base);
    border-radius: .375rem;
    box-sizing: border-box;
    font-family: var(--wp--preset--font-family--inter);
    font-size: .875rem;
    padding: .625rem .875rem;
    background-color: #f8f8f8;
    position: relative;
    overflow: hidden;
    outline: none;
}

.skeleton-input-bar {
    position: absolute;
    top: 50%;
    left: .875rem;
    right: .875rem;
    height: 14px;
    line-height: normal;
    transform: translateY(-50%);
    background: linear-gradient(90deg, #e0e0e0 25%, #d0d0d0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 2px;
}

.skeleton-input-bar::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 12px;
    background: linear-gradient(90deg, #e8e8e8 25%, #d8d8d8 50%, #e8e8e8 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite 0.3s;
    border-radius: 2px;
}

/* Property Search Label */
.property-search-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--wp--preset--color--contrast);
}

/* Validation Error Styling */
.property-search-wrapper.wpcf7-not-valid .property-search-input {
    border-color: #dc3232;
    box-shadow: 0 0 0 2px rgba(220, 50, 50, 0.1);
}

.property-search-wrapper.wpcf7-not-valid .property-selected-display {
    border-color: #dc3232;
    box-shadow: 0 0 0 2px rgba(220, 50, 50, 0.1);
}

.property-search-wrapper .wpcf7-not-valid-tip {
    display: block;
    color: #dc3232;
    font-size: 0.875rem;
    margin-top: 8px;
    padding: 4px 0;
    font-weight: 500;
    line-height: 1.4;
    animation: fadeInError 0.3s ease-out;
}

@keyframes fadeInError {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .property-search-input {
        padding: 12px 14px;
        padding-right: 40px; /* Adjust for smaller spinner */
        font-size: 0.95rem;
    }
    
    .property-search-spinner {
        right: 14px;
        width: 16px;
        height: 16px;
    }
    
    .property-selected-display {
        padding: 12px;
    }
    
    .property-selected-display .property-item-content {
        gap: 12px;
    }
    
    .property-selected-display .property-thumbnail,
    .property-selected-display .property-thumbnail-placeholder {
        width: 60px;
        height: 45px;
    }
    
    .property-selected-display .property-address {
        font-size: 0.9rem;
        margin-bottom: 4px;
    }
    
    .property-selected-display .property-pricing {
        font-size: 0.85rem;
        gap: 12px;
        flex-direction: column;
        align-items: flex-start;
    }

    .property-selected-display .property-details {
        padding-right: 40px;
    }
    
    .property-search-dropdown {
        max-height: 300px;
    }
    
    .property-search-item {
        padding: 12px;
    }
    
    .property-item-content {
        gap: 12px;
    }
    
    .property-thumbnail,
    .property-thumbnail-placeholder,
    .skeleton-thumbnail {
        width: 55px;
        height: 41px;
    }
    
    .property-address {
        font-size: 0.9rem;
    }
    
    .property-pricing {
        flex-direction: column;
        gap: 4px;
        align-items: flex-start;
        font-size: 0.8rem;
    }
    
    .property-remove-btn {
        padding: 6px 8px;
        font-size: 0.8rem;
        top: 8px;
        right: 8px;
        min-width: 32px;
    }
    
    .remove-text {
        display: none;
    }
    
    .skeleton-pricing {
        flex-direction: column;
        gap: 4px;
    }
    
    .property-search-skeleton-input {
        height: 44px;
    }
}
