/* HostPHP Compare — frontend styles (v2) */

.hpc-wrap {
    --hpc-accent: #2563eb;
    --hpc-accent-soft: rgba(37, 99, 235, 0.09);
    --hpc-border: #e5e7eb;
    --hpc-text: #111827;
    --hpc-muted: #6b7280;
    color: var(--hpc-text);
    max-width: 1200px;
    margin: 0 auto;
    padding: 8px 0 40px;
}
.hpc-wrap *, .hpc-toast * { box-sizing: border-box; }
.hpc-wrap :focus-visible, .hpc-toast:focus-visible {
    outline: 2px solid var(--hpc-accent);
    outline-offset: 2px;
}

.hpc-title { font-size: 30px; margin: 0 0 6px; }
.hpc-subtitle { color: var(--hpc-muted); margin: 0 0 24px; font-size: 15px; }
.hpc-section-title { font-size: 20px; margin: 40px 0 14px; }

/* ---------- picker ---------- */
.hpc-picker {
    background: #fff;
    border: 1px solid var(--hpc-border);
    display: flex;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 28px;
    box-shadow: 0 4px 16px rgba(17, 24, 39, .05);
    flex-direction: row;
    gap: 12px;
    align-items: center;
}
.hpc-picker-slots {
    display: flex;
    gap: 12px;
    flex-direction: row;
    align-items: center;
    width: 100%;
    flex: 1 1 auto;
    min-width: 0;
}
.hpc-slot {
    position: relative;
    display: grid;
    width: stretch;
    flex: 1 1 0;
    min-width: 0;
}
.hpc-slot > .hpc-slot-chip,
.hpc-slot > .hpc-slot-search {
    grid-area: 1 / 1;
    transition: opacity .22s ease, transform .22s ease, visibility .22s;
}
.hpc-slot-search { position: relative; }
.hpc-slot-search > svg {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    width: 16px; height: 16px; color: #9ca3af; pointer-events: none;
}
.hpc-slot-input {
    width: 100%;
    padding: 12px 14px 12px 38px;
    font-size: 15px;
    line-height: 1;
    border: 1.5px solid var(--hpc-border);
    border-radius: 12px;
    outline: none;
    background: #fff;
    color: var(--hpc-text);
    transition: border-color .15s, box-shadow .15s;
}
.hpc-slot-input:focus {
    border-color: var(--hpc-accent);
    box-shadow: 0 0 0 3px var(--hpc-accent-soft);
}
.hpc-slot-chip {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border: 1.5px solid var(--hpc-accent);
    background: var(--hpc-accent-soft); border-radius: 10px;
    opacity: 0;
    transform: scale(.97);
    visibility: hidden;
    pointer-events: none;
}
.hpc-slot.is-filled .hpc-slot-chip {
    opacity: 1;
    transform: none;
    visibility: visible;
    pointer-events: auto;
}
.hpc-slot.is-filled .hpc-slot-search {
    opacity: 0;
    transform: scale(.97);
    visibility: hidden;
    pointer-events: none;
}
.hpc-chip-logo { display: flex; }
.hpc-chip-logo img, .hpc-chip-logo .hpc-avatar {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    object-fit: contain;
    background: #fff;
}
.hpc-chip-name { font-weight: 600; flex: 1; font-size: 15px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hpc-chip-remove {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 0;
    flex: none;
    background: #fff;
    color: var(--hpc-muted);
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color .15s, background .15s, transform .15s;
}
.hpc-chip-remove:hover {
    color: #dc2626;
    background: #fee2e2;
    transform: scale(1.1);
}

.hpc-picker-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-direction: row;
}
.hpc-add-slot {
    padding: 10px 16px; border-radius: 10px; border: 1.5px dashed var(--hpc-border);
    background: none; color: var(--hpc-muted); font-weight: 600; cursor: pointer; font-size: 14px;
    transition: border-color .15s, color .15s;
}
.hpc-add-slot:hover { border-color: var(--hpc-accent); color: var(--hpc-accent); }
.hpc-add-slot[hidden] { display: none; }
.hpc-compare-btn {
    margin-left: auto;
    padding: 12px 30px;
    border-radius: 10px;
    background: var(--hpc-accent);
    color: #fff !important;
    font-weight: 700;
    text-decoration: none;
    font-size: 15px;
    transition: filter .15s;
    line-height: 1;
}
.hpc-compare-btn:hover { filter: brightness(1.1); }
.hpc-compare-btn.is-disabled { background: #9ca3af; }

/* ---------- autocomplete ---------- */
.hpc-autocomplete {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
    background: #fff; border: 1px solid var(--hpc-border); border-radius: 12px;
    box-shadow: 0 12px 32px rgba(17, 24, 39, .14); overflow: hidden;
}
.hpc-autocomplete[hidden] { display: none; }
.hpc-auto-item {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 9px 12px; border: 0; background: none; cursor: pointer;
    text-align: left; font-size: 14px; color: var(--hpc-text);
}
.hpc-auto-item:hover, .hpc-auto-item.is-active { background: var(--hpc-accent-soft); }
.hpc-auto-item.is-selected .hpc-auto-name::after { content: ' ✓'; color: var(--hpc-accent); font-weight: 700; }
.hpc-auto-item img, .hpc-auto-item .hpc-avatar {
    width: 32px; height: 32px; border-radius: 8px; object-fit: contain;
    background: #f3f4f6; flex: none;
}
.hpc-auto-name { font-weight: 600; }
.hpc-auto-meta { margin-left: auto; color: var(--hpc-muted); font-size: 13px; white-space: nowrap; }
.hpc-auto-empty { padding: 12px 14px; color: var(--hpc-muted); font-size: 14px; }

/* ---------- avatar & stars ---------- */
.hpc-avatar {
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; color: #fff; background: var(--hpc-accent);
}
.hpc-stars { white-space: nowrap; font-size: 13px; }
.hpc-stars-on { color: #f59e0b; letter-spacing: 1px; }
.hpc-stars-off { color: #d1d5db; letter-spacing: 1px; }
.hpc-stars-num { color: var(--hpc-muted); margin-left: 5px; font-size: 12px; }

/* ---------- provider grid ---------- */
.hpc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
}
.hpc-card {
    border: 1px solid var(--hpc-border); border-radius: 14px; padding: 18px;
    background: #fff; display: flex; flex-direction: column; gap: 8px;
    transition: box-shadow .15s, border-color .15s, transform .15s;
    animation: hpc-card-in .22s ease backwards;
}
@keyframes hpc-card-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}
.hpc-card:hover { box-shadow: 0 8px 24px rgba(17, 24, 39, .08); transform: translateY(-2px); }
.hpc-card.is-selected {
    border-color: var(--hpc-accent);
    box-shadow: 0 0 0 3px var(--hpc-accent-soft);
}
.hpc-card-logo { height: 42px; display: flex; align-items: center; }
.hpc-card-logo img { max-height: 42px; max-width: 150px; object-fit: contain; }
.hpc-card-avatar { width: 42px; height: 42px; border-radius: 10px; font-size: 18px; }
.hpc-card-name { font-size: 16px; margin: 0; }
.hpc-card-excerpt { font-size: 13px; color: var(--hpc-muted); margin: 0; flex: 1; }
.hpc-card-price { font-size: 18px; font-weight: 700; color: var(--hpc-accent); }
.hpc-add-btn {
    margin-top: 4px;
    padding: 9px 12px;
    border-radius: 9px;
    border: 1.5px solid var(--hpc-accent);
    background: #fff;
    color: var(--hpc-accent);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background .15s, color .15s;
    text-align: center;
}
.hpc-add-btn:hover { background: var(--hpc-accent-soft); }
.hpc-card.is-selected .hpc-add-btn { background: var(--hpc-accent); color: #fff; }

/* ---------- load more ---------- */
.hpc-loadmore-wrap { text-align: center; margin-top: 24px; }
.hpc-load-more {
    padding: 10px 24px; border-radius: 999px; border: 1.5px solid var(--hpc-border);
    background: #fff; cursor: pointer; font-weight: 600; color: #374151;
    transition: border-color .15s, color .15s;
}
.hpc-load-more:hover { border-color: var(--hpc-accent); color: var(--hpc-accent); }
.hpc-load-more[hidden] { display: none; }
.hpc-load-more:disabled { opacity: .55; cursor: default; }
.hpc-load-more:disabled:hover { border-color: var(--hpc-border); color: #374151; }

/* ---------- comparison table ---------- */
.hpc-table-zone { margin-top: 8px; }
.hpc-table-zone[hidden] { display: none; }
.hpc-table-wrap {
    overflow: auto; max-height: 75vh;
    border: 1px solid var(--hpc-border); border-radius: 14px; background: #fff;
}
.hpc-table {
    border-collapse: separate; border-spacing: 0;
    width: 100%; min-width: 680px; font-size: 14px;
    table-layout: fixed; /* provider columns share equal width */
}
.hpc-table th, .hpc-table td {
    padding: 12px 16px; text-align: left;
    border-bottom: 1px solid #f3f4f6;
    overflow-wrap: break-word;
}
.hpc-table thead th {
    position: sticky; top: 0; z-index: 5;
    background: #fff; border-bottom: 2px solid var(--hpc-border);
    vertical-align: top; min-width: 210px;
}
.hpc-table thead th.hpc-corner { width: 180px; min-width: 160px; left: 0; z-index: 6; }
.hpc-table tbody th {
    position: sticky; left: 0; z-index: 4;
    background: #fff; font-weight: 600; color: #374151;
    border-right: 1px solid #f3f4f6;
}
.hpc-table tbody tr:nth-child(even) th,
.hpc-table tbody tr:nth-child(even) td { background: #fafafa; }
.hpc-table tbody tr.hpc-group th {
    position: static;
    background: #eef2ff; color: var(--hpc-accent);
    text-transform: uppercase; font-size: 12px; letter-spacing: .06em;
}
.hpc-table td { color: var(--hpc-text); }

/* host column header */
.hpc-host-head { text-align: center !important; }
.hpc-head-logo {
    display: block; height: 44px; margin: 0 auto 8px;
    object-fit: contain; max-width: 130px;
}
.hpc-head-logo.hpc-avatar { border-radius: 10px; font-size: 18px; }
.hpc-head-name { display: block; font-size: 15px; font-weight: 700; }
.hpc-head-price { display: block; margin-top: 4px; font-weight: 700; color: var(--hpc-accent); }
.hpc-visit {
    display: inline-block; margin-top: 10px; padding: 8px 16px;
    background: var(--hpc-accent); color: #fff !important;
    border-radius: 9px; font-weight: 600; font-size: 13px; text-decoration: none;
}
.hpc-visit:hover { filter: brightness(1.1); }
.hpc-remove {
    position: absolute; top: 8px; right: 8px;
    width: 26px; height: 26px; border-radius: 50%;
    border: 1px solid var(--hpc-border); background: #fff; color: var(--hpc-muted);
    font-size: 15px; line-height: 1; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: color .15s, border-color .15s, background .15s, transform .15s;
}
.hpc-remove:hover {
    color: #dc2626; border-color: #dc2626; background: #fee2e2;
    transform: scale(1.1);
}

/* ---------- browse all providers ---------- */
.hpc-browse-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; flex-wrap: wrap; margin: 40px 0 14px;
}
.hpc-browse-head .hpc-section-title { margin: 0; }
.hpc-browse-search { position: relative; width: 300px; max-width: 100%; }
.hpc-browse-search svg {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    width: 16px; height: 16px; color: #9ca3af; pointer-events: none;
}
.hpc-browse-spinner {
    position: absolute;
    right: 12px;
    top: 50%;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    border: 2px solid var(--hpc-border);
    border-top-color: var(--hpc-accent);
    border-radius: 50%;
    display: none;
    pointer-events: none;
    animation: hpc-spin .7s linear infinite;
}
.hpc-browse-search.is-loading .hpc-browse-spinner { display: block; }
.hpc-browse-search.is-loading input { padding-right: 38px; }
.hpc-browse-search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
@keyframes hpc-spin { to { transform: rotate(360deg); } }
.hpc-browse-search input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    font-size: 14px;
    line-height: 1;
    border: 1.5px solid var(--hpc-border);
    border-radius: 12px;
    outline: none;
    background: #fff;
    color: var(--hpc-text);
    transition: border-color .15s, box-shadow .15s;
}
.hpc-browse-search input:focus {
    border-color: var(--hpc-accent);
    box-shadow: 0 0 0 3px var(--hpc-accent-soft);
}
.hpc-browse-empty {
    text-align: center; color: var(--hpc-muted); padding: 32px 16px;
    border: 1.5px dashed var(--hpc-border); border-radius: 14px;
    font-size: 14px; margin-top: 8px;
}
.hpc-browse-empty[hidden] { display: none; }

/* ---------- most compared (trending) ---------- */
.hpc-trending {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    margin-bottom: 8px;
}
.hpc-trend {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 7px;
    border: 1px solid var(--hpc-border);
    border-radius: 12px;
    background: #fff;
    text-decoration: none;
    color: var(--hpc-text);
    font-weight: 600;
    font-size: 14px;
    transition: border-color .15s, box-shadow .15s, transform .15s;
    animation: hpc-card-in .22s ease backwards;
}
.hpc-trend:hover {
    border-color: var(--hpc-accent);
    box-shadow: 0 6px 18px rgba(17, 24, 39, .08);
    transform: translateY(-2px);
    color: var(--hpc-text);
}
.hpc-trend-logos { display: flex; flex: none; }
.hpc-trend-logos img, .hpc-trend-logos .hpc-avatar {
    width: 46px;
    height: 46px;
    border-radius: 9px;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--hpc-border);
}
.hpc-trend-logos > * + * { margin-left: -10px; }
.hpc-trend-names { flex: 1; }

/* ---------- related comparisons shortcode (review pages) ---------- */
.hpc-related { margin: 28px 0; }
/* bigger chips on review pages only — the /compare page keeps the compact style */
.hpc-related .hpc-trend { padding: 14px 18px; gap: 14px; border-radius: 14px; font-size: 15px; }
.hpc-related .hpc-trend-logos img, .hpc-related .hpc-trend-logos .hpc-avatar { width: 56px; height: 56px; border-radius: 10px; }

/* ---------- toast ---------- */
.hpc-toast {
    position: fixed; left: 50%; bottom: 24px; z-index: 101;
    transform: translateX(-50%) translateY(8px);
    background: #111827; color: #fff; padding: 10px 18px;
    border-radius: 999px; font-size: 14px;
    opacity: 0; pointer-events: none;
    transition: opacity .2s, transform .2s;
}
.hpc-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- mobile: stack the picker vertically ---------- */
@media (max-width: 720px) {
    .hpc-coupon-grid { grid-template-columns: 1fr; }
    .hpc-picker { flex-direction: column; align-items: stretch; }
    .hpc-picker-slots { flex-direction: column; align-items: stretch; }
    .hpc-slot { flex: none; width: 100%; }
    .hpc-picker-actions { margin-top: 4px; }
    .hpc-compare-btn { margin-left: 0; flex: 1 1 auto; text-align: center; }
}

@media (max-width: 640px) {
    .hpc-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
    .hpc-title { font-size: 24px; }
    .hpc-compare-btn { margin-left: 0; width: 100%; text-align: center; }
}

/* ---------- read review link (table header) ---------- */
.hpc-review-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--hpc-accent);
    text-decoration: underline;
}
.hpc-review-link:hover { color: var(--hpc-text); }

