/**
 * Avantio Properties List Elementor Widget Styles
 * 
 * @package avantio-properties
 */

/* ========================================
   Widget Container
======================================== */
.lgap-properties-list-widget {
    font-family: "Josefin Sans", sans-serif;
    width: 100%;
}

/* ========================================
   Layout Grid
======================================== */
.lgap-widget-content {
    width: 100%;
}

.lgap-widget-main-content {
    width: 100%;
}

.lgap-widget-main-content.lgap-no-filters {
    width: 100%;
}

/* ========================================
   Properties Grid
======================================== */
.lgap-properties-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 20px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.lgap-properties-grid > div {
    width: 100% !important;
    margin: 0 !important;
}

/* Responsive grid adjustments */
@media (max-width: 1024px) {
    .lgap-properties-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 767px) {
    .lgap-properties-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ========================================
   Property Cards
======================================== */
.lgap-property-card {
    background: #fff !important;
    border: 1px solid #e5e5e5 !important;
    /* border-radius: 8px !important; */
    overflow: hidden !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    height: fit-content !important;
}

.lgap-property-card:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

/* Property Image */
.lgap-property-image {
    position: relative;
    height: 220px;
    overflow: hidden;
    background: #f5f5f5;
}

.lgap-property-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.lgap-no-image {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 0.9rem;
}

/* Swiper Styles */
.lgap-property-swiper {
    width: 100%;
    height: 100%;
}
.lgap-property-swiper::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.3) 100%);
    z-index: 9;
}

/* .lgap-property-swiper::after,
.lgap-property-swiper::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 10px;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 9;
} */

.lgap-property-swiper::after {
    left: 0;
}

.lgap-property-swiper::before {
    right: 0;
}

.lgap-property-swiper .swiper-slide {
    text-align: center;
    font-size: 18px;
    background: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lgap-property-swiper .swiper-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lgap-property-swiper .swiper-button-next,
.lgap-property-swiper .swiper-button-prev {
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    margin-top: -15px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}


.lgap-property-card:hover .lgap-property-swiper .swiper-button-next,
.lgap-property-card:hover .lgap-property-swiper .swiper-button-prev {
    opacity: 1;
}

.lgap-property-swiper .swiper-button-next::after,
.lgap-property-swiper .swiper-button-prev::after {
    font-size: 12px;
    font-weight: 600;
}

.lgap-property-swiper .swiper-pagination {
    bottom: 10px;
}

.lgap-property-swiper .swiper-pagination-bullet {
    background: rgba(255, 255, 255, 0.5);
    opacity: 1;
}

.lgap-property-swiper .swiper-pagination-bullet-active {
    background: #FFB800;
}

.lgap-single-image,
.lgap-no-image {
    height: 100%;
    width: 100%;
}

.lgap-main-image,
.lgap-placeholder-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lgap-slide-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* Badges */

.lgap-price-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 6px 10px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    z-index: 2;
}

.lgap-price-badge small {
    display: block;
    font-size: 0.7rem;
    opacity: 0.8;
}

/* ========================================
   Card Content
======================================== */
.lgap-card-content {
    padding: 20px !important;
    background: #fff !important;
}

/* Override any theme styles that might interfere */
.lgap-property-card,
.lgap-property-card *:not(.lgap-view-details-btn):not(.lgap-view-details-btn *) {
    box-sizing: border-box;
}

.lgap-property-card .lgap-card-content {
    background-color: #fff !important;
}

.lgap-property-title-container {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-bottom: 8px;
    justify-content: space-between;
}

.lgap-property-title {
    font-family: "Playfair Display", sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 10px;
    color: #000;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0px;
}


.lgap-property-title a {
    text-decoration: none;
    transition: color 0.3s ease;
}

.lgap-property-title a:hover {
    color: #FFB800;
}

.lgap-property-location-rating {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.lgap-property-location {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    color: var(--lgap-secondary-color);
    margin-bottom: 0;
}

.lgap-rating-badge {
    color: #000;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
    cursor: pointer;
    position: relative;
    background: rgba(255, 255, 255, 0.9);
    padding: 4px 8px;
    border-radius: 12px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 184, 0, 0.3);
    transition: all 0.3s ease;
}

.lgap-rating-badge:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.lgap-rating-badge-text {
    color: #000;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.lgap-rating-badge i {
    color: #FFB800;
    font-size: 0.75rem;
}

.lgap-rating-badge i.no-color {
    color: #000;
}

/* Rating Popover Styles */
.lgap-rating-badge[data-rating-popover]:hover::before {
    content: attr(data-rating-popover);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 8px;
    opacity: 0;
    animation: ratingPopoverFadeIn 0.3s ease forwards;
    pointer-events: none;
}

.lgap-rating-badge[data-rating-popover]:hover::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    margin-bottom: 3px;
    z-index: 1000;
    opacity: 0;
    animation: ratingPopoverFadeIn 0.3s ease forwards;
    pointer-events: none;
}

@keyframes ratingPopoverFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Touch device active state */
.lgap-rating-badge-active::before {
    content: attr(data-rating-popover);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 8px;
    opacity: 1;
    pointer-events: none;
}

.lgap-rating-badge-active::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    margin-bottom: 3px;
    z-index: 1000;
    opacity: 1;
    pointer-events: none;
}

.lgap-property-location i {
    color: #FFB800;
    font-size: 0.8rem;
}

/* Property Features */
.lgap-property-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.lgap-feature-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--lgap-secondary-color);
    background: #F7F7F7;
    padding: 4px 8px;
    border-radius: 12px;
    position: relative;
    cursor: help;
}

