/**
 * Provider Card Component — loaded on homepage + reviews only.
 *
 * Extracted from hostoffers-custom.css during CSS refactoring.
 * Contains: provider card layout, match score bars, overall badge,
 * block-editor CTA buttons, key advantages.
 *
 * @package HostOffers
 * @since   1.1.0
 */

/* ==========================================================================
   Provider Cards List Wrapper (shortcode output)
   ========================================================================== */

.ho-provider-cards-list {
    display: grid;
    gap: 24px;
    padding-block-end: 34px;
}

/* ==========================================================================
   Provider Card Component
   ========================================================================== */

/* --- Card Container --- */
.ho-provider-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 16px !important;
    padding: 24px;
    margin-bottom: 0;
    overflow: hidden;
    transition: box-shadow 0.4s ease;
}

.ho-provider-card:hover {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* --- 2-Column Layout matching prototype card.jsx --- */
.ho-card-layout {
    display: flex;
    gap: 32px;
}

/* --- Column 1: Logo & Price --- */
.ho-card-col-logo {
    flex-shrink: 0;
    width: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #f1f5f9;
    padding-right: 32px;
    text-align: center;
}

.ho-card-logo img,
.ho-card-logo-img {
    border-radius: 16px;
    object-fit: cover;
    width: 96px;
    height: 96px;
    margin-bottom: 16px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.ho-card-starting-at {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 4px;
}

.ho-card-price {
    display: block;
    font-size: 24px;
    font-weight: 800;
    color: #003366;
    font-family: 'Montserrat', sans-serif;
    line-height: 2rem;
    margin: 0;
}

.ho-card-price-block {
    text-align: center;
}

/* --- Column 2: Details --- */
.ho-card-col-details {
    flex-grow: 1;
    min-width: 0;
}

/* Header row: name + badge side by side */
.ho-card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.ho-card-header-text {
    flex: 1;
    min-width: 0;
}

.ho-card-provider-name {
    font-size: 24px !important;
    font-weight: 800 !important;
    color: #003366 !important;
    margin: 0 !important;
    line-height: 1.3 !important;
    font-family: 'Montserrat', sans-serif !important;
}

.ho-provider-card:hover .ho-card-provider-name {
    color: #00A859 !important;
    transition: color 0.15s ease;
}

.ho-card-tagline {
    font-size: 14px;
    color: #64748b;
    margin: 4px 0 0;
    line-height: 1.4;
}

/* --- Match Scores Row (gray container matching prototype) --- */
.ho-match-scores {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    margin-bottom: 24px;
}

.ho-match-scores>.wp-block-group,
.ho-score-item {
    min-width: 0;
    padding: 0;
}

.ho-score-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 3px;
}

.ho-score-header p,
.ho-score-header span {
    margin: 0 !important;
}

.ho-score-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: -0.025em;
    text-transform: uppercase;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ho-score-value {
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
}

.ho-score-item--active .ho-score-value {
    color: #00A859;
}

/* --- Progress Bar --- */
.ho-score-bar-track {
    height: 6px;
    background-color: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    padding: 0 !important;
}

.ho-score-bar-track .wp-block-group__inner-container {
    height: 100%;
}

hr.ho-score-bar-fill,
div.ho-score-bar-fill {
    height: 6px !important;
    border: none !important;
    border-radius: 999px;
    min-height: 6px !important;
    padding: 0 !important;
    margin: 0 !important;
    opacity: 1 !important;
    transition: width 0.6s ease;
}

hr.ho-score-bar-fill.ho-score-high,
div.ho-score-bar-fill.ho-score-high {
    background-color: #00A859 !important;
}

hr.ho-score-bar-fill.ho-score-mid,
div.ho-score-bar-fill.ho-score-mid {
    background-color: rgba(0, 51, 102, 0.4) !important;
}

hr.ho-score-bar-fill.ho-score-low,
div.ho-score-bar-fill.ho-score-low {
    background-color: rgba(0, 51, 102, 0.4) !important;
}

/* --- Key Advantages --- */
.ho-card-bottom-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.ho-card-advantages-title {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #94a3b8;
    margin: 0 0 8px;
}

.ho-card-advantages {
    list-style: none !important;
    padding-left: 0 !important;
    margin: 0 !important;
}

.ho-card-advantages li {
    font-size: 14px;
    color: #334155;
    font-weight: 500;
    padding: 4px 0 4px 26px;
    position: relative;
    line-height: 1.4;
}

.ho-card-advantages li::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    position: absolute;
    left: 0;
    top: 5px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300a859' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21.801 10A10 10 0 1 1 17 3.335'/%3E%3Cpath d='m9 11 3 3L22 4'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

/* --- Overall Match Badge (inline with header) --- */
.ho-overall-match-badge {
    display: flex;
    align-items: center;
    background: #003366;
    border-radius: 12px;
    padding: 8px 16px;
    gap: 12px;
    flex-shrink: 0;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

.ho-badge-text {
    text-align: right;
    padding: 0;
}

.ho-badge-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: -0.05em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
    margin: 0;
}

.ho-badge-score {
    display: block;
    font-size: 24px;
    font-weight: 900;
    font-family: 'Montserrat', sans-serif;
    color: #ffffff;
    line-height: 1;
    margin: 0;
}

.ho-badge-shield {
    flex-shrink: 0;
}

/* --- CTA Buttons --- */
.ho-card-buttons-col {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 12px;
}

.ho-card-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ho-btn-claim .wp-block-button__link {
    background-color: #00A859 !important;
    color: #ffffff !important;
    font-size: 16px !important;
    font-weight: 700;
    border-radius: 12px !important;
    padding: 16px 24px !important;
    transition: all 0.4s ease;
    box-shadow: 0 10px 15px -3px rgba(0, 168, 89, 0.2), 0 4px 6px -4px rgba(0, 168, 89, 0.1);
    border: none !important;
}

.ho-btn-claim .wp-block-button__link:hover {
    background-color: #008a47 !important;
    box-shadow: 0 6px 20px rgba(0, 168, 89, 0.45);
    transform: translateY(-1px);
}

.ho-btn-review .wp-block-button__link {
    background-color: rgba(255, 251, 235, 0.3) !important;
    color: #D97706 !important;
    font-size: 14px !important;
    font-weight: 700;
    border-radius: 12px !important;
    padding: 12px 24px !important;
    border: 1px solid #fef3c7 !important;
    transition: all 0.4s ease;
}

.ho-btn-review .wp-block-button__link:hover {
    background-color: #fffbeb !important;
}

/* ==========================================================================
   Responsive: Tablet & Mobile
   ========================================================================== */

@media (max-width: 781px) {

    .ho-provider-cards-list {
        gap: 16px;
    }

    .ho-card-layout {
        flex-direction: column;
        gap: 20px;
    }

    .ho-card-col-logo {
        flex-direction: row;
        width: auto;
        border-right: none;
        padding-right: 0;
        border-bottom: 2px solid #f1f5f9;
        padding-bottom: 16px;
        justify-content: flex-start;
        align-items: center;
        gap: 16px;
    }

    .ho-card-logo img,
    .ho-card-logo-img {
        width: 64px;
        height: 64px;
        margin-bottom: 0;
    }

    .ho-card-starting-at {
        font-size: 9px;
        letter-spacing: 1.5px;
    }

    .ho-card-price {
        font-size: 20px;
    }

    .ho-card-price-block {
        text-align: left;
    }

    /* Keep header-row horizontal on tablet so badge stays inline */
    .ho-card-header-row {
        flex-wrap: wrap;
        gap: 12px;
    }

    .ho-card-provider-name {
        font-size: 20px !important;
    }

    .ho-match-scores {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        padding: 12px;
    }

    .ho-card-bottom-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .ho-card-buttons-col {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
    }

    .ho-card-buttons-col .ho-btn-primary,
    .ho-card-buttons-col .ho-btn-secondary {
        flex: 1;
        min-width: 0;
        text-align: center;
        font-size: 14px;
        padding: 12px 16px;
    }

    /* Overall badge more compact on tablet */
    .ho-overall-match-badge {
        padding: 6px 12px;
        gap: 8px;
    }

    .ho-badge-score {
        font-size: 20px;
    }
}

@media (max-width: 480px) {

    .ho-provider-card {
        padding: 16px;
        border-radius: 12px;
    }

    .ho-card-layout {
        gap: 16px;
    }

    .ho-card-col-logo {
        padding-bottom: 12px;
        gap: 12px;
    }

    .ho-card-logo img,
    .ho-card-logo-img {
        width: 56px;
        height: 56px;
    }

    .ho-card-header-row {
        flex-direction: column;
        gap: 8px;
    }

    .ho-card-provider-name {
        font-size: 18px !important;
    }

    .ho-card-tagline {
        font-size: 13px;
    }

    /* Single-column scores on mobile for clean stacking */
    .ho-match-scores {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 10px;
        margin-bottom: 16px;
    }

    .ho-score-label {
        font-size: 9px;
    }

    .ho-score-value {
        font-size: 9px;
    }

    .ho-card-price {
        font-size: 18px !important;
    }

    .ho-card-bottom-row {
        gap: 12px;
    }

    /* Stack buttons vertically on small mobile */
    .ho-card-buttons-col {
        flex-direction: column;
    }

    .ho-card-buttons-col .ho-btn-primary,
    .ho-card-buttons-col .ho-btn-secondary {
        flex: none;
        width: 100%;
        font-size: 14px;
        padding: 14px 16px;
    }

    .ho-card-advantages li {
        font-size: 13px;
        padding: 3px 0 3px 22px;
    }

    .ho-card-advantages li::before {
        width: 14px;
        height: 14px;
    }
}
