/* ==========================================================================
   LISTING CARD STYLES
   Standalone, robust, theme-aware property card component.
   ========================================================================== */

@import "seller_contact.css";

.listing-card {
    container-type: inline-size;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: 14px;
    background: var(--bg-card, rgba(255, 255, 255, 0.04));
    border: 1px solid rgba(222, 173, 170, 0.2);
    box-shadow: 0 4px 20px var(--shadow, rgba(0, 0, 0, 0.08));
    overflow: hidden;
    transition:
        transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1),
        border-color 0.25s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

@media (prefers-color-scheme: light) {
    .listing-card {
        background: #ffffff;
        border-color: rgba(222, 173, 170, 0.35);
        box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
    }
}

.listing-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 2px 10px rgba(222, 173, 170, 0.28),
        0 4px 12px rgba(0, 0, 0, 0.12);
    border-color: var(--secondary, #deadaa);
}

/* Premium listings receive a distinct gold treatment. */
.listing-card--boosted {
    border-color: rgba(230, 183, 124, 0.55);
    box-shadow:
        0 10px 20px rgba(230, 183, 124, 0.18),
        0 4px 20px var(--shadow, rgba(0, 0, 0, 0.08));
}

.listing-card--boosted:hover {
    border-color: var(--accent, #e6b77c);
    box-shadow:
        0 3px 14px rgba(230, 183, 124, 0.42),
        0 6px 18px rgba(0, 0, 0, 0.14);
}

.listing-card--boosted .listing-card-media,
.listing-card--boosted .seller-avatar-wrap {
    border-color: var(--accent, #e6b77c);
}

/* --------------------------------------------------------------------------
   MEDIA / COVER IMAGE
   -------------------------------------------------------------------------- */
.listing-card-media {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    background: #0f172a;
    overflow: visible;
    border-bottom: 1px solid var(--secondary, #deadaa);
}

.listing-card-image-link {
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.listing-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.listing-card:hover .listing-card-img {
    transform: scale(1.04);
}

.listing-card-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #111827, #1f2937);
}

.placeholder-svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Floating Badges */
.listing-card-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    z-index: 2;
}

.listing-card-badges .badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 6px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.badge-fresh {
    background: rgba(230, 183, 124, 0.9);
    color: #0f172a;
}

.badge-purpose {
    margin-left: auto;
    border: 1px solid rgba(255, 255, 255, 0.35);
}

.badge-purpose--rent {
    background: #dbeafe;
    color: #1e3a8a;
}

.badge-purpose--sale {
    background: #deadaa;
    color: #412321;
}

.badge-purpose--short-term {
    background: #ccfbf1;
    color: #115e59;
}

/* --------------------------------------------------------------------------
   SELLER AVATAR OVERLAY
   Centered circular avatar positioned over the bottom border of the image
   -------------------------------------------------------------------------- */
.listing-seller-img-overlay-parent {
    position: relative;
    width: 100%;
    height: 0;
    overflow: visible;
    z-index: 3;
}

.listing-seller-card-icon-overlay {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translate(-50%, 50%);
    display: flex;
    justify-content: center;
    align-items: center;
}

.seller-avatar-wrap {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    padding: 0px;
    background: var(--primary, #0f172a);
    border: 1px solid var(--secondary, #deadaa);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

@media (prefers-color-scheme: light) {
    .seller-avatar-wrap {
        background: #ffffff;
    }
}

.listing-card:hover .seller-avatar-wrap {
    transform: scale(1.06);
    box-shadow: 0 2px 6px rgba(222, 173, 170, 0.4);
}

.seller-avatar-icon {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(
        135deg,
        rgba(222, 173, 170, 0.25),
        rgba(230, 183, 124, 0.25)
    );
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary, #deadaa);
    font-weight: 700;
    font-size: 0.85rem;
}

.seller-initials {
    letter-spacing: -0.02em;
    color: var(--text-color, #ffffff);
}

@media (prefers-color-scheme: light) {
    .seller-initials {
        color: var(--text-dark, #1c1c1c);
    }
}

/* --------------------------------------------------------------------------
   CARD BODY
   -------------------------------------------------------------------------- */
.listing-card-body {
    padding: 1.55rem 1rem 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 0.45rem;
}

/* Seller and listing badge row */
.listing-card-seller-badge-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-height: 1.35rem;
    margin-bottom: 0.1rem;
}

.verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #10b981;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 2px 7px;
    border-radius: 12px;
}

.verified-icon {
    flex-shrink: 0;
}

.verified-badge-spacer {
    height: 1px;
}

.boost-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    padding: 2px 7px;
    border: 1px solid;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 600;
}
.boost-badge--standard {
    background: rgba(217, 164, 6, 0.12);
    color: var(--accent);
    border-color: rgba(217, 164, 6, 0.35);
}
.boost-badge--pro {
    background: #ede9fe;
    color: #5b21b6;
    border-color: #c4b5fd;
}
.boost-badge--premium {
    background: #fef3c7;
    color: #854d0e;
    border-color: #fcd34d;
}
.boost-badge-icon {
    display: inline-flex;
    flex-shrink: 0;
}
.boost-badge-icon svg {
    width: 15px;
    height: 15px;
    fill: currentColor;
}
.boost-badge--pro svg {
    stroke: currentColor;
}

/* Title */
.listing-card-title-link {
    text-decoration: none;
    color: inherit;
}

.listing-card-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-color, #ffffff);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: clip;
    transition: color 0.2s ease;
}

@media (prefers-color-scheme: light) {
    .listing-card-title {
        color: #111827;
    }
}

.listing-card-title-link:hover .listing-card-title {
    color: var(--secondary, #deadaa);
}

/* Description */
.listing-card-description {
    margin: 0;
    font-size: var(--font-size-sm);
    line-height: 1.45;
    color: #97a2b2;
}

.listing-view-more {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 6px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #ffffff;
    background: var(--secondary, #deadaa);
    border-radius: 4px;
    text-decoration: none;
    transition:
        opacity 0.2s ease,
        transform 0.15s ease;
}

@media (prefers-color-scheme: light) {
    .listing-view-more {
        color: #111827;
    }
}

.listing-view-more:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

/* Info Rows: Location & Style */
.listing-card-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    line-height: 1.3;
}
.listing-style-row .spec-item {
    /*justify-self: flex-end;*/
    margin-left: auto;
}

.listing-card-icon {
    width: 15px;
    height: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--secondary, #deadaa);
}

.listing-card-icon svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.listing-meta-label {
    font-weight: 600;
    color: var(--secondary, #deadaa);
    font-size: 0.82rem;
}

.listing-meta-value {
    color: var(--text-color, #ffffff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (prefers-color-scheme: light) {
    .listing-meta-value {
        color: #111827;
    }
}

/* --------------------------------------------------------------------------
   PROPERTY SPECS
   -------------------------------------------------------------------------- */
.listing-card-specs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 0.4rem 0;
    border-top: 1px solid rgba(222, 173, 170, 0.15);
    border-bottom: 1px solid rgba(222, 173, 170, 0.15);
    margin: 0.2rem 0;
}

.spec-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.82rem;
}

.spec-icon {
    width: 14px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary, #deadaa);
    flex-shrink: 0;
}

.spec-icon svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.spec-label {
    color: var(--secondary, #deadaa);
    font-weight: 600;
    font-size: 0.8rem;
}

.spec-value {
    color: var(--text-color, #ffffff);
    font-weight: 700;
}

@media (prefers-color-scheme: light) {
    .spec-value {
        color: #111827;
    }
}

/* --------------------------------------------------------------------------
   PRICING
   -------------------------------------------------------------------------- */
.listing-card-pricing {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 0.1rem;
    height: 100%;
    justify-content: space-between;
}

.price-tag {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    padding-bottom: 5px;
}

.price-type {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--secondary, #deadaa);
}

.price-amount {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--accent, #e6b77c);
    letter-spacing: -0.01em;
}

@media (prefers-color-scheme: light) {
    .price-amount {
        color: #0f172a;
    }
}

.price-currency {
    margin-right: 1px;
}

.price-period {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--muted, #94a3b8);
}

.pricing-meta {
    display: flex;
    gap: var(--gap-sm);
}

.priciing-meta-badge {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(222, 173, 170, 0.15);
    color: var(--text-color, --muted);
    border: 1px solid var(--muted);
}

/* --------------------------------------------------------------------------
   METADATA (Posted date, reference, owner badge)
   -------------------------------------------------------------------------- */
.listing-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px;
    padding-top: 0.35rem;
    margin-top: auto;
    border-top: 1px dashed rgba(222, 173, 170, 0.12);
}

.meta-text {
    font-size: 0.72rem;
    color: var(--muted, #64748b);
}

.owner-badge {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(222, 173, 170, 0.15);
    color: var(--secondary, #deadaa);
    border: 1px solid rgba(222, 173, 170, 0.3);
}

/* --------------------------------------------------------------------------
   CARD ACTIONS (FOOTER)
   5 equal action buttons across bottom of card
   -------------------------------------------------------------------------- */
.listing-card-actions {
    display: flex;
    align-items: stretch;
    width: 100%;
    border-top: 1px solid rgba(222, 173, 170, 0.2);
    background: rgba(222, 173, 170, 0.08);
}

@media (prefers-color-scheme: light) {
    .listing-card-actions {
        background: #fdfaf8;
    }
}

.card-action-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 4px;
    background: transparent;
    border: none;
    border-right: 1px solid rgba(222, 173, 170, 0.2);
    color: var(--secondary, #deadaa);
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        transform 0.12s ease;
}

.card-action-btn:last-child {
    border-right: none;
}

.card-action-btn img,
.card-action-btn svg {
    width: 18px;
    height: 18px;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    filter: brightness(0.95);
}

.card-action-btn:hover {
    background: var(--secondary, #deadaa);
    color: var(--text-light);
}

.card-action-btn:hover img {
    filter: brightness(0) saturate(100%);
    transform: scale(1.18);
}

.card-action-btn:hover svg {
    fill: var(--text-light);
    transform: scale(1.18);
}

.card-action-btn:active {
    transform: scale(0.92);
}

/* Active Saved / Favorite state */
.card-action-btn.is-favorite {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.card-action-btn.is-favorite img {
    filter: invert(34%) sepia(85%) saturate(3000%) hue-rotate(338deg)
        brightness(98%) contrast(96%);
}
