/**
 * ==============================================
 * PROPERTY CARDS COMPONENT - Unified Styles
 * ==============================================
 * 
 * All property card styles in one place for:
 * - Grid cards (listings, homepage)
 * - Similar cards (property page)
 * - Compact cards (mobile)
 * 
 * Includes:
 * - Base card structure
 * - Image containers and carousels
 * - Property info sections
 * - Price displays and discounts
 * - Badges and availability
 * - Dark mode support
 * - Responsive/mobile optimizations
 */

/* ==============================================
   BASE PROPERTY CARD (GRID VARIANT)
   ============================================== */

.property-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
}

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

/* Highlighted/Featured cards */
.property-card.highlighted {
    border: 2px solid var(--primary-color);
    box-shadow: 0 4px 12px rgba(221, 116, 71, 0.2);
}

.property-card.highlighted:hover {
    box-shadow: 0 12px 28px rgba(221, 116, 71, 0.3);
}

/* Lazy loading hidden state */
.property-card.lazy-hidden {
    display: none;
}

/* ==============================================
   PROPERTY IMAGE CONTAINER
   ============================================== */

.property-image {
    position: relative;
    width: 100%;
    height: 250px; /* Fixed height instead of aspect ratio */
    overflow: hidden;
    background: #f3f4f6;
}

.property-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.property-card:hover .property-image img {
    transform: scale(1.05);
}

/* ==============================================
   IMAGE CAROUSEL (DESKTOP ONLY)
   ============================================== */

.carousel-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: none;
}

.carousel-image.active {
    opacity: 1;
    display: block !important;
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 10;
}

.property-card:hover .carousel-nav {
    opacity: 1;
}

.carousel-nav:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
}

.carousel-nav-prev {
    left: 12px;
}

.carousel-nav-next {
    right: 12px;
}

.carousel-nav i {
    color: #333;
    font-size: 0.9rem;
}

.carousel-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.2s ease;
}

.carousel-dot.active {
    background: white;
    width: 24px;
    border-radius: 4px;
}

/* ==============================================
   BADGES
   ============================================== */

.property-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, #c4613c, #dd7447);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 5;
}

.favorite-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 5;
}
/* Bubble up animation on card hover */
.property-card:hover .favorite-btn {
    animation: heartBubble 0.6s ease-out;
}

.favorite-btn:hover {
    background: white;
    transform: scale(1.1);
}

.favorite-btn i {
    color: #dd7447;
    font-size: 1.1rem;
}

/* ==============================================
   PROPERTY INFO SECTION
   ============================================== */

.property-info {
    padding: 16px;
}

.property-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 8px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.property-location {
    font-size: 0.9rem;
    color: var(--text-light);
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.property-location i {
    color: var(--primary-color);
    margin-right: 4px;
}

.availability-badge {
    color: #10b981;
    font-weight: 600;
}

.availability-badge i {
    color: #10b981;
}

.property-features {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: var(--text-light);
}

.property-features span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.property-features i {
    color: var(--primary-color);
}

.property-views {
    margin: 10px 0;
    color: var(--primary-color);
    font-size: 0.875rem;
}

.property-views i {
    margin-right: 4px;
}

/* ==============================================
   PROPERTY PRICE
   ============================================== */

.property-price {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.property-price .price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
}

.property-price .period {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Price with discount */
.price-discount-wrapper {
    width: 100%;
}

.price-line {
    margin-bottom: 4px;
}

.price-original {
    text-decoration: line-through;
    color: var(--text-light);
    font-size: 0.9rem;
}

.price-main {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 6px;
}

.discount-badge {
    display: inline-block;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ==============================================
   SIMILAR PROPERTIES LAYOUT
   ============================================== */

.similar-properties {
    background: #f8f9fa;
    padding: 60px 20px;
    margin-top: 60px;
}

.similar-properties-container {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.similar-properties-heading {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2rem;
    color: #2c3e50;
    font-weight: 600;
}

.similar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 28px;
}

/* ==============================================
   SIMILAR CARD VARIANT
   ============================================== */

.similar-card {
    text-decoration: none;
    color: inherit;
    display: block;
}

.similar-card-inner {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.similar-card:hover .similar-card-inner {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.similar-image {
    position: relative;
    width: 100%;
    padding-top: 66.67%;
    overflow: hidden;
    background: #f3f4f6;
}

.similar-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, #c4613c, #dd7447);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.similar-info {
    padding: 20px;
}

.similar-title {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 600;
    line-height: 1.3;
}

.similar-location {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.similar-location i {
    color: var(--primary-color);
    margin-right: 4px;
}

.similar-features {
    display: flex;
    gap: 15px;
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: var(--text-light);
}

.similar-features i {
    margin-right: 4px;
}

.similar-price {
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.similar-price-amount {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-dark);
}

.similar-price-period {
    font-size: 0.85rem;
    color: var(--text-light);
}

.similar-views {
    font-size: 0.8rem;
    color: var(--primary-color);
}

.similar-views i {
    margin-right: 4px;
}

/* ==============================================
   COMPACT CARD VARIANT (MOBILE)
   ============================================== */

.property-card-compact {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
}

.compact-image {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    background: #f3f4f6;
}

.compact-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.compact-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

.compact-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.compact-location {
    font-size: 0.85rem;
    color: var(--text-light);
    margin: 0 0 8px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.compact-location i {
    color: var(--primary-color);
    margin-right: 4px;
}

.compact-available {
    color: #10b981;
    font-weight: 600;
}

.compact-price {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.compact-price .price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
}

.compact-price .period {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* ==============================================
   NOTE: Dark mode styles moved to /css/dark-mode.css
   ============================================== */

/* ==============================================
   RESPONSIVE - MOBILE
   ============================================== */

@media (max-width: 768px) {
    .similar-properties {
        padding: 40px 16px;
        margin-top: 40px;
    }

    .similar-properties-heading {
        font-size: 1.6rem;
        margin-bottom: 28px;
    }

    .similar-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .property-card {
        border-radius: 8px;
    }
    
    .property-info {
        padding: 12px;
    }
    
    .property-title {
        font-size: 1rem;
    }
    
    .property-price .price {
        font-size: 1.1rem;
    }
    
    .carousel-nav,
    .carousel-dots {
        display: none;
    }
    
    .similar-info {
        padding: 16px;
    }
    
    .similar-title {
        font-size: 1rem;
    }

    .similar-features {
        flex-wrap: wrap;
        gap: 10px;
        row-gap: 8px;
    }
}

@media (max-width: 480px) {
    .similar-properties {
        padding: 32px 14px;
    }

    .similar-properties-heading {
        font-size: 1.4rem;
    }

    .similar-grid {
        gap: 16px;
    }

    .similar-info {
        padding: 14px;
    }

    .similar-price {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* ===========================
   ANIMATIONS
   =========================== */

@keyframes heartBubble {
    0% {
        transform: translateY(0) scale(1);
    }
    30% {
        transform: translateY(-8px) scale(1.15);
    }
    50% {
        transform: translateY(-4px) scale(1.05);
    }
    70% {
        transform: translateY(-6px) scale(1.1);
    }
    100% {
        transform: translateY(0) scale(1);
    }
}
