/**
 * Real Estate Favorites Styles
 */

/* Favorite Button */
.ref-favorite-btn {
    color: #666;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    position: relative;
}

.ref-favorite-btn:hover {
    background: #e0e0e0;
    border-color: #ccc;
    color: #555;
}

.ref-favorite-btn.is-favorite {
    background: #e74c3c;
    border-color: #c0392b;
    color: #fff;
}

.ref-favorite-btn.is-favorite:hover {
    background: #c0392b;
    border-color: #a93226;
}

.ref-favorite-btn.loading {
    opacity: 0.6;
    cursor: not-allowed;
}

.ref-favorite-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: ref-spin 1s linear infinite;
}

@keyframes ref-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Favorites Container */
.ref-favorites-container {
    padding: 20px;
}

.ref-favorites-list {
    margin-bottom: 30px;
}

.ref-favorites-list.loading {
    opacity: 0.6;
    position: relative;
}

.ref-favorites-list.loading::after {
    content: 'Loading...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 4px;
    font-weight: 500;
    color: #666;
}

/* Favorites Grid */
.ref-favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.ref-favorite-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
}

.ref-favorite-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.ref-favorite-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: #f5f5f5;
}

.ref-favorite-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.ref-favorite-item:hover .ref-favorite-image img {
    transform: scale(1.05);
}

.ref-favorite-content {
    padding: 20px;
}

.ref-favorite-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.ref-favorite-price {
    font-size: 20px;
    font-weight: 700;
    color: #27ae60;
    margin-bottom: 8px;
}

.ref-favorite-address {
    color: #666;
    margin-bottom: 12px;
    font-size: 14px;
}

.ref-favorite-details {
    margin-bottom: 15px;
}

.ref-favorite-details span {
    display: inline-block;
    background: #f8f9fa;
    color: #495057;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-right: 8px;
    margin-bottom: 4px;
}

.ref-favorite-meta {
    border-top: 1px solid #eee;
    padding-top: 12px;
    margin-bottom: 15px;
    color: #888;
    font-size: 12px;
}

.ref-stale-warning {
    display: block;
    color: #f39c12;
    font-weight: 500;
    margin-top: 4px;
}

.ref-favorite-actions {
    display: flex;
    gap: 10px;
}

.ref-view-listing {
    flex: 1;
    background: #3498db;
    color: #fff;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.ref-view-listing:hover {
    background: #2980b9;
    color: #fff;
    text-decoration: none;
}

.ref-remove-favorite {
    background: transparent;
    border: 1px solid #e74c3c;
    color: #e74c3c;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.ref-remove-favorite:hover {
    background: #e74c3c;
    color: #fff;
}

/* Empty State */
.ref-no-favorites {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 16px;
}

.ref-no-favorites::before {
    content: '♡';
    display: block;
    font-size: 48px;
    color: #ddd;
    margin-bottom: 20px;
}

/* Error State */
.ref-error {
    text-align: center;
    padding: 40px 20px;
    color: #e74c3c;
    background: #fdf2f2;
    border: 1px solid #f5c6c6;
    border-radius: 4px;
    margin: 20px 0;
}

/* Pagination */
.ref-pagination {
    text-align: center;
    margin-top: 30px;
}

.ref-pagination-links {
    margin-bottom: 10px;
}

.ref-page-btn {
    background: #fff;
    border: 1px solid #ddd;
    color: #666;
    padding: 8px 12px;
    margin: 0 2px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.ref-page-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.ref-current-page {
    background: #3498db;
    color: #fff;
    padding: 8px 12px;
    margin: 0 2px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
}

.ref-pagination-info {
    color: #666;
    font-size: 14px;
}

/* Notifications */
.ref-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 4px;
    font-weight: 500;
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-width: 300px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.ref-notification.show {
    transform: translateX(0);
}

.ref-notification.ref-success {
    background: #27ae60;
    color: #fff;
}

.ref-notification.ref-error {
    background: #e74c3c;
    color: #fff;
}

/* Favorites Count */
.ref-favorites-count {
    background: #e74c3c;
    color: #fff;
    border-radius: 50%;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
    display: inline-block;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ref-favorites-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .ref-favorite-image {
        height: 150px;
    }
    
    .ref-favorite-content {
        padding: 15px;
    }
    
    .ref-favorites-container {
        padding: 15px;
    }
    
    .ref-favorite-actions {
        flex-direction: column;
    }
    
    .ref-notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .ref-pagination-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
    }
}

@media (max-width: 480px) {
    .ref-favorite-title {
        font-size: 16px;
    }
    
    .ref-favorite-price {
        font-size: 18px;
    }
    
    .ref-page-btn,
    .ref-current-page {
        padding: 6px 10px;
        font-size: 13px;
    }
}

/* Animation for removing items */
@keyframes ref-fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.8);
    }
}

.ref-favorite-item.removing {
    animation: ref-fadeOut 0.3s ease forwards;
}

/* Loading skeleton */
.ref-favorite-skeleton {
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    animation: ref-pulse 1.5s ease-in-out infinite;
}

.ref-favorite-skeleton .ref-skeleton-image {
    height: 200px;
    background: #e0e0e0;
}

.ref-favorite-skeleton .ref-skeleton-content {
    padding: 20px;
}

.ref-favorite-skeleton .ref-skeleton-line {
    height: 16px;
    background: #e0e0e0;
    border-radius: 4px;
    margin-bottom: 10px;
}

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

@keyframes ref-pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
    100% {
        opacity: 1;
    }
}