/* ========================================
   Property Grid Effects - Bahay Expert Style
   Enhanced Modern Design
   ======================================== */

/* Grid container animation */
.property-grid-container {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1.5rem;
    animation: gridFadeIn 0.6s ease-out;
}

@keyframes gridFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Property Card Base Styles */
.property-card {
    position: relative;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: cardFadeIn 0.6s ease-out backwards;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07),
                0 2px 4px -1px rgba(0, 0, 0, 0.04);
}

.property-card:nth-child(1) { animation-delay: 0.05s; }
.property-card:nth-child(2) { animation-delay: 0.1s; }
.property-card:nth-child(3) { animation-delay: 0.15s; }
.property-card:nth-child(4) { animation-delay: 0.2s; }
.property-card:nth-child(5) { animation-delay: 0.25s; }
.property-card:nth-child(6) { animation-delay: 0.3s; }
.property-card:nth-child(7) { animation-delay: 0.35s; }
.property-card:nth-child(8) { animation-delay: 0.4s; }
.property-card:nth-child(9) { animation-delay: 0.45s; }
.property-card:nth-child(10) { animation-delay: 0.5s; }

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hover Effects - Lift and Shadow */
.property-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 25px 50px -12px rgba(26, 70, 157, 0.25),
                0 10px 20px -5px rgba(26, 70, 157, 0.15);
    border-color: #1A469D/30;
}

/* Image Container with Zoom Effect */
.property-card-image-wrapper {
    position: relative;
    height: 14rem;
    overflow: hidden;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

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

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

/* Image Overlay Gradient */
.property-card-image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.4) 100%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
}

.property-card:hover .property-card-image-overlay {
    opacity: 1;
}

/* Badge Styles - Modern gradient pill */
.property-card-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 8px 14px;
    background: linear-gradient(135deg, rgba(26, 70, 157, 0.95), rgba(26, 70, 157, 0.85));
    color: #ffffff !important;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-radius: 24px;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 16px rgba(26, 70, 157, 0.35);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.property-card:hover .property-card-badge {
    background: linear-gradient(135deg, rgba(215, 31, 39, 0.95), rgba(215, 31, 39, 0.85));
    transform: scale(1.08);
    box-shadow: 0 8px 24px rgba(215, 31, 39, 0.45);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Featured Badge */
.property-card-badge.featured {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.95), rgba(255, 193, 7, 0.85));
    color: #0f172a !important;
    text-shadow: none;
    box-shadow: 0 4px 16px rgba(255, 215, 0, 0.35);
}

.property-card:hover .property-card-badge.featured {
    background: linear-gradient(135deg, rgba(255, 215, 0, 1), rgba(255, 193, 7, 0.95));
    box-shadow: 0 8px 24px rgba(255, 215, 0, 0.5);
}

