@use 'variables' as *;

// ─── Result card wrapper ──────────────────────────────────────────────────────
#result-card {
    max-width: 750px;
    margin: 0 auto;
    display: none;

    &.visible { display: block; }
}

// ─── Back button (search-page inline version) ─────────────────────────────────
#back-btn-wrap {
    max-width: 750px;
    margin: 0 auto 12px;
}

#back-btn {
    background: none;
    border: none;
    color: $red-light;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: inherit;
    padding: 0;

    &:hover { color: $red-dark; }
}

// ─── Org header ───────────────────────────────────────────────────────────────
.org-header {
    background: linear-gradient(135deg, $red-primary 0%, $red-dark 100%);
    border-radius: 16px 16px 0 0;
    padding: 28px 32px;
    color: $white;

    .return-type {
        display: inline-block;
        background: rgb(from var(--white) r g b / 0.2);
        border-radius: 6px;
        padding: 2px 10px;
        font-size: 0.75rem;
        font-weight: 700;
        letter-spacing: 0.08em;
        margin-bottom: 10px;
    }

    h2 {
        font-size: 1.5rem;
        font-weight: 700;
        line-height: 1.3;
    }

    .ein-badge {
        margin-top: 8px;
        font-size: 0.85rem;
        opacity: 0.85;
        font-family: $font-mono;
    }
}

// ─── Metrics grid ─────────────────────────────────────────────────────────────
.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    @include card;
    border-top: none;
}

.metric {
    padding: 24px 28px;
    border-right: 1px solid #f0f0f5;
    border-bottom: 1px solid #f0f0f5;

    &:nth-child(2) { border-right: none; }
    &:nth-child(3) { border-bottom: none; }
    &:nth-child(4) { border-right: none; border-bottom: none; }
}

.metric-label {
    @include section-label(0.08em);
    margin-bottom: 6px;
}

.metric-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: $navy;
    line-height: 1.2;

    &.na {
        color: $gray-300;
        font-size: 1.2rem;
    }
}

.metric-sub {
    font-size: 0.8rem;
    color: $gray-400;
    margin-top: 4px;
}

// ─── CEO section ──────────────────────────────────────────────────────────────
.ceo-section {
    @include card;
    border-top: none;
    padding: 24px 28px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.ceo-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, $red-faint, $red-pale);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: $red-primary;
    font-size: 1rem;
    flex-shrink: 0;
}

.ceo-info { flex: 1; }

.ceo-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: $gray-500;
    margin-bottom: 2px;
}

.ceo-name {
    font-size: 1rem;
    font-weight: 600;
    color: $navy;
}

.ceo-title-text {
    font-size: 0.82rem;
    color: $gray-500;
    margin-top: 1px;
}

.ceo-salary {
    text-align: right;
}

.ceo-salary-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: $gray-500;
    margin-bottom: 2px;
}

.ceo-salary-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: $green;

    &.zero { color: $gray-400; }
}

// ─── Responsive tweaks ────────────────────────────────────────────────────────
@media (max-width: $bp-mobile) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .metric {
        border-right: none;

        &:nth-child(3) {
            border-bottom: 1px solid #f0f0f5;
        }
    }

    .ceo-section {
        flex-direction: column;
        align-items: flex-start;
    }

    .ceo-salary {
        text-align: left;
    }

    .detail-card .org-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .org-logo {
        max-width: 80px;
        max-height: 60px;
    }
}
