/* =========================================================
   Comparison Table Block
   Modern dark "glass" tiers — TrueInsight Silicon look.
   Mirrors info-cards visual language: subtle grid, floating
   globs, sweep sheen, indigo accents.
   ========================================================= */

.cmp-table {
    position: relative;
    padding: 5rem 0;
    overflow: hidden;
    isolation: isolate;
}

.cmp-table__container {
    position: relative;
    z-index: 1;
}

/* ── Atmospheric layers ── */

.cmp-table__grid-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
    background-size: 52px 52px;
    pointer-events: none;
    z-index: 0;
    mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
}

.cmp-table__glob {
    position: absolute;
    border-radius: 50%;
    filter: blur(110px);
    opacity: 0.18;
    pointer-events: none;
    z-index: 0;
    will-change: transform;
}

.cmp-table__glob--1 {
    width: 460px;
    height: 460px;
    background: rgba(99, 102, 241, 0.55);
    top: -12%;
    left: -8%;
    animation: cmpGlob1 20s ease-in-out infinite alternate;
}

.cmp-table__glob--2 {
    width: 360px;
    height: 360px;
    background: rgba(76, 130, 247, 0.45);
    bottom: -10%;
    right: -6%;
    animation: cmpGlob2 24s ease-in-out infinite alternate;
}

@keyframes cmpGlob1 {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 40px) scale(1.08); }
}
@keyframes cmpGlob2 {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-45px, -30px) scale(1.12); }
}

/* ── Header ── */

.cmp-table__header {
    margin-bottom: 3rem;
}

.cmp-table__title {
    margin: 0 0 1rem;
    letter-spacing: -0.015em;
}

.cmp-table__sub-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.cmp-table__desc {
    font-size: 1.05rem;
    line-height: 1.65;
    opacity: 0.6;
    margin: 0;
    max-width: 720px;
    flex: 1;
}

.cmp-table__cta {
    flex-shrink: 0;
}

/* ── Grid ── */

.cmp-table__grid {
    --cmp-cols: 3;
    position: relative;
    display: grid;
    grid-template-columns: repeat(var(--cmp-cols), minmax(0, 1fr));
    gap: 1.5rem;
    align-items: stretch;
}

/* ── Tier card ── */

.cmp-table__col {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 2rem 1.75rem 1.75rem;
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(28, 36, 60, 0.55) 0%, rgba(14, 18, 32, 0.92) 100%);
    border: 1px solid rgba(99, 102, 241, 0.14);
    backdrop-filter: blur(8px);
    overflow: hidden;
    transition:
        transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
        border-color 0.4s ease,
        box-shadow 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    animation: cmpColReveal 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Sheen sweep across the card (matches info-cards) */
.cmp-table__col::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        120deg,
        transparent 38%,
        rgba(99, 102, 241, 0.08) 50%,
        transparent 62%
    );
    transform: translateX(-100%);
    animation: cmpColSweep 9s ease-in-out var(--sweep-delay, 0s) infinite;
    pointer-events: none;
    z-index: 0;
    will-change: transform;
}

/* Indigo top edge accent */
.cmp-table__col::after {
    content: "";
    position: absolute;
    top: 0;
    left: 12%;
    right: 12%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.55), transparent);
    pointer-events: none;
    z-index: 1;
    opacity: 0.6;
    transition: opacity 0.35s ease;
}

.cmp-table__col > * {
    position: relative;
    z-index: 1;
}

.cmp-table__col:hover {
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.28);
    box-shadow:
        0 18px 48px -18px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(99, 102, 241, 0.08) inset,
        0 0 32px rgba(99, 102, 241, 0.12);
}
.cmp-table__col:hover::after { opacity: 1; }
.cmp-table__col:hover::before { animation-duration: 4s; }

/* ── Highlighted ("recommended") tier ── */

.cmp-table__col.is-highlighted {
    border-color: rgba(99, 102, 241, 0.45);
    background:
        radial-gradient(circle at top, rgba(99, 102, 241, 0.18), transparent 65%),
        linear-gradient(180deg, rgba(34, 38, 72, 0.65) 0%, rgba(14, 18, 32, 0.95) 100%);
    box-shadow:
        0 22px 60px -22px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(99, 102, 241, 0.18) inset,
        0 0 48px rgba(99, 102, 241, 0.18);
}

.cmp-table__col.is-highlighted::after {
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.95), transparent);
    opacity: 1;
    height: 2px;
}

.cmp-table__col.is-highlighted:hover {
    transform: translateY(-6px);
}

/* ── Highlight badge ── */

.cmp-table__badge {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff;
    background: linear-gradient(135deg, #6366f1, #4c82f7);
    box-shadow: 0 6px 18px -6px rgba(99, 102, 241, 0.7);
}

/* ── Column header (title + tag) ── */

.cmp-table__col-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem 0.7rem;
    margin: 0 0 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cmp-table__col-title {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: #fff;
}

.cmp-table__col-tag {
    display: inline-flex;
    align-items: center;
    line-height: 1;
    padding: 5px 9px 6px;
    border-radius: 6px;
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: rgba(186, 192, 255, 0.92);
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.22);
    /* Nudge so the chip optically centers on the title's cap height,
       not its line-box center. */
    transform: translateY(1px);
}

