/* integrations-marketplace.css — gallery + install drawer for /integration-hub.
   Self-contained: every design token is referenced as var(--sc-*, <fallback>) where the fallback
   is the current-portal (pre-facelift) value. When the site-wide facelift ships and defines the
   --sc-* / --brand tokens globally, this file picks up the new look with no changes here. */

/* ── Page header / toolbar ───────────────────────────────────────────────── */
.int-mp__intro {
    color: var(--sc-ink-soft, #616161);
    max-width: 760px;
    margin: 4px 0 18px;
    line-height: 1.5;
}

.int-mp__toolbar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.int-mp__count {
    color: var(--sc-ink-faint, #757575);
    font-size: 0.82rem;
    font-weight: 600;
}

.int-mp__pills {
    margin-bottom: 18px;
}

.int-mp__empty {
    padding: 48px;
    text-align: center;
    color: var(--sc-ink-faint, #757575);
}

/* ── Category filter pills ───────────────────────────────────────────────── */
.int-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.int-pill {
    border: var(--sc-border, 1px solid #e0e0e0);
    background: #fff;
    color: var(--sc-ink-soft, #616161);
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.14s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.int-pill:hover {
    border-color: var(--brand-600, var(--accent-fill-rest));
    color: var(--brand-600, var(--accent-fill-rest));
}

.int-pill--active {
    background: var(--brand-600, var(--accent-fill-rest));
    border-color: transparent;
    color: #fff;
}

/* ── Card grid ───────────────────────────────────────────────────────────── */
.integrations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--sc-gap, 16px);
}

.int-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #fff;
    border: var(--sc-border, 1px solid #e0e0e0);
    border-radius: var(--sc-radius, 4px);
    box-shadow: var(--sc-shadow, none);
    padding: 18px 18px 16px;
    cursor: pointer;
    transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.int-card:hover {
    box-shadow: var(--sc-shadow-hover, 0 2px 6px rgba(0, 0, 0, 0.15));
    transform: translateY(-2px);
}

.int-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.int-card__body {
    flex: 1;
}

.int-card__cat {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--sc-ink-faint, #757575);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.int-card__name {
    margin: 2px 0 0;
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--sc-ink, #212121);
}

.int-card__tagline {
    margin: 6px 0 0;
    font-size: 0.86rem;
    color: var(--sc-ink-soft, #616161);
    line-height: 1.45;
}

.int-card__foot {
    display: flex;
}

/* ── Logo tile (monogram fallback under an <img> that hides itself on error) ── */
.int-logo {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: var(--sc-radius, 4px);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f1f4f9;
    background: color-mix(in srgb, var(--int-brand, #3155A4) 14%, #fff);
}

.int-logo--lg {
    width: 56px;
    height: 56px;
}

.int-logo__mono {
    font-weight: 800;
    font-size: 18px;
    color: var(--int-brand, #3155A4);
}

.int-logo__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 9px;
    background: #fff;
    box-sizing: border-box;
}

/* ── Status pill ─────────────────────────────────────────────────────────── */
.int-status {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.int-status--available { color: var(--sc-info, #2f5597); background: var(--sc-info-bg, #e8eef8); }
.int-status--installed { color: var(--sc-pos, #117865);  background: var(--sc-pos-bg, #e6f4f0); }
.int-status--connected { color: var(--sc-pos, #117865);  background: var(--sc-pos-bg, #e6f4f0); }
.int-status--requested { color: var(--sc-warn, #9a6700); background: var(--sc-warn-bg, #fdf3e2); }
.int-status--beta      { color: var(--sc-warn, #9a6700); background: var(--sc-warn-bg, #fdf3e2); }
.int-status--soon      { color: var(--sc-ink-faint, #757575); background: var(--sc-neutral-bg, #eeeeee); }

/* ── Install / manage drawer ─────────────────────────────────────────────── */
.int-scrim {
    position: fixed;
    inset: 0;
    background: rgba(16, 24, 40, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1100;
}

.int-scrim--show {
    opacity: 1;
    pointer-events: auto;
}

.int-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 440px;
    max-width: 94vw;
    background: #fff;
    box-shadow: -8px 0 24px rgba(16, 24, 40, 0.18);
    transform: translateX(100%);
    transition: transform 0.24s ease;
    z-index: 1101;
    display: flex;
    flex-direction: column;
}

.int-drawer--open {
    transform: translateX(0);
}

.int-drawer__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: var(--sc-border, 1px solid #e0e0e0);
}

.int-drawer__titles {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.int-drawer__title {
    font-size: 17px;
    font-weight: 800;
    color: var(--sc-ink, #212121);
}

.int-drawer__sub {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--sc-ink-faint, #757575);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.int-drawer__body {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
}

.int-drawer__about {
    margin: 0 0 18px;
    color: var(--sc-ink-soft, #616161);
    line-height: 1.55;
    font-size: 0.9rem;
}

.int-modules__label {
    display: block;
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--sc-ink-faint, #757575);
    margin-bottom: 10px;
}

.int-modules {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.int-module {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 10px;
    border-radius: var(--sc-radius-sm, 4px);
}

.int-module:hover {
    background: #f6f8fb;
}

.int-module__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.int-module__name {
    font-weight: 700;
    color: var(--sc-ink, #212121);
    font-size: 0.9rem;
}

.int-module__desc {
    color: var(--sc-ink-soft, #616161);
    font-size: 0.8rem;
    line-height: 1.4;
}

/* Static marker shown instead of a switch for a pending Request (read-only module preview). */
.int-module__bullet {
    flex: none;
    width: 7px;
    height: 7px;
    margin: 7px 6px 0;
    border-radius: 50%;
    background: var(--int-brand, var(--sc-info, #2f5597));
    opacity: 0.55;
}

/* Callout explaining the external authorization step for Connect / Request integrations. */
.int-drawer__note {
    margin: 0 0 16px;
    padding: 10px 12px;
    border-radius: var(--sc-radius-sm, 4px);
    background: var(--sc-info-bg, #e8eef8);
    color: var(--sc-ink, #212121);
    font-size: 0.82rem;
    line-height: 1.45;
    border-left: 3px solid var(--sc-info, #2f5597);
}

.int-drawer__foot {
    border-top: var(--sc-border, 1px solid #e0e0e0);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.int-drawer__danger {
    background: none;
    border: none;
    color: var(--sc-neg, #b3261e);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    padding: 6px;
}

.int-drawer__danger:hover {
    text-decoration: underline;
}

/* ── Logo double-click affordance ────────────────────────────────────────── */
.int-logo[role="button"] {
    cursor: pointer;
}

.int-logo[role="button"]:hover {
    outline: 2px solid var(--brand-600, var(--accent-fill-rest));
    outline-offset: 1px;
}

/* ── Coming-soon card (greyed, non-interactive CTA) ──────────────────────── */
.int-card--soon {
    opacity: 0.72;
    background: var(--sc-neutral-bg, #fafafa);
}

.int-card--soon:hover {
    box-shadow: var(--sc-shadow, none);
    transform: none;
}

/* ── Full detail page (/integration-hub/{id}) ───────────────────────────── */
.int-detail {
    max-width: 760px;
}

.int-detail__back {
    display: inline-block;
    margin-bottom: 16px;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--brand-600, var(--accent-fill-rest));
    text-decoration: none;
}

.int-detail__back:hover {
    text-decoration: underline;
}

.int-detail__head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
}

.int-detail__name {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--sc-ink, #212121);
}

.int-detail__cat {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--sc-ink-faint, #757575);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.int-detail__about {
    margin: 0 0 20px;
    color: var(--sc-ink-soft, #616161);
    line-height: 1.55;
}

.int-detail__panel {
    border: var(--sc-border, 1px solid #e0e0e0);
    border-radius: var(--sc-radius, 4px);
    padding: 18px;
    margin-bottom: 16px;
    background: #fff;
}

.int-detail__h2 {
    margin: 0 0 10px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--sc-ink, #212121);
}

.int-detail__modules {
    margin: 0;
    padding-left: 18px;
    color: var(--sc-ink-soft, #616161);
    line-height: 1.6;
    font-size: 0.9rem;
}

.int-detail__form {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.int-detail__label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--sc-ink-soft, #616161);
    margin-top: 8px;
}

.int-detail--soon {
    padding: 12px 14px;
    border-radius: var(--sc-radius-sm, 4px);
    background: var(--sc-warn-bg, #fdf3e2);
    color: var(--sc-warn, #9a6700);
    font-weight: 700;
    font-size: 0.88rem;
    margin-bottom: 16px;
}

.int-detail__ok {
    padding: 12px 14px;
    border-radius: var(--sc-radius-sm, 4px);
    background: var(--sc-pos-bg, #e6f4f0);
    color: var(--sc-pos, #117865);
    font-weight: 600;
    font-size: 0.9rem;
}

.int-detail__muted {
    color: var(--sc-ink-faint, #757575);
    font-weight: 400;
}
