/**
 * Comparison Engine Styles
 *
 * Side-by-side hosting provider comparison page.
 * Matches the prototype design with navy headers, green accents,
 * CSS Grid table layout, and responsive horizontal scroll.
 *
 * @package HostOffers
 * @since   1.2.0
 */

/* ==========================================================================
   CSS Custom Properties
   ========================================================================== */

:root {
    --ho-compare-navy: #003366;
    --ho-compare-green: #00A859;
    --ho-compare-green-light: #00C96B;
    --ho-compare-bg: #F8FAFC;
    --ho-compare-card-bg: #FFFFFF;
    --ho-compare-border: #E2E8F0;
    --ho-compare-gray: #64748B;
    --ho-compare-gray-light: #94A3B8;
    --ho-compare-radius: 12px;
    --ho-compare-radius-2xl: 16px;
    --ho-compare-radius-3xl: 24px;
}

/* ==========================================================================
   Page Layout
   ========================================================================== */

.ho-compare-page {
    background: var(--ho-compare-bg);
    min-height: 100vh;
}

.ho-compare-page *,
.ho-compare-page *::before,
.ho-compare-page *::after {
    box-sizing: border-box;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.ho-compare-hero {
    background: var(--ho-compare-bg);
    color: var(--ho-compare-navy);
    text-align: center;
    padding: 48px 16px 0;
}

.ho-compare-hero__inner {
    max-width: 1280px;
    margin: 0 auto 64px;
}

.ho-compare-hero__label {
    display: inline-block;
    background: rgba(0, 51, 102, 0.1);
    color: var(--ho-compare-navy);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    padding: 4px 12px;
    border-radius: 9999px;
    margin-bottom: 16px;
    text-transform: uppercase;
}

.ho-compare-hero__heading {
    font-size: 48px;
    font-weight: 800;
    margin: 0 0 24px;
    line-height: 1.2;
    color: var(--ho-compare-navy);
    font-family: 'Montserrat', sans-serif;
}

.ho-compare-hero__subtitle {
    font-size: 16px;
    color: var(--ho-compare-gray);
    margin: 0 auto;
    line-height: 1.6;
    max-width: 672px;
}

/* ==========================================================================
   Provider Selector
   ========================================================================== */

.ho-compare-selector {
    background: #fff;
    border-bottom: 1px solid var(--ho-compare-border);
    padding: 24px 20px;
}

.ho-compare-selector__inner {
    max-width: 1280px;
    margin: 0 auto;
}

.ho-compare-selector__top {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    align-items: stretch;
}

.ho-compare-selector__bottom {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* Search bar */
.ho-compare-search {
    flex: 1;
    position: relative;
    min-width: 200px;
}

.ho-compare-search__icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ho-compare-gray-light);
    pointer-events: none;
    width: 16px;
    height: 16px;
    z-index: 1;
}

.ho-compare-search__input {
    width: 100%;
    border: 1px solid var(--ho-compare-border) !important;
    border-radius: 16px !important;
    padding: 12px 16px 12px 48px !important;
    font-size: 15px !important;
    color: var(--ho-compare-navy);
    background: #fff !important;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.ho-compare-search__input::placeholder {
    color: var(--ho-compare-gray-light);
}

.ho-compare-search__input:focus {
    border-color: var(--ho-compare-green);
}

/* Filter dropdown */
.ho-compare-filter {
    flex-shrink: 0;
}

.ho-compare-filter__select {
    border: 1px solid var(--ho-compare-border);
    border-radius: 10px;
    padding: 9px 36px 9px 36px;
    font-size: 14px;
    font-weight: 500;
    color: var(--ho-compare-navy);
    background: #fff;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23003366' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M22 3H2l8 9.46V19l4 2v-8.54L22 3z'/%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat, no-repeat;
    background-position: left 12px center, right 14px center;
    cursor: pointer;
    outline: none;
    min-width: 180px;
}

.ho-compare-filter__select:focus {
    border-color: var(--ho-compare-green);
}

/* Chips */
.ho-compare-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
}

.ho-compare-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--ho-compare-navy);
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.ho-compare-chip__remove {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    cursor: pointer;
    padding: 0 0 0 4px;
    line-height: 1;
    transition: color 0.2s;
}

.ho-compare-chip__remove:hover {
    color: #fff;
}

