/* ===== Property Card Component ===== */
/* Reusable property card styles for grid and list views */

/* Individual property card */
.property-card {
    flex: 0 0 auto;
    width: 280px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    cursor: pointer;
}

.property-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Property card image container */
.property-card-image {
    position: relative;
    aspect-ratio: 1/1;
    overflow: hidden;
    background: var(--gray-200);
    border-radius: var(--radius-lg);
}

.property-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.property-card:hover .property-card-image img {
    transform: scale(1.05);
}

/* Favorite button */
.property-card-favorite {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.25rem;
    padding: 0.5rem;
    cursor: pointer;
    transition: transform var(--transition-fast);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.property-card-favorite:hover {
    transform: scale(1.1);
}

.property-card-favorite.active {
    color: var(--danger);
}

/* Badge system for property cards */
.property-card-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    z-index: 1;
}

/* Default badge (Loved by guests) */
.property-card-badge.loved {
    background: white;
    color: var(--gray-800);
}

/* Featured badge */
.property-card-badge.featured {
    background: var(--primary-blue);
    color: white;
}

/* New badge */
.property-card-badge.new {
    background: #10b981; /* Success green */
    color: white;
    left: auto;
    right: 0.75rem;
}

/* Hide badges based on data attributes */
.property-card[data-featured="false"] .property-card-badge.featured,
.property-card[data-isnew="false"] .property-card-badge.new,
.property-card:not([data-loved="true"]) .property-card-badge.loved {
    display: none;
}

/* Show multiple badges with proper spacing */
.property-card[data-featured="true"][data-isnew="true"] .property-card-badge.featured {
    top: 0.75rem;
}

.property-card[data-featured="true"][data-isnew="true"] .property-card-badge.new {
    top: 2.5rem;
}

/* Property card content */
.property-card-content {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* React Native style badge for vacant rooms */
.rn-vacant-badge {
    background-color: var(--primary-blue);
    color: white;
    text-align: center;
    font-size: var(--text-xs);
    padding: 2px;
    border-radius: var(--radius-sm);
    margin-top: 4px;
}

/* React Native style address */
.rn-property-address {
    color: #555;
    font-size: 10px;
    line-height: 20px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* React Native style price */
.property-card-price {
    color: var(--primary-blue);;
    font-weight: 600;
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* React Native style total */
.rn-property-total {
    color: #333;
    font-size: var(--text-xs);
}

.property-card-title {
    font-size: var(--text-base);
    font-weight: 400;
    color: var(--gray-900);
    margin: 0 0 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.property-card-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: var(--text-sm);
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.property-card-rating i {
    color: var(--gray-900);
    font-size: 0.875rem;
}

.property-card-meta {
    margin-top: 0.5rem;
}

/* Property actions for action buttons */
.property-actions {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--gray-100);
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.property-actions .btn-action {
    flex: 1;
    padding: 0.5rem;
    font-size: var(--text-sm);
    border: 1px solid var(--gray-200);
    background: white;
    color: var(--gray-700);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.property-actions .btn-action:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    background-color: var(--primary-blue-50);
}

.property-actions .btn-favorite {
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--gray-200);
    background: white;
    color: var(--gray-400);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.property-actions .btn-favorite:hover {
    border-color: var(--danger);
    color: var(--danger);
    background-color: rgba(239, 68, 68, 0.05);
}

.property-actions .btn-favorite.active {
    background-color: var(--danger);
    color: white;
    border-color: var(--danger);
}

/* Favorite button animation states */
.btn-favorite.favorited {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.btn-favorite.favorited .fas.fa-heart {
    color: #ef4444;
    animation: heartBeat 0.6s ease-in-out;
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(1); }
    75% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .property-card {
        width: 260px;
    }
}

@media (max-width: 992px) {
    .property-card {
        width: 240px;
    }
}

@media (max-width: 768px) {
    .property-card {
        width: 200px;
    }
    
    .property-card-title {
        font-size: var(--text-sm);
    }
    
    .property-card-rating,
    .property-card-price {
        font-size: var(--text-sm);
    }
}

@media (max-width: 480px) {
    .property-card {
        width: 160px;
    }
    
    .property-card-badge {
        font-size: 0.625rem;
        padding: 0.125rem 0.5rem;
    }
    
    .property-card-favorite {
        font-size: 1rem;
        padding: 0.375rem;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .property-card:hover {
        transform: none;
        box-shadow: none;
    }
    
    .property-card:hover .property-card-image img {
        transform: none;
    }
    
    /* Add active state for touch feedback */
    .property-card:active {
        transform: scale(0.98);
    }
}

/* Grid-specific adjustments when property cards are in grid layouts */
.row .property-card {
    width: 100%;
}

/* Loading state */
.property-card.skeleton {
    pointer-events: none;
}

.property-card.skeleton .property-card-image {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-300) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

.property-card.skeleton .property-card-title,
.property-card.skeleton .property-card-rating,
.property-card.skeleton .property-card-price {
    background: var(--gray-200);
    border-radius: var(--radius-sm);
    color: transparent;
}

/* Prevent text selection and image dragging */
.property-card {
    user-select: none;
}

.property-card img {
    -webkit-user-drag: none;
    user-drag: none;
}

/* List View Specific Styles */
.list-view .property-actions {
    border-top: none;
    padding: var(--space-4);
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-end;
}

/* Mobile List View Adjustments */
@media (max-width: 767px) {
    .list-view .property-actions {
        border-left: none;
        border-top: 1px solid var(--gray-100);
        flex-direction: row;
        padding: var(--space-3);
    }
}

/* Animation for cards entering viewport */
@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Apply animation to cards as they appear */
.property-card {
    animation: slideInFromRight 0.3s ease-out;
    animation-fill-mode: both;
}

/* Stagger animation for multiple cards */
.property-card:nth-child(1) { animation-delay: 0s; }
.property-card:nth-child(2) { animation-delay: 0.05s; }
.property-card:nth-child(3) { animation-delay: 0.1s; }
.property-card:nth-child(4) { animation-delay: 0.15s; }
.property-card:nth-child(5) { animation-delay: 0.2s; }
.property-card:nth-child(6) { animation-delay: 0.25s; }
.property-card:nth-child(7) { animation-delay: 0.3s; }
.property-card:nth-child(8) { animation-delay: 0.35s; }

/* Loading animation keyframes defined in utilities/helpers.css */

/* ===== Property Grid Layout Options (extracted from main.css) ===== */
.property-grid {
    display: grid;
    gap: var(--space-6);
}

.property-grid.list-view {
    grid-template-columns: 1fr;
}

.property-grid.grid-view {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--space-3);
}

/* List View Specific Styles */
.list-view .property-card {
    flex-direction: row;
}

.list-view .property-image-wrapper {
    width: 300px;
    padding-top: 0;
    height: 200px;
    flex-shrink: 0;
}

.list-view .property-content {
    flex: 1;
}

.list-view .btn-action {
    flex: none;
}