/* ==========================================================================
   AMPC Port Lookup — scoped to #ampc-port-lookup-wrap
   ========================================================================== */

#ampc-port-lookup-wrap {
    max-width: 100%;
    margin: 0 auto;
    font-family: inherit;
}

/* Form layout
   ========================================================================== */

#ampc-port-lookup-form {
    background: #f5f7fa;
    border: 1px solid #dde1e7;
    border-radius: 6px;
    padding: 24px 28px;
    margin-bottom: 28px;
}

.ampc-form-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.ampc-form-row:last-child {
    margin-bottom: 0;
}

.ampc-form-row label,
.ampc-proto-label {
    font-weight: 600;
    min-width: 110px;
    color: #333;
}

#ampc-port-number {
    width: 160px;
    padding: 8px 10px;
    border: 1px solid #bbb;
    border-radius: 4px;
    font-size: 1rem;
    line-height: 1.4;
}

#ampc-port-number:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba( 0, 115, 170, 0.2 );
}

.ampc-proto-row {
    flex-wrap: wrap;
}

.ampc-checkbox-label {
    font-weight: normal;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

#ampc-port-search-btn {
    padding: 9px 28px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

#ampc-port-search-btn:hover {
    background: #005a87;
}

#ampc-port-search-btn:disabled {
    background: #999;
    cursor: not-allowed;
}

/* Loading / error states
   ========================================================================== */

.ampc-loading {
    color: #555;
    font-style: italic;
    padding: 12px 0;
}

.ampc-error {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    padding: 14px 18px;
    color: #856404;
    font-weight: 500;
}

/* Result cards
   ========================================================================== */

.ampc-results-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ampc-result-card {
    background: #fff;
    border: 1px solid #dde1e7;
    border-radius: 6px;
    padding: 20px 24px;
}

/* Card outline accent — color comes from the --tier modifier. The base
   class only carries the shared 5px left-border geometry. */
.ampc-malware-card {
    border-left-style: solid;
    border-left-width: 5px;
}

.ampc-malware-card--low {
    border-color: #9ca3af;
    border-left-color: #9ca3af;
}

.ampc-malware-card--moderate {
    border-color: #fb923c;
    border-left-color: #fb923c;
}

.ampc-malware-card--high {
    border-color: #c0392b;
    border-left-color: #c0392b;
}

.ampc-result-heading {
    margin: 0 0 16px;
    font-size: 1.25rem;
    color: #1a1a1a;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

/* Malware warning banner — tiered
   ========================================================================== */

.ampc-malware-warning {
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 10px 14px;
    margin-bottom: 16px;
}

.ampc-malware-warning--low {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #4b5563;
}

.ampc-malware-warning--moderate {
    background: #fff7ed;
    border-color: #fb923c;
    color: #9a3412;
}

.ampc-malware-warning--high {
    background: #fdf2f2;
    border-color: #e74c3c;
    color: #c0392b;
}

/* Banner internals */

.ampc-malware-headline {
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.4;
    margin-bottom: 6px;
}

.ampc-malware-counts {
    font-weight: 500;
    font-size: 0.95rem;
    line-height: 1.5;
}

.ampc-malware-families {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba( 0, 0, 0, 0.08 );
    font-size: 0.875rem;
    line-height: 1.7;
}

.ampc-malware-families-label {
    font-weight: 600;
    margin-right: 6px;
}

.ampc-malware-family {
    display: inline-block;
    background: rgba( 255, 255, 255, 0.6 );
    border: 1px solid rgba( 0, 0, 0, 0.1 );
    border-radius: 3px;
    padding: 2px 8px;
    margin: 2px 3px 2px 0;
    font-size: 0.85rem;
    font-weight: 500;
    color: inherit;
}

.ampc-malware-family em {
    font-style: normal;
    opacity: 0.7;
    margin-left: 2px;
}

/* Phase 6: linked variant — pill becomes a clickable link to its
   matching MITRE ATT&CK Software entry. Rendered as <a> instead of
   <span>; inherits the base .ampc-malware-family pill geometry via
   the shared class. Higher specificity (a + class + class) helps
   override theme-default link styling on the host site. */
a.ampc-malware-family.ampc-mitre-linked {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

a.ampc-malware-family.ampc-mitre-linked:hover {
    background: rgba( 255, 255, 255, 0.9 );
    border-color: rgba( 0, 0, 0, 0.25 );
    text-decoration: none;
}

a.ampc-malware-family.ampc-mitre-linked:focus {
    outline: 2px solid #0073aa;
    outline-offset: 1px;
}

.ampc-mitre-arrow {
    margin-left: 3px;
    font-size: 0.75em;
    opacity: 0.55;
}

.ampc-malware-more {
    font-style: italic;
    opacity: 0.75;
    font-size: 0.85rem;
}

/* Result rows (label / value pairs)
   ========================================================================== */

.ampc-result-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
}

.ampc-result-row:last-child {
    border-bottom: none;
}

.ampc-label {
    font-weight: 600;
    min-width: 160px;
    flex-shrink: 0;
    color: #444;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.ampc-value {
    color: #222;
    line-height: 1.55;
}

/* Rich text blocks (plain_summary, security_note)
   ========================================================================== */

.ampc-result-row.ampc-supplementary,
.ampc-result-row.ampc-comments {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.ampc-rich-text {
    white-space: pre-wrap;
    line-height: 1.6;
    color: #333;
}

/* IDS rule references section
   ========================================================================== */

.ampc-ids-section {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #eee;
}

.ampc-ids-header {
    font-size: 0.95rem;
    color: #333;
    margin-bottom: 8px;
}

.ampc-ids-count {
    font-weight: 700;
    color: #0073aa;
}

.ampc-ids-disclaimer {
    background: #f0f6fc;
    border-left: 3px solid #0073aa;
    border-radius: 0 4px 4px 0;
    padding: 8px 12px;
    font-size: 0.875rem;
    color: #444;
    line-height: 1.5;
    margin-bottom: 10px;
}

.ampc-ids-sub-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #555;
    display: block;
    margin-bottom: 6px;
}

.ampc-ids-classtypes {
    margin-bottom: 10px;
}

.ampc-classtype-tag {
    display: inline-block;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 2px 8px;
    font-size: 0.8rem;
    color: #333;
    margin: 2px 3px 2px 0;
}

.ampc-classtype-tag em {
    color: #666;
    font-style: normal;
}

.ampc-ids-sample-list {
    margin: 0;
    padding-left: 18px;
    font-size: 0.875rem;
    color: #444;
    line-height: 1.6;
}

.ampc-ids-sample-list li {
    margin-bottom: 4px;
}

.ampc-sample-proto {
    display: inline-block;
    background: #e8f4f8;
    color: #005a87;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    margin-right: 5px;
    vertical-align: middle;
}

/* Attribution footer
   ========================================================================== */

.ampc-attribution {
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
    font-size: 0.8rem;
    color: #777;
}

.ampc-attribution-label {
    font-weight: 600;
}

.ampc-attribution a {
    color: #0073aa;
    text-decoration: none;
}

.ampc-attribution a:hover {
    text-decoration: underline;
}

/* Responsive — narrow screens
   ========================================================================== */

@media ( max-width: 540px ) {

    #ampc-port-lookup-form {
        padding: 16px;
    }

    .ampc-form-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .ampc-label {
        min-width: auto;
    }

    .ampc-result-card {
        padding: 14px 16px;
    }

    .ampc-classtype-tag {
        font-size: 0.75rem;
    }
}
