/* ==============================================
   CARDS - Property Card Styling
   Fixed highlight animation with visible effect
   ============================================== */

.property-card {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.property-card:hover {
    transform: translateY(-2px);
}

/* Image Container */
.card-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
}

.card-image-link {
    display: block;
    width: 100%;
    height: 100%;
}

.card-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.property-card:hover .card-image-container img,
.property-card.hovered .card-image-container img {
    transform: scale(1.04);
}

/* Gradient Overlay */
.card-image-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 55%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.3) 60%, transparent 100%);
    pointer-events: none;
    z-index: 2;
}

/* Badge */
.card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.95);
    padding: 5px 8px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
    color: #222;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
    z-index: 5;
}

.card-badge::before {
    content: '🏆';
    font-size: 10px;
    margin-right: 3px;
}

/* Favorite Button */
.favorite-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    padding: 0;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.4));
    transition: transform 0.15s ease;
    z-index: 5;
}

.favorite-button:hover {
    transform: scale(1.1);
}

/* ============================================== */
/* OVERLAY CONTENT */
/* ============================================== */

.card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 14px;
    z-index: 3;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    margin: 0;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.card-rating {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    color: #fff;
    font-weight: 500;
}

.card-rating i {
    font-size: 9px;
    color: #ff385c;
}

.new-badge {
    font-size: 11px;
    color: #fff;
    font-weight: 500;
    background: rgba(255, 56, 92, 0.9);
    padding: 3px 6px;
    border-radius: 4px;
}

.card-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    margin: 2px 0 0;
}

.card-details {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

.card-price {
    margin-top: 4px;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px;
}

.price-amount {
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.price-period {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
}

/* Total Price Display (when dates selected) */
.price-total {
    width: 100%;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 2px;
}

.price-total .total-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    display: block;
    margin-bottom: 2px;
}

.price-total strong {
    font-weight: 600;
    font-size: 14px;
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ============================================== */
/* HIGHLIGHTED STATE - Very visible */
/* ============================================== */

.property-card.highlighted {
    transform: translateY(-4px);
    z-index: 100;
}

.property-card.highlighted .card-image-container {
    box-shadow: 0 0 0 3px #ff385c, 0 8px 24px rgba(255, 56, 92, 0.3);
}

.property-card.highlighted .card-image-container img {
    transform: scale(1.04);
}

/* HOVERED STATE - From card hover */
.property-card.hovered {
    transform: translateY(-2px);
}

.property-card.hovered .card-image-container {
    box-shadow: 0 0 0 2px #222;
}

/* ============================================== */
/* MOBILE */
/* ============================================== */

@media (max-width: 768px) {
    .card-image-container {
        aspect-ratio: 16/10;
        border-radius: 14px;
    }

    .card-title {
        font-size: 16px;
    }

    .card-content {
        padding: 14px 16px;
    }

    .price-amount {
        font-size: 17px;
    }

    .property-card.highlighted .card-image-container {
        box-shadow: 0 0 0 3px #ff385c, 0 6px 20px rgba(255, 56, 92, 0.25);
    }
}

/* Animation for highlight */
@keyframes highlightPulse {

    0%,
    100% {
        box-shadow: 0 0 0 3px #ff385c;
    }

    50% {
        box-shadow: 0 0 0 5px #ff385c, 0 0 20px rgba(255, 56, 92, 0.4);
    }
}

.property-card.highlighted .card-image-container {
    animation: highlightPulse 1s ease-in-out 2;
}

/* Dark Mode */
[data-theme="dark"] .card-badge {
    background: rgba(40, 40, 40, 0.95);
    color: #fff;
}

[data-theme="dark"] .property-card.hovered .card-image-container {
    box-shadow: 0 0 0 2px #fff;
}