/* --- Hevosmyynti Container & Layout --- */
#rekisteriContainer {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 950px;
    margin: 0 auto;
    width: 100%;
}

.loading-text, .no-sales-text {
    text-align: center;
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
}

.error-text {
    text-align: center;
    color: #f87171;
    font-weight: 500;
}

/* --- Professional Sale Card Component --- */
.sale-card {
    display: flex;
    align-items: stretch;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    padding: 20px;
    gap: 20px;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.01);
    transition: all 0.25s ease-in-out;
    width: 100%;
    box-sizing: border-box;
}

.sale-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 12px 24px -4px rgba(0, 0, 0, 0.07), 0 4px 8px -2px rgba(0, 0, 0, 0.03);
    transform: translateY(-2px);
}

/* --- Image Section --- */
.sale-card-img-wrapper {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.sale-card-img {
    display: block;
    width: 240px;
    height: 180px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

/* --- Content Section --- */
.sale-card-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
    gap: 1px;
}

/* --- Top Row (Title & Badge) --- */
.sale-card-top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.sale-card-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    padding: 0;
    line-height: 1.25;
}

/* --- Listing Type Badges --- */
.sale-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.sale-badge-listing {
    background: linear-gradient(135deg, #059669, #047857);
}

/* Hieman pehmeämpi ja hillitympi sininen (Vuokra) */
.sale-badge-lease {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.sale-badge-direct {
    background: linear-gradient(135deg, #b45309, #92400e);
}

/* --- Quick Info --- */
.sale-card-quick-info {
    margin: 0;
    color: #64748b;
    font-size: 0.88rem;
    font-weight: 500;
    letter-spacing: -0.1px;
}

/* --- Description --- */
.sale-card-description {
    margin: 0;
    color: #334155;
    font-size: 0.92rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding-top: 5px;
}

/* --- Details Grid --- */
.sale-card-details-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.sale-detail-tag {
    font-size: 0.78rem;
    color: #475569;
    background: #f8fafc;
    padding: 3px 9px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    font-weight: 500;
}

/* --- Bottom Row --- */
.sale-card-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f1f5f9;
    padding-top: 8px;
    margin-top: 4px;
}

.sale-card-contact {
    font-size: 0.82rem;
    color: #64748b;
    font-weight: 500;
    padding: 4px 10px;
}

/* Oikean reunan ryhmittely (hinta + painike vierekkäin) */
.sale-card-right-group {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: auto;
}

/* Yleinen pohja hinnalle */
.sale-card-price {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.3px;
}

/* Myynnin hinta (Vihreä) */
.sale-card-price-listing {
    color: #047857;
}

/* Vuokran hinta (Pehmeämpi sininen) */
.sale-card-price-lease {
    color: #3b82f6;
}

/* Suoramyynnin hinta (Pronssi) */
.sale-card-price-direct {
    color: #b45309;
}

/* --- Paksummat outline-painikkeet --- */
.sale-action-btn {
    padding: 7px 16px;
    border-radius: 9px;
    font-size: 0.84rem;
    font-weight: 700;
    background: transparent;
    border-width: 2px;
    border-style: solid;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    white-space: nowrap;
}

/* Myynti (Vihreä outline) */
.sale-action-btn-listing {
    border-color: #059669;
    color: #047857;
}
.sale-action-btn-listing:hover {
    background: #059669;
    color: #ffffff;
}

/* Vuokra (Pehmeämpi sininen outline) */
.sale-action-btn-lease {
    border-color: #3b82f6;
    color: #3b82f6;
}
.sale-action-btn-lease:hover {
    background: #3b82f6;
    color: #ffffff;
}

/* Suoramyynti (Pronssi/kulta outline) */
.sale-action-btn-direct {
    border-color: #b45309;
    color: #b45309;
}
.sale-action-btn-direct:hover {
    background: #b45309;
    color: #ffffff;
}

/* --- Responsive Adjustments --- */
@media screen and (max-width: 768px) {
    .sale-card {
        flex-direction: column;
        align-items: stretch;
    }

    .sale-card-img-wrapper {
        width: 100%;
        justify-content: center;
    }

    .sale-card-img {
        width: 100%;
        height: 220px;
    }

    .sale-card-top-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .sale-card-bottom-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .sale-card-right-group {
        width: 100%;
        justify-content: space-between;
        margin-left: 0;
    }

    .sale-action-btn {
        flex-grow: 1;
        text-align: center;
    }
}