/**
 * RFQ List Cards - Horizontal Layout
 */

.rfq-list-cards {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.rfq-card-horizontal {
    background: var(--bg-white);
    border: 1px solid var(--border-color-dark);
    border-radius: 8px;
    padding: 14px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.rfq-card-horizontal:hover {
    box-shadow: var(--shadow-md);
}

.rfq-card-horizontal.card--verified {
    border-color: #108D52;
    border-width: 1px;
}

.rfq-card-content {
    display: flex;
    width: 100%;
}

/* ==========================================================================
   Left Section: Main Content
   ========================================================================== */

.rfq-card-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-right: 1px solid var(--border-color-light);
    padding-right: 36px;
}

/* Header: Badges, Title, Status */
.rfq-card-header-horizontal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.rfq-header-left {
    flex: 1;
    display: flex;
    gap: 8px;
}

.rfq-badges-horizontal {
    display: flex;
    gap: 12px;
    align-items: start;
    margin-bottom: 0;
}

/* Hide badges container when empty (no badges) */
.rfq-badges-horizontal:empty,
.rfq-badges-horizontal:not(:has(.badge)) {
    display: none;
    margin-bottom: 0;
}

/* Badge styles are now in components/badge.css */
.badge-verified svg,
.badge--verified svg {
    flex-shrink: 0;
}

.rfq-title-horizontal {
    font-size: 14px;
    font-weight: 700;
    line-height: 22px;
    color: var(--color-primary);
    margin: 0;
    display: inline;
}

.rfq-header-right {
    flex-shrink: 0;
}

.posted-time {
    font-size: 12px;
    line-height: 18px;
    color: var(--color-text-secondary);
}

/* Description */
.rfq-description-horizontal {
    background: var(--bg-blue-light);
    padding: 10px 12px;
    min-height: 122px;
    max-height: 122px;
    display: flex;
    align-items: flex-start;
}

.description-text {
    width: 100%;
    font-size: 12px;
    font-weight: 400;
    line-height: 18px;
    color: var(--color-text-tertiary);
    text-align: justify;
    max-height: 102px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 10px;
}

.description-text::-webkit-scrollbar {
    width: 6px;
}

.description-text::-webkit-scrollbar-track {
    background: var(--border-color-light);
    border-radius: 30px;
}

.description-text::-webkit-scrollbar-thumb {
    background: var(--color-success);
    border-radius: 30px;
    height: 24px;
}

.description-text::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-tertiary);
}

/* Details and Actions */
.rfq-details-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.rfq-details-list {
    flex: 1;
}

.rfq-details-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.rfq-details-list li {
    font-size: 12px;
    font-weight: 500;
    line-height: 18px;
    list-style: disc;
    margin-left: 1.5em;
}

.detail-label {
    color: var(--color-text-tertiary);
}

.detail-value {
    color: var(--color-text-primary);
}

.rfq-actions-horizontal {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.rfq-actions-horizontal a{
    font-size: 12px;
}

/* Quotation Action Wrapper */
.rfq-quotation-action-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}

/* Contact Restriction Message */
.rfq-contact-restriction-message {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 4px;
    font-size: 12px;
    line-height: 18px;
    color: #F59E0B;
    max-width: 100%;
}

.rfq-contact-restriction-message .icon-lock {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.rfq-contact-restriction-message .message-text {
    flex: 1;
    word-wrap: break-word;
    font-weight: 500;
}

/* Button action-icon styles are now in components/button.css */

/* SVG Icon Hover States - Tự quản lý bằng CSS */
.btn-chat:hover .icon-chat {
    color: #108D52 !important;
}

.btn-share:hover .icon-share {
    color: #108D52 !important;
}

/* Tags */
.rfq-tags-horizontal {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 8px;
    position: relative;
}

.tag-link {
    font-size: 12px;
    font-weight: 400;
    line-height: 22px;
    color: var(--color-primary);
    white-space: nowrap;
}

.tag-separator {
    display: inline-block;
    width: 1px;
    height: 12px;
    background-color: var(--border-color-light);
    vertical-align: middle;
}

/* ==========================================================================
   Right Section: Buyer Profile
   ========================================================================== */

.rfq-card-profile {
    width: 258px;
    flex-shrink: 0;
    padding-left: 20px;
    padding-right: 12px;
    padding-top: 24px;
}

.rfq-profile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 100%;
}

.rfq-profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.rfq-avatar {
    border: 2px solid var(--border-color-light);
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--border-color-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 500;
    line-height: 36px;
    color: var(--color-text-dark);
    flex-shrink: 0;
    overflow: hidden;
}