/* ---------- coupons & deals (vs pages) ---------- */
.hpc-coupons { margin-top: 32px; }
.hpc-coupon-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.hpc-coupon-card {
    border: 1px solid var(--hpc-border); border-radius: 14px; background: #fff;
    padding: 16px; display: flex; flex-direction: column; gap: 12px;
}
.hpc-coupon-head { display: flex; align-items: center; gap: 10px; }
.hpc-coupon-head img, .hpc-coupon-head .hpc-avatar {
    width: 36px; height: 36px; border-radius: 9px; object-fit: contain;
    background: #fff; border: 1px solid var(--hpc-border); flex: none;
}
.hpc-coupon-provider { font-weight: 700; font-size: 15px; color: var(--hpc-text); text-decoration: none; }
.hpc-coupon-provider:hover { color: var(--hpc-accent); }
.hpc-coupon-row {
    border: 2px dashed var(--hpc-border);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #f9f5f3;
    border-radius: 12px;
}
.hpc-coupon-discount { font-size: 18px; font-weight: 800; color: var(--hpc-accent); }
.hpc-coupon-desc { margin: 0; font-size: 13px; color: var(--hpc-muted); }
.hpc-coupon-types { display: flex; flex-wrap: wrap; gap: 6px; }
.hpc-coupon-type {
    font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px;
    background: var(--hpc-accent-soft); color: var(--hpc-accent);
}
.hpc-coupon-hosting, .hpc-coupon-expiry { font-size: 12px; color: var(--hpc-muted); }
.hpc-coupon-actions { display: flex; align-items: center; gap: 10px; margin-top: 4px; flex-wrap: wrap; }
.hpc-coupon-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-weight: 700; font-size: 13px; letter-spacing: .5px;
    border: 1.5px dashed var(--hpc-accent); border-radius: 8px;
    padding: 7px 12px; background: #fff; color: var(--hpc-text);
}
.hpc-coupon-btn {
    padding: 9px 18px; border-radius: 9px; background: var(--hpc-accent);
    color: #fff !important; font-weight: 700; font-size: 13px; text-decoration: none;
    transition: filter .15s;
}
.hpc-coupon-btn:hover { filter: brightness(1.1); }
.hpc-coupon-all {
    display: block; text-align: center; margin-top: 4px;
    padding: 10px 16px; border-radius: 9px;
    border: 1.5px solid var(--hpc-accent); background: #fff; color: var(--hpc-accent);
    font-weight: 600; font-size: 13px; text-decoration: none;
    transition: background .15s, color .15s;
}
.hpc-coupon-all:hover { background: var(--hpc-accent-soft); }

@media (prefers-reduced-motion: reduce) {
    .hpc-wrap *, .hpc-toast { animation: none !important; transition: none !important; }
}
