/* 
 * Premium UX/UI Enhancements for InmoFlex
 * Focus: Elegant transitions, Depth, and Mobile optimization
 */

:root {
    --premium-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --premium-shadow-hover: 0 20px 40px -10px rgba(0, 0, 0, 0.15), 0 8px 12px -3px rgba(0, 0, 0, 0.1);
    --transition-smooth: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* 1. Transitions & Micro-animations */
.property-card {
    transition: var(--transition-smooth) !important;
    border: 1px solid rgba(0, 0, 0, 0.03) !important;
    box-shadow: var(--premium-shadow) !important;
}

.property-card:hover {
    transform: translateY(-8px) scale(1.01) !important;
    box-shadow: var(--premium-shadow-hover) !important;
}

.property-card .card-img-top {
    transition: var(--transition-smooth);
}

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

/* 2. Premium Buttons */
.btn-primary,
.btn-success,
.btn-dark,
.btn-emerald {
    transition: var(--transition-smooth) !important;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover,
.btn-success:hover,
.btn-dark:hover,
.btn-emerald:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
    filter: brightness(1.05);
}

.btn-primary:active,
.btn-success:active {
    transform: translateY(0) scale(0.98);
}

/* 3. Refined Badges & Overlays */
.badge {
    font-weight: 700 !important;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    font-size: 0.65rem !important;
    padding: 6px 12px !important;
    border-radius: 8px !important;
    backdrop-filter: blur(4px);
}

.bg-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%) !important;
}

.bg-success {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%) !important;
}

.bg-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
}

.bg-info {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%) !important;
}

/* 4. Hierarchy & Typography */
.card-title {
    color: #111827;
    letter-spacing: -0.01em;
}

.text-primary {
    color: #2563eb !important;
}

/* 5. Skeleton Loading & Fades */
.img-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #f8f8f8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* 6. Gallery & Fullscreen Enhancements */
#propertyCarousel {
    background-color: #000;
}

#propertyCarousel .carousel-item img {
    transition: transform 0.5s ease;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    transition: var(--transition-smooth);
}

.carousel-control-prev:hover .carousel-control-prev-icon,
.carousel-control-next:hover .carousel-control-next-icon {
    transform: scale(1.1);
    background-color: rgba(0, 0, 0, 0.7) !important;
}

/* 7. Mobile Optimizations */
@media (max-width: 768px) {
    .property-card:hover {
        transform: none !important;
        /* Avoid hover jump on touch */
    }

    .btn-lg,
    .btn-primary,
    .btn-success {
        padding: 14px 20px !important;
    }

    /* Better touch targets */
    .filter-tab {
        padding: 10px 20px !important;
        margin-bottom: 5px;
    }

    #carouselThumbnails {
        padding-bottom: 10px;
    }

    .carousel-item img {
        height: 350px !important;
    }
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Hide scrollbars but keep functionality for carousels */
.overflow-auto::-webkit-scrollbar {
    display: none;
}

.overflow-auto {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* 8. Modern Property Card Redesign */
.property-card {
    background: #fff;
    border-radius: 20px !important;
    overflow: hidden;
    transition: var(--transition-smooth) !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
    display: flex;
    flex-direction: column;
}

.property-card:hover {
    transform: translateY(-10px) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15) !important;
}

.card-header-premium {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
}

.badge-status {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #4b5563;
    display: flex;
    align-items: center;
    gap: 6px;
}

.badge-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.status-venta::before {
    background-color: #2563eb;
}

.status-alquiler::before {
    background-color: #10b981;
}

.status-anticretico::before {
    background-color: #f59e0b;
}

.btn-fav {
    position: relative !important;
    z-index: 10 !important;
    width: 30px !important;
    height: 30px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #ffffff !important;
    border-radius: 50% !important;
    border: 1px solid #e5e7eb !important;
    color: #9ca3af !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    cursor: pointer !important;
    padding: 0 !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05) !important;
}

.btn-fav:hover {
    background: #ffffff !important;
    transform: scale(1.1) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    border-color: #d1d5db !important;
}

.btn-fav.active {
    background: #ffffff !important;
    color: #ef4444 !important; /* Premium Red */
    border-color: #fee2e2 !important;
}

.btn-fav i {
    font-size: 0.85rem !important;
}

.card-img-container {
    position: relative;
    overflow: hidden;
    margin: 0 12px;
    border-radius: 14px;
}

.property-card .card-img-top {
    height: 220px !important;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.property-card:hover .card-img-top {
    transform: scale(1.08);
}

.property-card .card-body {
    padding: 16px 20px 20px !important;
}

.property-card .card-title {
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    color: #1f2937;
    margin-bottom: 4px !important;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-location {
    font-size: 0.85rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 12px;
}

.card-location span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.card-location i {
    flex-shrink: 0;
}

.card-price {
    font-size: 1.35rem !important;
    font-weight: 800 !important;
    color: #2563eb !important;
    margin-bottom: 16px !important;
}

.card-features-premium {
    display: flex;
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #4b5563;
    font-weight: 500;
}

.feature-item i {
    color: #9ca3af;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .property-card {
        margin-bottom: 10px;
    }

    .property-card .card-img-top {
        height: 180px !important;
    }

    .card-price {
        font-size: 1.2rem !important;
    }
}