/* ── Best-for tagline ── */

.cmp-table__best-for {
    margin: 0 0 1rem;
    font-size: 0.95rem;
    line-height: 1.55;
    color: rgba(226, 230, 239, 0.78);
}

.cmp-table__best-for-label {
    display: inline-block;
    margin-right: 6px;
    font-weight: 700;
    color: #fff;
}

.cmp-table__best-for-text {
    color: rgba(226, 230, 239, 0.78);
}

/* ── Preface ("Everything in Standard +") ── */

.cmp-table__preface {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 1rem;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: rgba(186, 192, 255, 0.95);
    background: rgba(99, 102, 241, 0.08);
    border: 1px dashed rgba(99, 102, 241, 0.28);
}

.cmp-table__preface::before {
    content: "+";
    font-weight: 800;
    color: rgba(160, 165, 255, 1);
}

/* ── Feature list ── */

.cmp-table__features {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.cmp-table__feature {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.92rem;
    line-height: 1.55;
    color: rgba(226, 230, 239, 0.85);
}

.cmp-table__check {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    color: #6366f1;
    filter: drop-shadow(0 0 6px rgba(99, 102, 241, 0.35));
}

.cmp-table__col.is-highlighted .cmp-table__check {
    color: #818cf8;
    filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.55));
}

/* ── Per-column CTA ── */

.cmp-table__col-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 1.5rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-decoration: none;
    color: rgba(186, 192, 255, 0.95);
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.28);
    transition:
        transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
        background 0.3s ease,
        border-color 0.3s ease,
        color 0.3s ease,
        box-shadow 0.3s ease;
}

.cmp-table__col-btn:hover {
    background: rgba(99, 102, 241, 0.16);
    border-color: rgba(99, 102, 241, 0.5);
    color: #fff;
    box-shadow: 0 0 24px rgba(99, 102, 241, 0.2);
}

.cmp-table__col-btn--solid {
    color: #fff;
    background: linear-gradient(135deg, #6366f1, #4c82f7);
    border-color: transparent;
    box-shadow: 0 8px 22px -8px rgba(99, 102, 241, 0.7);
}

.cmp-table__col-btn--solid:hover {
    color: #fff;
    background: linear-gradient(135deg, #7173f3, #5d8efb);
    box-shadow: 0 12px 30px -10px rgba(99, 102, 241, 0.85);
}

.cmp-table__col-btn-arrow {
    font-size: 1.05em;
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.cmp-table__col-btn:hover .cmp-table__col-btn-arrow {
    transform: translateX(3px);
}

/* ── Animations ── */

@keyframes cmpColSweep {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes cmpColReveal {
    from {
        opacity: 0;
        transform: translateY(28px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Light theme overrides ── */

[data-bs-theme="light"] .cmp-table__col {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(245, 247, 255, 0.96) 100%);
    border-color: rgba(99, 102, 241, 0.18);
}

[data-bs-theme="light"] .cmp-table__col-title {
    color: #14172d;
}

[data-bs-theme="light"] .cmp-table__best-for-label {
    color: #14172d;
}

[data-bs-theme="light"] .cmp-table__best-for,
[data-bs-theme="light"] .cmp-table__feature {
    color: rgba(40, 44, 70, 0.82);
}

[data-bs-theme="light"] .cmp-table__col-head {
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

[data-bs-theme="light"] .cmp-table__col-tag {
    background: rgba(99, 102, 241, 0.08);
    color: #5052cf;
    border-color: rgba(99, 102, 241, 0.22);
}

[data-bs-theme="light"] .cmp-table__preface {
    background: rgba(99, 102, 241, 0.06);
    color: #4c4eb9;
    border-color: rgba(99, 102, 241, 0.28);
}

[data-bs-theme="light"] .cmp-table__col.is-highlighted {
    background:
        radial-gradient(circle at top, rgba(99, 102, 241, 0.1), transparent 70%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(243, 244, 255, 0.98) 100%);
    border-color: rgba(99, 102, 241, 0.45);
    box-shadow:
        0 22px 60px -22px rgba(99, 102, 241, 0.35),
        0 0 0 1px rgba(99, 102, 241, 0.15) inset;
}

[data-bs-theme="light"] .cmp-table__grid-bg {
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.02) 1px, transparent 1px);
}

/* ── Responsive ── */

@media (max-width: 1023px) {
    .cmp-table__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.25rem;
    }
}

@media (max-width: 720px) {
    .cmp-table {
        padding: 3rem 0;
    }

    .cmp-table__grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .cmp-table__sub-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .cmp-table__col {
        padding: 1.5rem 1.25rem 1.25rem;
    }

    .cmp-table__header {
        margin-bottom: 2rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cmp-table__col,
    .cmp-table__col::before,
    .cmp-table__glob {
        animation: none;
    }
    .cmp-table__col:hover { transform: none; }
}