.rfq-avatar-image {
    border: 2px solid var(--border-color-light);
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.rfq-avatar-initials {
    font-size: 20px;
    font-weight: 600;
    line-height: 1;
    color: var(--color-text-dark);
    text-transform: uppercase;
}

.rfq-info-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.rfq-name {
    font-size: 16px;
    font-weight: 700;
    line-height: 20px;
    color: var(--color-primary);
    margin: 0;
    text-align: center;
}

.rfq-rating-stars {
    display: flex;
    align-items: center;
    gap: 0;
}

.rfq-rating-stars .star {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Partial star styling */
.rfq-rating-stars .star.partial {
    position: relative;
}

.rfq-rating-stars .star.partial .star-partial-overlay {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    overflow: hidden;
    height: 100%;
}

.rfq-rating-stars .star.partial .star-partial-overlay svg {
    display: block;
    flex-shrink: 0;
}

.rfq-rating-stars .star.partial .star-partial-overlay svg path {
    fill: var(--color-warning);
}

.rfq-location-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.rfq-location-info .location-flag {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0px 1px 1px 0px rgba(0, 0, 0, 0.25);
    flex-shrink: 0;
}

.rfq-location-info span {
    font-size: 12px;
    font-weight: 700;
    line-height: 18px;
    color: var(--color-text-tertiary);
}

.rfq-buying-leads-count {
    font-size: 12px;
    font-weight: 700;
    line-height: 18px;
    color: var(--color-error);
    text-align: center;
    margin-top: 4px;
}

.rfq-contact {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px;
    border-radius: 14px;
}

.contact-item-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-success-light);
    padding: 4px;
}

.contact-item span {
    font-size: 12px;
    font-weight: 500;
    line-height: 20px;
    color: var(--color-primary);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
    .rfq-card-header-horizontal {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
        gap: 8px;
        position: relative;
    }

    .rfq-header-left {
        flex-direction: column;
        gap: 0;
        flex: 1;
        min-width: 0;
    }

    .rfq-badges-horizontal {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .rfq-header-right {
        flex-shrink: 0;
        margin-top: 0;
    }
}

@media (max-width: 768px) {
    .rfq-card-horizontal {
        padding: 12px;
    }

    .rfq-card-content {
        flex-direction: column;
        gap: 12px;
    }

    .rfq-card-main {
        border-right: none;
        border-bottom: 1px solid var(--border-color-light);
        padding-right: 0;
        padding-bottom: 12px;
        margin-bottom: 0;
        gap: 10px;
    }

    .rfq-card-profile {
        width: 100%;
        padding: 0;
    }

    .rfq-details-actions {
        flex-direction: column;
        align-items: start;
        gap: 12px;
    }

    .rfq-actions-horizontal {
        width: 100%;
        justify-content: flex-start;
    }

    .rfq-actions-horizontal a{
        width: 100%;
        text-align: center;
    }

    .rfq-profile-card {
        flex-direction: row;
        align-items: flex-start;
        gap: 12px;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .rfq-profile-header {
        flex-direction: row;
        align-items: flex-start;
        gap: 10px;
        flex: 0 0 auto;
        min-width: 0;
        width: auto;
    }

    .rfq-avatar {
        font-size: 18px;
        flex-shrink: 0;
    }

    .rfq-info-group {
        gap: 6px;
        align-items: flex-start;
        flex: 0 1 auto;
        min-width: 0;
    }

    .rfq-name {
        font-size: 12px;
        line-height: 16px;
        text-align: left;
        margin: 0;
    }

    .rfq-title-horizontal {
        font-size: 14px;
    }

    .rfq-rating-stars {
        justify-content: flex-start;
        order: 2;
    }

    .rfq-rating-stars .star {
        width: 14px;
        height: 12px;
    }

    .rfq-location-info {
        justify-content: flex-start;
        order: 1;
    }

    .rfq-location-info span {
        font-size: 12px;
        line-height: 16px;
    }

    .rfq-buying-leads-count {
        font-size: 12px;
        line-height: 16px;
        text-align: left;
        margin-top: 0;
        order: 1;
    }

    .rfq-contact {
        flex-direction: row;
        gap: 8px;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        flex-wrap: wrap;
    }

    .contact-item {
        justify-content: flex-start;
        padding: 2px 0;
        white-space: nowrap;
        flex: 0 1 auto;
        min-width: 0;
        max-width: 48%;
    }

    .contact-item span {
        font-size: 12px;
        line-height: 16px;
        word-break: break-all;
        text-align: left;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
    }

    .description-text {
        font-size: 12px;
    }

    .rfq-details-list li {
        font-size: 12px;
    }

    .rfq-quotation-action-wrapper {
        flex: 1;
        width: 100%;
    }

    .rfq-quotation-action-wrapper .btn-send-quotation,
    .rfq-quotation-action-wrapper .button--primary {
        width: 100%;
    }

    .rfq-contact-restriction-message {
        width: 100%;
        font-size: 11px;
        padding: 6px 10px;
        gap: 6px;
    }

    .rfq-contact-restriction-message .icon-lock {
        width: 14px;
        height: 14px;
    }
}