.lgap-feature-item i {
    color: #FFB800;
    font-size: 0.75rem;
}

/* Tooltip Styles */
.lgap-feature-item[data-tooltip] {
    position: relative;
}

.lgap-feature-item[data-tooltip]:hover::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
    opacity: 0;
    animation: tooltipFadeIn 0.3s ease forwards;
}

.lgap-feature-item[data-tooltip]:hover::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    margin-bottom: 1px;
    z-index: 1000;
    opacity: 0;
    animation: tooltipFadeIn 0.3s ease forwards;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Availability Gaps */
.lgap-availability-gaps {
    margin-bottom: 15px;
}

.lgap-gap-notice {
    background: rgba(255, 184, 0, 0.1);
    border: 1px solid rgba(255, 184, 0, 0.3);
    color: #333;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Card Actions */
.lgap-card-actions {
    margin-top: 20px;
}

.lgap-view-details-btn {
    display: inline-block !important;
    width: 100% !important;
    background-color: #FFB800 !important;
    color: #000 !important;
    padding: 12px 16px !important;
    border: none !important;
    /* border-radius: 6px !important; */
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    text-decoration: none !important;
    text-align: center !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
}

.lgap-view-details-btn:hover {
    background-color: #e6a600 !important;
    transform: translateY(-1px) !important;
    color: #000 !important;
    text-decoration: none !important;
}

.lgap-view-details-btn:focus,
.lgap-view-details-btn:active,
.lgap-view-details-btn:visited {
    background-color: #FFB800 !important;
    color: #000 !important;
    text-decoration: none !important;
}


/* ========================================
   Widget Controls
======================================== */
.lgap-widget-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.lgap-results-count {
    font-size: 0.9rem;
    color: #666;
}

/* ========================================
   Pagination
======================================== */
.lgap-widget-pagination {
    margin-top: 16px;
    display: flex;
    justify-content: center;
}

.lgap-pagination {
    display: flex;
    align-items: center;
}

.lgap-pagination-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 5px;
    align-items: center;
}

.lgap-pagination-item {
    margin: 0;
}

.lgap-pagination-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 8px 12px;
    color: #333;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.lgap-pagination-link:hover {
    background-color: #FFB800;
    color: #000;
    text-decoration: none;
}

.lgap-pagination-current .lgap-pagination-link {
    background-color: #FFB800;
    color: #000;
    font-weight: 600;
}

.lgap-pagination-prev,
.lgap-pagination-next {
    font-size: 1.2rem;
    min-width: 40px;
}

/* ========================================
   No Properties State
======================================== */
.lgap-no-properties {
    text-align: center;
    padding: 60px 20px;
    background: #f9f9f9;
    border-radius: 8px;
    color: #666;
}

.lgap-no-properties h2 {
    font-family: "Playfair Display", sans-serif;
    font-size: 1.5rem;
    margin: 0 0 10px;
    color: #333;
}

.lgap-no-properties p {
    margin: 0;
    font-size: 1rem;
}

/* ========================================
   Search Form Integration
======================================== */
.lgap-widget-search-form {
    margin-bottom: 30px;
}

/* ========================================
   Responsive Adjustments
======================================== */
@media (max-width: 1199px) {
    .lgap-widget-content {
        gap: 20px;
    }
    
    .lgap-card-content {
        padding: 15px;
    }
    
    /* .lgap-property-image {
        height: 180px;
    } */
}

@media (max-width: 1023px) {
    .lgap-filters-container {
        padding: 15px;
    }
    
    .lgap-filter-actions {
        flex-direction: row;
    }
    
    .lgap-apply-filters-btn,
    .lgap-clear-filters-btn {
        width: auto;
        flex: 1;
    }
}

@media (max-width: 767px) {
    .lgap-card-content {
        padding: 12px;
    }
    
    /* .lgap-property-image {
        height: 160px;
    } */
    
    .lgap-filters-title {
        font-size: 1.1rem;
    }
    
    .lgap-filter-title {
        font-size: 0.9rem;
    }
    
    .lgap-property-title {
        font-size: 1rem;
    }
    
    .lgap-filter-actions {
        flex-direction: column;
    }
    
    .lgap-apply-filters-btn,
    .lgap-clear-filters-btn {
        width: 100%;
    }
    
    .lgap-widget-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .lgap-pagination-list {
        gap: 2px;
    }
    
    .lgap-pagination-link {
        min-width: 35px;
        height: 35px;
        padding: 6px 10px;
        font-size: 0.9rem;
    }
}

/* ========================================
   Dark Mode Support (Elementor Pro)
======================================== */

/* ========================================
   High Contrast Mode Support
======================================== */
@media (prefers-contrast: high) {
    .lgap-property-card {
        border-width: 2px;
        border-color: #000;
    }
    
    .lgap-view-details-btn {
        border: 2px solid #000;
    }
    
    .lgap-filter-input,
    .lgap-filter-select {
        border-width: 2px;
        border-color: #000;
    }
}

/* ========================================
   RTL Support
======================================== */
[dir="rtl"] .lgap-property-location {
    flex-direction: row-reverse;
}

[dir="rtl"] .lgap-property-features {
    flex-direction: row-reverse;
}

[dir="rtl"] .lgap-rating-badge {
    left: auto;
    right: 10px;
}

[dir="rtl"] .lgap-price-badge {
    right: auto;
    left: 10px;
}
