/**
 * Likes System Styles
 * All styles related to likes functionality and favorites popup
 */

/* ===========================================
   PROPERTY LIKE BUTTONS
   =========================================== */

/* Pulsante Like */
.property-like-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    background: transparent !important;
    border: unset !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.property-like-btn.single-property-like {
    position: relative;
    top: auto;
    right: auto;
    margin: 0 auto;
    display: inline-flex;
}

.property-like-btn:hover {
    transform: scale(1.1);
}

.property-like-btn.liked .like-icon {
    color: #e74c3c;
    fill: #e74c3c;
}

.like-icon {
    width: 18px;
    height: 18px;
    color: #e74c3c;
    transition: all 0.3s ease;
    fill: rgb(231 76 60 / 26%);
}

/* ===========================================
   SINGLE PROPERTY LIKE BUTTON
   =========================================== */

.single-property-like-btn {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #e1e1e1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 10;
}

.single-property-like-btn:hover {
    background: #fff;
    border-color: #007cba;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.single-property-like-btn.liked .single-like-icon {
    color: #e74c3c;
    fill: #e74c3c;
}

.single-like-icon {
    width: 24px;
    height: 24px;
    color: #666;
    transition: all 0.3s ease;
    fill: currentColor;
}

.single-property-like-btn.liked .single-like-icon {
    animation: like-pulse 0.6s ease !important;
}

/* ===========================================
   MENU LIKE BUTTON
   =========================================== */

.menu-like-button {
    margin-right: 15px !important;
}

.nav-like-btn {
    background: transparent !important;
    border: none !important;
    border-radius: 50% !important;
    width: 36px !important;
    height: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    font-family: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    color: inherit !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    position: relative !important; /* Necessario per il posizionamento del contatore */
}

.nav-like-btn:hover {
    transform: scale(1.1) !important;
    background: transparent !important;
}

.nav-like-btn.liked .nav-like-icon {
    fill: #ff4757 !important;
    stroke: #ff4757 !important;
}

.nav-like-icon {
    width: 20px !important;
    height: 20px !important;
    transition: all 0.3s ease !important;
    color: #e74c3c;
    fill: rgb(231 76 60 / 26%);
}

.nav-like-btn.liked .nav-like-icon {
    animation: like-pulse 0.6s ease !important;
}

.nav-like-btn.like-clicked {
    animation: like-bounce 0.3s ease !important;
}

/* Contatore like per il pulsante del menu */
.like-counter {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: transparent;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
    pointer-events: none;
    z-index: 1;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.like-counter:empty {
    display: none;
}

/* Menu Navigation Alignment */
#main-nav-04b0f84 {
    align-items: center !important;
}

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

@keyframes like-pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes like-bounce {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

/* ===========================================
   RESPONSIVE STYLES
   =========================================== */

/* Mobile adjustments */
@media (max-width: 767px) {
    .property-like-btn {
        width: 32px;
        height: 32px;
        top: 8px;
        right: 8px;
    }

    .like-icon {
        width: 16px;
        height: 16px;
    }

    .single-property-like-btn {
        width: 45px;
        height: 45px;
    }

    .favorites-cards-grid {
        grid-template-columns: repeat(1, 1fr);
    }

    /* Align like button to left on mobile */
    .menu-like-button {
        display: flex !important;
        justify-content: flex-start !important;
        padding-left: 0 !important;
    }

    .menu-like-button .nav-like-btn {
        margin-left: 0 !important;
        align-self: flex-start !important;
    }

    #main-nav-04b0f84 {
        align-items: flex-start !important;
    }
}

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 1023px) {
    .property-like-btn {
        width: 34px;
        height: 34px;
    }

    .like-icon {
        width: 17px;
        height: 17px;
    }
}

/* Desktop adjustments */
@media (min-width: 1024px) and (max-width: 1199px) {
    .property-like-btn {
        width: 35px;
        height: 35px;
    }
}

/* Large desktop */
@media (min-width: 1200px) {
    .property-like-btn {
        width: 36px;
        height: 36px;
    }
}

/* ===========================================
   FAVORITES POPUP
   =========================================== */

.favorites-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.favorites-popup.show {
    opacity: 1;
    visibility: visible;
}

.favorites-popup-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
}