/* Slots counter */
.ho-compare-slots {
    font-size: 12px;
    font-weight: 600;
    color: var(--ho-compare-gray-light);
    letter-spacing: 1px;
    white-space: nowrap;
}

/* ==========================================================================
   Search Dropdown
   ========================================================================== */

.ho-compare-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--ho-compare-border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 100;
    max-height: 320px;
    overflow-y: auto;
}

.ho-compare-dropdown__header {
    font-size: 11px;
    font-weight: 700;
    color: var(--ho-compare-gray-light);
    letter-spacing: 1px;
    padding: 14px 16px 8px;
}

.ho-compare-dropdown__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
    gap: 12px;
}

.ho-compare-dropdown__item:hover {
    background: #F3F4F6;
}

.ho-compare-dropdown__item-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ho-compare-dropdown__item-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: contain;
    background: #F9FAFB;
    border: 1px solid var(--ho-compare-border);
}

.ho-compare-dropdown__item-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--ho-compare-navy);
}

.ho-compare-dropdown__item-price {
    display: block;
    font-size: 12px;
    color: var(--ho-compare-gray);
}

.ho-compare-dropdown__item-rating {
    font-size: 13px;
    font-weight: 600;
    color: var(--ho-compare-green);
    white-space: nowrap;
}

.ho-compare-dropdown__empty {
    padding: 20px 16px;
    text-align: center;
    color: var(--ho-compare-gray);
    font-size: 14px;
}

/* ==========================================================================
   Empty State
   ========================================================================== */

.ho-compare-empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--ho-compare-gray-light);
}

.ho-compare-empty h3 {
    color: var(--ho-compare-navy);
    font-size: 20px;
    margin: 20px 0 8px;
}

.ho-compare-empty p {
    color: var(--ho-compare-gray);
    font-size: 15px;
    margin: 0;
}

/* ==========================================================================
   Comparison Table (CSS Grid)
   ========================================================================== */

.ho-compare-table-wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ho-compare-grid {
    display: grid;
    gap: 6px;
    min-width: 500px;
}

/* ==========================================================================
   Grid Rows
   ========================================================================== */

.ho-compare-row {
    display: contents;
}

/* Label column */
.ho-compare-label-col {
    background: #EDF1F7;
    border-radius: 12px;
    padding: 18px 16px;
    display: flex;
    align-items: center;
    position: sticky;
    left: 0;
    z-index: 2;
    min-height: 56px;
}

.ho-compare-label-col--header {
    background: var(--ho-compare-navy);
    color: #fff;
    border-radius: 14px;
    padding: 28px 20px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1.5px;
    line-height: 1.5;
    min-height: 120px;
}

.ho-compare-label-col__text {
    font-size: 13px;
    font-weight: 600;
    color: var(--ho-compare-navy);
    line-height: 1.35;
}

/* Tooltips */
.ho-compare-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
    color: #94a3b8;
    cursor: help;
    vertical-align: middle;
}

.ho-compare-tooltip:hover,
.ho-compare-tooltip:focus {
    color: var(--ho-compare-navy);
}

.ho-compare-tooltip__text {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    background: #0f172a;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 12px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 20;
}

.ho-compare-tooltip__text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 12px;
    border: 5px solid transparent;
    border-top-color: #0f172a;
}

.ho-compare-tooltip:hover .ho-compare-tooltip__text,
.ho-compare-tooltip:focus .ho-compare-tooltip__text {
    opacity: 1;
}

/* Data cells */
.ho-compare-cell {
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #F0F2F5;
    min-height: 56px;
}

/* ==========================================================================
   Provider Header Cards
   ========================================================================== */

.ho-compare-header-card {
    background: var(--ho-compare-navy);
    border-radius: 14px;
    padding: 28px 16px;
    flex-direction: column;
    gap: 10px;
    position: relative;
    min-height: 120px;
    border: 2px solid var(--ho-compare-navy);
}

.ho-compare-header-card--best {
    border-color: var(--ho-compare-green);
}

.ho-compare-best-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--ho-compare-green);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 5px 16px;
    border-radius: 20px;
    white-space: nowrap;
    z-index: 1;
}

.ho-compare-header-card__logo {
    width: 80px;
    height: 40px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.ho-compare-header-card__name {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
}

/* ==========================================================================
   Data cell content types
   ========================================================================== */

.ho-compare-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--ho-compare-navy);
}

.ho-compare-rating {
    font-size: 15px;
    font-weight: 600;
    color: var(--ho-compare-green);
}

