/**
 * Watchlist Styles
 * Modern heart icon with smooth animations
 */

/* ============================================
   Heart Icon - Base Styles
   ============================================ */
.wishlist-heart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.wishlist-heart:hover {
    transform: scale(1.1);
}

.wishlist-heart:active {
    transform: scale(0.95);
}

.wishlist-heart.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* SVG Heart Icon */
.wishlist-heart svg {
    width: 24px;
    height: 24px;
    transition: fill 0.3s ease, stroke 0.3s ease;
}

/* Empty state - outline only */
.wishlist-heart svg path {
    fill: transparent;
    stroke: #8a9199;
    stroke-width: 1.5;
    transition: fill 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                stroke 0.3s ease;
}

.wishlist-heart:hover svg path {
    stroke: #e74c3c;
}

/* Filled state - red heart */
.wishlist-heart.wishlisted svg path {
    fill: #e74c3c;
    stroke: #e74c3c;
}

/* Animation on add */
.wishlist-heart.wishlisted {
    animation: heartPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes heartPop {
    0% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

/* ============================================
   Listing Cards - Heart Position
   ============================================ */
.place-wrapper .wishlist-heart,
.ad-card .wishlist-heart {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    padding: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.place-wrapper .wishlist-heart:hover,
.ad-card .wishlist-heart:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.place-wrapper .wishlist-heart svg,
.ad-card .wishlist-heart svg {
    width: 20px;
    height: 20px;
}

/* Ads list desktop - heart position */
.desctopadsitem .ad-image {
    position: relative;
}

.desctopadsitem .ad-image .wishlist-heart {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    padding: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.desctopadsitem .ad-image .wishlist-heart:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.desctopadsitem .ad-image .wishlist-heart svg {
    width: 20px;
    height: 20px;
}

/* ============================================
   Single Page - Watchlist Button
   Styled to match Contact Advertiser button
   ============================================ */
.wishlist-btn {
    display: block;
    margin: 10px 0;
    padding: 10px 20px;
    background-color: #ffffff;
    color: #333 !important;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s, border-color 0.3s;
    cursor: pointer;
    border: 1px solid #ddd;
}

.wishlist-btn:hover {
    background-color: #f5f5f5;
    border-color: #ccc;
    text-decoration: none;
    color: #333 !important;
}

.wishlist-btn.wishlisted {
    background-color: #fef2f2;
    border-color: #e74c3c;
    color: #e74c3c !important;
}

.wishlist-btn.wishlisted:hover {
    background-color: #fee2e2;
    border-color: #dc2626;
}

.wishlist-btn svg {
    width: 18px;
    height: 18px;
    vertical-align: middle;
    margin-right: 6px;
}

.wishlist-btn svg path {
    fill: transparent;
    stroke: #e74c3c;
    stroke-width: 1.5;
    transition: fill 0.3s ease;
}

.wishlist-btn.wishlisted svg path {
    fill: #e74c3c;
    stroke: #e74c3c;
}

.wishlist-btn .wishlist-text-add,
.wishlist-btn .wishlist-text-remove {
    display: none;
}

.wishlist-btn .wishlist-text-add {
    display: inline;
}

.wishlist-btn.wishlisted .wishlist-text-add {
    display: none;
}

.wishlist-btn.wishlisted .wishlist-text-remove {
    display: inline;
}

/* ============================================
   "Go to Watchlist" Link (shows after adding)
   ============================================ */
.wishlist-btn-wrapper {
    position: relative;
}

.wishlist-goto-link {
    display: block;
    text-align: center;
    padding: 8px 15px;
    margin: 0 0 10px;
    font-size: 13px;
    color: #e3002c;
    text-decoration: none;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.3s ease, max-height 0.3s ease, padding 0.3s ease, margin 0.3s ease;
}

.wishlist-goto-link.visible {
    opacity: 1;
    max-height: 50px;
}

.wishlist-goto-link:hover {
    text-decoration: underline;
    color: #c6002a;
}

/* ============================================
   Profile Watchlist Tab
   Uses .ads-list .ad-card styles from ads-manager
   ============================================ */

/* Watchlist container */
.wishlist-container {
    padding: 20px;
}

.wishlist-container .ads-list {
    padding: 10px 0;
}

/* Deleted item placeholder in image area */
.wishlist-item-deleted {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 120px;
    background: #f3f4f6;
    color: #9ca3af;
    font-size: 13px;
    text-align: center;
    padding: 20px;
}

/* Deleted title styling */
.ad-card__title .deleted-title {
    color: #9ca3af;
    font-style: italic;
}

/* Deleted status badge */
.wishlist-container .status.deleted {
    background-color: #fee2e2;
    color: #dc2626;
}

/* Remove button styling - red style for wishlist remove */
.wishlist-container .btn-remove,
.wishlist-container .action-btn.wishlist-remove {
    cursor: pointer;
    background: #fee2e2;
    color: #dc2626;
    border: none;
}

.wishlist-container .action-btn.wishlist-remove:hover {
    background: #fecaca;
    color: #b91c1c;
}

/* View button styling (separate class to avoid ads-manager.js edit handler) */
.wishlist-container .action-btn.view {
    background: #f3f4f6;
    color: #4b5563;
    text-decoration: none;
    display: inline-block;
}

.wishlist-container .action-btn.view:hover {
    background: #e5e7eb;
}

/* Empty watchlist state */
.wishlist-empty {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.wishlist-empty-icon {
    margin-bottom: 20px;
}

.wishlist-empty-icon svg {
    width: 64px;
    height: 64px;
    stroke: #d1d5db;
    fill: none;
    stroke-width: 1;
}

.wishlist-empty-title {
    font-size: 20px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.wishlist-empty-text {
    font-size: 14px;
    margin-bottom: 20px;
}

.wishlist-empty-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #e3002c;
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s ease;
}

.wishlist-empty-btn:hover {
    background: #c6002a;
    color: #fff;
}

/* ============================================
   Header Watchlist Link
   ============================================ */
.header-wishlist-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: inherit;
    text-decoration: none;
}

.header-wishlist-link svg {
    width: 18px;
    height: 18px;
}

.header-wishlist-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #e74c3c;
    color: #fff;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 600;
}

.header-wishlist-count:empty {
    display: none;
}

/* ============================================
   Mobile Responsive
   ============================================ */
@media (max-width: 768px) {
    .wishlist-btn-wrapper {
        margin: 0 9px;
    }

    .wishlist-btn {
        display: inline-block;
        margin: 0px 0 8px;
        padding: 10px 20px;
        width: 100%;
        font-size: 13px;
    }

    .wishlist-goto-link {
        margin: -5px 0 10px;
        padding: 6px 10px;
        font-size: 12px;
    }

    .wishlist-btn svg {
        width: 16px;
        height: 16px;
    }

    .place-wrapper .wishlist-heart,
    .ad-card .wishlist-heart {
        top: 8px;
        right: 8px;
        padding: 6px;
    }

    .place-wrapper .wishlist-heart svg,
    .ad-card .wishlist-heart svg {
        width: 18px;
        height: 18px;
    }

    /* Fix View button in wishlist for mobile */
    .wishlist-container .ad-card__actions {
        position: relative;
        z-index: 10;
    }

    .wishlist-container .action-btn.view {
        display: inline-block;
        text-decoration: none;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
        min-height: 44px;
        min-width: 44px;
        line-height: 32px;
        pointer-events: auto;
        cursor: pointer;
    }

    .wishlist-container .btn-remove {
        min-height: 44px;
        min-width: 44px;
        pointer-events: auto;
    }

    /* Ensure card content doesn't block clicks */
    .wishlist-container .ad-card__content {
        position: relative;
    }

    .wishlist-container .ad-card__footer {
        position: relative;
        z-index: 5;
    }
}

/* ============================================
   Login Required Tooltip
   ============================================ */
.wishlist-login-tooltip {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1f2937;
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 10000;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.wishlist-login-tooltip.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.wishlist-login-tooltip a {
    color: #ff6b6b;
    text-decoration: underline;
}