.favorites-popup.show .favorites-popup-content {
    transform: scale(1) translateY(0);
}

.favorites-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

.favorites-popup-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--e-global-color-primary);
    font-family: var(--e-global-typography-primary-font-family), Sans-serif;
}

.favorites-popup-close {
    background: none !important;
    border: none !important;
    font-size: 24px !important;
    color: #666 !important;
    cursor: pointer !important;
    padding: 0 !important;
    width: 30px !important;
    height: 30px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    transition: all 0.2s ease !important;
    font-family: inherit !important;
    font-weight: normal !important;
}

.favorites-popup-close:hover {
    background: #eee !important;
    color: #333 !important;
}

.favorites-popup-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(80vh - 80px);
}

/* Hide default browser scrollbar */
.favorites-popup-body::-webkit-scrollbar {
    display: none;
}

/* No favorites message */
.no-favorites-message {
    text-align: center;
    padding: 40px 20px;
}

.no-favorites-message svg {
    width: 48px;
    height: 48px;
    color: #ddd;
    margin-bottom: 16px;
}

.no-favorites-message p {
    margin: 8px 0;
    color: #666;
    font-size: 16px;
    font-weight: 500;
}

.favorites-popup-subtitle {
    color: #999 !important;
    font-size: 14px !important;
    font-weight: 400 !important;
}

/* Favorites list */
.favorites-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.favorite-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #eee;
    transition: all 0.2s ease;
}

.favorite-item:hover {
    background: #f0f1f2;
    border-color: #ddd;
}

.favorite-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.favorite-title {
    font-weight: 500;
    color: var(--e-global-color-primary);
    font-family: var(--e-global-typography-primary-font-family), Sans-serif;
}

.remove-favorite {
    background: none !important;
    border: none !important;
    color: #ff4757 !important;
    cursor: pointer !important;
    padding: 8px !important;
    border-radius: 50% !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-family: inherit !important;
    font-size: inherit !important;
    font-weight: normal !important;
}

.remove-favorite:hover {
    background: rgba(255, 71, 87, 0.1) !important;
    transform: scale(1.1) !important;
}

/* Prevent body scroll when popup is open */
body.favorites-popup-open {
    overflow: hidden;
}

/* ===========================================
   FAVORITES CARDS (nuovo sistema con card)
   =========================================== */

/* Favorites Cards Grid */
.favorites-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 8px;
}

.favorites-cards-grid::-webkit-scrollbar {
    display: none;
}

/* Favorite Card Item */
.favorite-card-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #eee;
}

.favorite-card-item:hover {
    transform: translateY(-2px);
}

.favorite-card-content {
    position: relative;
}

/* Favorite Card Image */
.favorite-card-image {
    position: relative;
    height: 160px;
    overflow: hidden;
}

.favorite-card-image-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 1;
}

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

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

/* Remove Favorite Button */
.remove-favorite-card {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.9) !important;
    border: none !important;
    border-radius: 50% !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    color: #ff4757 !important;
    font-family: inherit !important;
    font-size: inherit !important;
    font-weight: normal !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    z-index: 10 !important;
}

.remove-favorite-card:hover {
    background: #ff4757 !important;
    color: white !important;
    transform: scale(1.1) !important;
}

.remove-favorite-card svg {
    width: 16px !important;
    height: 16px !important;
}

/* Favorite Card Info */
.favorite-card-info {
    padding: 16px;
}

.favorite-card-zone {
    font-size: 11px;
    color: #8B4513;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    font-family: 'Inter', sans-serif;
}

.favorite-card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    line-height: 1.3;
    font-family: var(--e-global-typography-primary-font-family), Sans-serif;
}

.favorite-card-title a {
    color: var(--e-global-color-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.favorite-card-title a:hover {
    color: var(--e-global-color-secondary);
}

.favorite-card-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--e-global-color-secondary);
    margin-bottom: 12px;
    font-family: var(--e-global-typography-primary-font-family), Sans-serif;
}

.favorite-card-meta {
    display: flex;
    gap: 12px;
}

.favorite-card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--e-global-color-primary);
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}

.favorite-card-meta .icon-small {
    width: 14px;
    height: 14px;
    color: var(--e-global-color-secondary);
}