.ho-compare-rating__star {
    color: #F59E0B;
    margin-right: 2px;
}

.ho-compare-check {
    color: var(--ho-compare-green);
    font-size: 20px;
    font-weight: 700;
}

.ho-compare-cross {
    color: var(--ho-compare-gray-light);
    font-size: 22px;
    font-weight: 300;
}

/* ==========================================================================
   Score bars
   ========================================================================== */

.ho-compare-score {
    width: 100%;
    text-align: center;
}

.ho-compare-score__value {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--ho-compare-green);
    margin-bottom: 6px;
}

.ho-compare-score__bar {
    height: 6px;
    background: #E5E7EB;
    border-radius: 3px;
    overflow: hidden;
    max-width: 120px;
    margin: 0 auto;
}

.ho-compare-score__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--ho-compare-green), var(--ho-compare-green-light));
    border-radius: 3px;
    transition: width 0.6s ease;
}

/* ==========================================================================
   CTA Row
   ========================================================================== */

.ho-compare-cta-cell {
    flex-direction: column;
    gap: 10px;
    padding: 24px 16px;
    background: transparent;
    border: none;
}

.ho-compare-cta-btn {
    display: inline-block;
    width: 100%;
    max-width: 220px;
    padding: 14px 28px;
    background: var(--ho-compare-green);
    color: #fff;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 15px;
    text-align: center;
    transition: background 0.2s;
    box-sizing: border-box;
}

.ho-compare-cta-btn:hover {
    background: var(--ho-compare-green-light);
    color: #fff;
}

.ho-compare-cta-review {
    color: var(--ho-compare-navy);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: color 0.2s;
}

.ho-compare-cta-review:hover {
    color: var(--ho-compare-green);
}

/* CTA row label is empty/transparent */
.ho-compare-row--cta > .ho-compare-label-col {
    background: transparent;
}

/* ==========================================================================
   Related Comparisons
   ========================================================================== */

.ho-compare-related {
    padding: 0 16px 48px;
    border-top: none;
    margin-top: 80px;
}

.ho-compare-related__inner {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.ho-compare-related__card {
    background: #fff;
    border-radius: var(--ho-compare-radius-3xl);
    padding: 32px;
    border: 1px solid var(--ho-compare-border);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.ho-compare-related__card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.ho-compare-related__icon-wrap {
    width: 48px;
    height: 48px;
    background: #F8FAFC;
    border-radius: var(--ho-compare-radius-2xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    transition: background 0.2s;
}

.ho-compare-related__card:hover .ho-compare-related__icon-wrap {
    background: #F1F5F9;
}

.ho-compare-related__icon-wrap svg {
    width: 24px;
    height: 24px;
}

.ho-compare-related__icon {
    font-size: 24px;
    line-height: 1;
}

.ho-compare-related__title {
    font-size: 20px;
    font-weight: 800;
    color: var(--ho-compare-navy);
    margin: 0 0 8px;
    font-family: 'Montserrat', sans-serif;
}

.ho-compare-related__desc {
    font-size: 14px;
    color: var(--ho-compare-gray);
    margin: 0 0 24px;
    line-height: 1.5;
}

.ho-compare-related__link {
    color: var(--ho-compare-navy);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ho-compare-related__link:hover {
    color: var(--ho-compare-green);
}

.ho-compare-related__link svg {
    width: 16px;
    height: 16px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .ho-compare-hero {
        padding: 32px 16px 0;
    }

    .ho-compare-hero__inner {
        margin-bottom: 48px;
    }

    .ho-compare-hero__heading {
        font-size: 28px;
    }

    .ho-compare-selector__top {
        flex-direction: column;
    }

    .ho-compare-filter__select {
        width: 100%;
        min-width: auto;
    }

    .ho-compare-related__inner {
        grid-template-columns: 1fr;
    }

    .ho-compare-related {
        margin-top: 48px;
    }

    .ho-compare-table-wrap {
        padding: 20px 12px;
    }

    .ho-compare-label-col {
        position: sticky;
        left: 0;
        z-index: 2;
    }
}

@media (max-width: 480px) {
    .ho-compare-hero__heading {
        font-size: 24px;
    }

    .ho-compare-hero__subtitle {
        font-size: 14px;
    }

    .ho-compare-selector__bottom {
        flex-direction: column;
        align-items: flex-start;
    }
}