/* Favorite Button */
.property-card-favorite {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.property-card-favorite:hover {
    background: #D71F27;
    border-color: #D71F27;
    transform: scale(1.15) rotate(8deg);
    box-shadow: 0 12px 28px rgba(215, 31, 39, 0.45);
}

.property-card-favorite:active {
    transform: scale(0.95);
}

.property-card-favorite.active {
    background: #D71F27 !important;
    border-color: #D71F27 !important;
}

.property-card-favorite.active span {
    fill: white !important;
    color: white !important;
    -webkit-text-fill-color: white !important;
    font-variation-settings: 'FILL' 1 !important;
    text-fill-color: white !important;
}

.property-card-favorite span {
    font-size: 20px;
    color: #D71F27;
    transition: all 0.3s ease;
}

/* Dark mode favorite button */
.dark .property-card-favorite {
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.dark .property-card-favorite span {
    color: rgba(255, 255, 255, 0.85);
}

.dark .property-card-favorite:hover {
    background: #D71F27;
    border-color: #D71F27;
}

/* Card Content */
.property-card-content {
    padding: 1.5rem;
}

.property-card-price {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #1A469D, #D71F27);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    letter-spacing: -0.5px;
}

.property-card:hover .property-card-price {
    background: linear-gradient(135deg, #D71F27, #FFD700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transform: translateX(4px);
}

.property-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.6rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.3s ease;
    line-height: 1.4;
}

.property-card:hover .property-card-title {
    color: #1A469D;
}

.property-card-location {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 1.25rem;
    font-weight: 500;
}

.property-card-location span.material-symbols-outlined {
    font-size: 16px;
    color: #D71F27;
    flex-shrink: 0;
}

.property-card-location span:last-child {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Card Footer with Agent Info */
.property-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1.25rem;
    border-top: 1px solid #f1f5f9;
    transition: border-color 0.3s ease;
}

.property-card:hover .property-card-footer {
    border-color: #e2e8f0;
}

.property-card-agent {
    display: flex;
    align-items: center;
    gap: 10px;
}

.property-card-agent-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.property-card:hover .property-card-agent-avatar {
    border-color: #1A469D;
    transform: scale(1.08);
    box-shadow: 0 4px 8px rgba(26, 70, 157, 0.2);
}

.property-card-agent-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: #475569;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.property-card-view-link {
    font-size: 0.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, #1A469D, #D71F27);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.property-card-view-link:hover {
    background: linear-gradient(135deg, #D71F27, #FFD700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transform: translateX(4px);
}

/* ========================================
   Responsive Grid Breakpoints
   ======================================== */
@media (min-width: 640px) {
    .property-grid-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .property-card-image-wrapper {
        height: 12rem;
    }
}

@media (min-width: 768px) {
    .property-grid-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
    
    .property-card-image-wrapper {
        height: 14rem;
    }
}

@media (min-width: 1024px) {
    .property-grid-container {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
    }
}

@media (min-width: 1280px) {
    .property-grid-container {
        grid-template-columns: repeat(5, 1fr);
        gap: 1.5rem;
    }
}

/* ========================================
   Dark Mode Support
   ======================================== */
.dark .property-card {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3),
                0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

.dark .property-card:hover {
    border-color: #1A469D/50;
    box-shadow: 0 25px 50px -12px rgba(26, 70, 157, 0.4),
                0 10px 20px -5px rgba(26, 70, 157, 0.25);
}

.dark .property-card-title {
    color: #f1f5f9;
}

.dark .property-card:hover .property-card-title {
    color: #ffffff;
}

.dark .property-card-location {
    color: #94a3b8;
}

.dark .property-card-footer {
    border-color: #334155;
}

.dark .property-card:hover .property-card-footer {
    border-color: #475569;
}

.dark .property-card-agent-name {
    color: #cbd5e1;
}

.dark .property-card-agent-avatar {
    border-color: #475569;
}

.dark .property-card:hover .property-card-agent-avatar {
    border-color: #1A469D;
}

/* ========================================
   Loading Skeleton Animation
   ======================================== */
.property-card-skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 20px;
    height: 18rem;
}

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

.dark .property-card-skeleton {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
}

/* ========================================
   Stagger Animation for Dynamic Loading
   ======================================== */
.property-card.animate-in {
    animation: cardSlideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ========================================
   Ripple Effect on Click
   ======================================== */
.property-card-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(26, 70, 157, 0.4);
    transform: scale(0);
    animation: rippleEffect 0.6s ease-out;
    pointer-events: none;
}

@keyframes rippleEffect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ========================================
   Mobile Optimizations
   ======================================== */
@media (max-width: 639px) {
    .property-card {
        border-radius: 16px;
    }
    
    .property-card-image-wrapper {
        height: 12rem;
    }
    
    .property-card-content {
        padding: 1.25rem;
    }
    
    .property-card-price {
        font-size: 1.25rem;
    }
    
    .property-card-title {
        font-size: 0.95rem;
    }
    
    .property-card-badge {
        padding: 6px 12px;
        font-size: 0.65rem;
    }
}
