/* =================================================================
   RAXE Scanner Scorecard - Modern UI Components
   Beautiful, animated result cards with confidence meters
   V2: Improved UX with severity-based styling and clear hierarchy
   ================================================================= */

/* ===== Scorecard Base Styles ===== */
.threat-scorecard,
.safe-scorecard {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    animation: scorecard-enter 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Status indicator strip at top */
.threat-scorecard::before,
.safe-scorecard::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.threat-scorecard {
    background: linear-gradient(135deg,
        rgba(239, 68, 68, 0.06) 0%,
        rgba(239, 68, 68, 0.02) 100%);
    border-color: rgba(239, 68, 68, 0.4);
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.1),
                0 4px 24px rgba(239, 68, 68, 0.15),
                inset 0 1px 0 rgba(239, 68, 68, 0.1);
}

.threat-scorecard::before {
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 50%, #ef4444 100%);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

/* Severity-based styling */
.threat-scorecard.severity-critical {
    border-color: rgba(220, 38, 38, 0.5);
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.08) 0%, rgba(220, 38, 38, 0.02) 100%);
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.15),
                0 4px 24px rgba(220, 38, 38, 0.2),
                inset 0 1px 0 rgba(220, 38, 38, 0.1);
}
.threat-scorecard.severity-critical::before {
    background: linear-gradient(90deg, #dc2626 0%, #b91c1c 50%, #dc2626 100%);
}

.threat-scorecard.severity-high {
    border-color: rgba(249, 115, 22, 0.5);
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.08) 0%, rgba(249, 115, 22, 0.02) 100%);
    box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.15),
                0 4px 24px rgba(249, 115, 22, 0.2),
                inset 0 1px 0 rgba(249, 115, 22, 0.1);
}
.threat-scorecard.severity-high::before {
    background: linear-gradient(90deg, #f97316 0%, #ea580c 50%, #f97316 100%);
}

.threat-scorecard.severity-medium {
    border-color: rgba(234, 179, 8, 0.5);
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.08) 0%, rgba(234, 179, 8, 0.02) 100%);
    box-shadow: 0 0 0 1px rgba(234, 179, 8, 0.15),
                0 4px 24px rgba(234, 179, 8, 0.15),
                inset 0 1px 0 rgba(234, 179, 8, 0.1);
}
.threat-scorecard.severity-medium::before {
    background: linear-gradient(90deg, #eab308 0%, #ca8a04 50%, #eab308 100%);
}

.threat-scorecard.severity-low {
    border-color: rgba(59, 130, 246, 0.5);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(59, 130, 246, 0.02) 100%);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.15),
                0 4px 24px rgba(59, 130, 246, 0.15),
                inset 0 1px 0 rgba(59, 130, 246, 0.1);
}
.threat-scorecard.severity-low::before {
    background: linear-gradient(90deg, #3b82f6 0%, #2563eb 50%, #3b82f6 100%);
}

.safe-scorecard {
    background: linear-gradient(135deg,
        rgba(52, 211, 153, 0.06) 0%,
        rgba(52, 211, 153, 0.02) 100%);
    border-color: rgba(52, 211, 153, 0.4);
    box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.1),
                0 4px 24px rgba(52, 211, 153, 0.12),
                inset 0 1px 0 rgba(52, 211, 153, 0.1);
}

.safe-scorecard::before {
    background: linear-gradient(90deg, #34d399 0%, #10b981 50%, #34d399 100%);
    box-shadow: 0 2px 8px rgba(52, 211, 153, 0.4);
}

/* ===== Hero Section (New V2) ===== */
.scorecard-hero {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.scorecard-hero.safe {
    border-bottom-color: rgba(52, 211, 153, 0.15);
}

.hero-icon-container {
    position: relative;
    width: 72px;
    height: 72px;
    flex-shrink: 0;
}

.hero-icon {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.hero-icon.threat {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.25) 0%, rgba(239, 68, 68, 0.15) 100%);
    border: 2px solid rgba(239, 68, 68, 0.5);
    color: #ef4444;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.2),
                inset 0 0 12px rgba(239, 68, 68, 0.1);
}

.hero-icon.safe {
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.25) 0%, rgba(52, 211, 153, 0.15) 100%);
    border: 2px solid rgba(52, 211, 153, 0.5);
    color: #34d399;
    box-shadow: 0 0 20px rgba(52, 211, 153, 0.2),
                inset 0 0 12px rgba(52, 211, 153, 0.1);
}

.hero-content {
    flex: 1;
    min-width: 0;
}

.severity-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.safe-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: rgba(52, 211, 153, 0.15);
    border: 1px solid rgba(52, 211, 153, 0.4);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #34d399;
    margin-bottom: 8px;
}

.hero-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 6px 0;
    line-height: 1.2;
}

.hero-title.safe {
    color: #34d399;
}

.hero-subtitle {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.confidence-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    background: rgba(155, 92, 255, 0.15);
    border-radius: 100px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #a78bfa;
}

.confidence-pill.safe {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
}

/* ===== Findings Section (New V2) ===== */
.findings-section {
    margin-bottom: 20px;
}

.findings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.finding-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    transition: all 0.2s ease;
}

.finding-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.finding-card.primary {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
}

.finding-card.primary .finding-icon {
    color: #ef4444;
}

.finding-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 8px;
    background: rgba(155, 92, 255, 0.1);
    color: var(--accent-primary);
}

.finding-content {
    flex: 1;
    min-width: 0;
}

.finding-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}

.finding-value {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

/* ===== Action Section (New V2) ===== */
.action-section {
    padding: 16px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

.action-section.safe {
    background: rgba(52, 211, 153, 0.08);
    border-color: rgba(52, 211, 153, 0.2);
}

.action-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.action-header span {
    font-weight: 700;
    color: var(--text-primary);
}

.action-section.safe .action-header span {
    color: #34d399;
}

.action-text {
    margin: 0;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ===== Technical Details (New V2 - Collapsible) ===== */
.tech-details {
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    overflow: hidden;
}

.tech-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    list-style: none;
}

.tech-summary::-webkit-details-marker {
    display: none;
}

.tech-summary:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.tech-summary svg {
    transition: transform 0.2s ease;
}

.tech-details[open] .tech-summary svg {
    transform: rotate(90deg);
}

.tech-content {
    padding: 16px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.tech-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

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

.tech-label {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

.tech-value {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--text-secondary);
    background: rgba(155, 92, 255, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

/* ===== Safe Summary (New V2) ===== */
.safe-summary {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px;
    background: rgba(52, 211, 153, 0.05);
    border: 1px solid rgba(52, 211, 153, 0.15);
    border-radius: 10px;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.summary-item svg {
    flex-shrink: 0;
}

@keyframes scorecard-enter {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
        filter: blur(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

/* ===== Scorecard Header ===== */
.scorecard-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.threat-icon-container,
.safe-icon-container {
    position: relative;
    width: 64px;
    height: 64px;
    flex-shrink: 0;
}

/* ===== Icon Accents (Static glow, no animation) ===== */
.icon-pulse {
    position: absolute;
    inset: -4px;
    border: 2px solid rgba(239, 68, 68, 0.3);
    border-radius: 14px;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.25);
}

.icon-glow {
    position: absolute;
    inset: -4px;
    border: 2px solid rgba(52, 211, 153, 0.3);
    border-radius: 14px;
    box-shadow: 0 0 12px rgba(52, 211, 153, 0.25);
}

.threat-icon,
.safe-icon {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    position: relative;
    z-index: 1;
}

.threat-icon {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(239, 68, 68, 0.1) 100%);
    border: 2px solid rgba(239, 68, 68, 0.3);
}

.safe-icon {
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.2) 0%, rgba(52, 211, 153, 0.1) 100%);
    border: 2px solid rgba(52, 211, 153, 0.3);
}

.scorecard-status {
    flex: 1;
}

.threat-title,
.safe-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.02em;
}

.threat-title {
    color: #ef4444;
    text-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

.safe-title {
    color: #34d399;
    text-shadow: 0 0 20px rgba(52, 211, 153, 0.3);
}

.scan-time {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    margin-top: 4px;
    font-family: var(--font-mono);
}

/* ===== Confidence Meter ===== */
.confidence-meter {
    margin: 24px 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.meter-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
}

.meter-header span:first-child {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.confidence-value {
    font-size: 1.75rem;
    font-weight: 800;
    font-family: var(--font-mono);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.meter-bar {
    height: 14px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 7px;
    overflow: hidden;
    position: relative;
    margin-bottom: 8px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.meter-fill {
    height: 100%;
    border-radius: 7px;
    position: relative;
    transition: width 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: meter-fill-in 1.2s ease-out;
}

@keyframes meter-fill-in {
    0% {
        width: 0% !important;
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    100% {
        opacity: 1;
    }
}

.meter-fill.critical,
.meter-fill.high {
    background: linear-gradient(90deg,
        #f59e0b 0%,
        #ef4444 50%,
        #dc2626 100%);
}

.meter-fill.medium {
    background: linear-gradient(90deg,
        #84cc16 0%,
        #eab308 50%,
        #f59e0b 100%);
}

.meter-fill.low,
.meter-fill.safe {
    background: linear-gradient(90deg,
        #10b981 0%,
        #34d399 50%,
        #6ee7b7 100%);
}

.meter-shimmer {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 100%);
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(200%);
    }
}

.meter-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ===== Detail Cards Grid - 3 Columns for Wider Cards ===== */
.detail-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 24px 0;
}

.detail-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: default;
}

.detail-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(155, 92, 255, 0.3);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3),
                0 0 0 1px rgba(155, 92, 255, 0.1);
}

.detail-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 8px;
    background: rgba(155, 92, 255, 0.1);
    transition: transform 0.3s ease;
}

.detail-card:hover .detail-icon {
    transform: scale(1.1) rotate(5deg);
}

.detail-content {
    flex: 1;
    min-width: 0;
}

.detail-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.detail-value {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9375rem;
    word-wrap: break-word;
    line-height: 1.4;
}

/* ===== Threat Family/Subfamily Tags ===== */
.threat-tag {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    color: #ef4444;
    font-weight: 600;
    font-size: 0.875rem;
    font-family: var(--font-mono);
}

/* ===== Explanation Section ===== */
.threat-explanation,
.safe-explanation {
    margin-top: 20px;
    padding: 16px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.threat-explanation {
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.2);
}

.safe-explanation {
    background: rgba(52, 211, 153, 0.05);
    border-color: rgba(52, 211, 153, 0.2);
}

.explanation-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.explanation-header svg {
    width: 18px;
    height: 18px;
    color: var(--accent-secondary);
}

.explanation-text {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.9375rem;
}

/* ===== Action Buttons ===== */
.scorecard-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    white-space: nowrap;
}

.action-btn svg {
    width: 16px;
    height: 16px;
}

.action-btn.primary {
    background: var(--gradient-primary);
    color: white;
}

.action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(155, 92, 255, 0.4);
}

.action-btn.secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.action-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(155, 92, 255, 0.3);
}

/* ===== Confetti Animation ===== */
.confetti-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 10;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--accent-primary);
    animation: confetti-fall 3s ease-out forwards;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(500px) rotate(720deg);
        opacity: 0;
    }
}

/* ===== Recommendation Badge ===== */
.recommendation-badge {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 3px solid;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.recommendation-badge.threat {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
}

.recommendation-badge.safe {
    background: rgba(52, 211, 153, 0.1);
    border-color: #34d399;
}

.recommendation-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.recommendation-text {
    flex: 1;
}

.recommendation-text strong {
    display: block;
    margin-bottom: 4px;
    font-weight: 700;
}

.recommendation-badge.threat strong {
    color: #ef4444;
}

.recommendation-badge.safe strong {
    color: #34d399;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .threat-scorecard,
    .safe-scorecard {
        padding: 20px;
    }

    .scorecard-header {
        gap: 16px;
    }

    .threat-icon-container,
    .safe-icon-container {
        width: 56px;
        height: 56px;
    }

    /* Stack detail cards to 2 columns on tablet */
    .detail-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .threat-icon,
    .safe-icon {
        width: 56px;
        height: 56px;
        font-size: 28px;
    }

    .threat-title,
    .safe-title {
        font-size: 1.25rem;
    }

    .detail-cards-grid {
        grid-template-columns: 1fr;
    }

    .scorecard-actions {
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
    }

    .confidence-value {
        font-size: 1.5rem;
    }

    /* V2 Hero responsive */
    .scorecard-hero {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .hero-icon-container {
        width: 64px;
        height: 64px;
    }

    .hero-icon {
        width: 64px;
        height: 64px;
    }

    .hero-title {
        font-size: 1.25rem;
    }

    .hero-subtitle {
        justify-content: center;
    }

    /* V2 Findings responsive */
    .findings-grid {
        grid-template-columns: 1fr;
    }

    /* V2 Safe summary responsive */
    .safe-summary {
        padding: 14px;
    }

    .summary-item {
        font-size: 0.875rem;
    }

    /* V2 Tech details responsive */
    .tech-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .tech-value {
        word-break: break-all;
    }
}

@media (max-width: 480px) {
    .confidence-meter {
        padding: 16px;
    }

    .meter-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .confidence-value {
        font-size: 1.75rem;
    }

    /* Single column on mobile for better readability */
    .detail-cards-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .severity-badge,
    .safe-badge {
        font-size: 0.6875rem;
        padding: 4px 10px;
    }

    .finding-card {
        padding: 12px;
    }

    .action-section {
        padding: 14px;
    }
}

/* ===== Loading Skeleton (for future use) ===== */
.scorecard-skeleton {
    background: rgba(255, 255, 255, 0.02);
    border: 2px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 24px;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes skeleton-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.skeleton-line {
    height: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    margin-bottom: 12px;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

.skeleton-line.short {
    width: 60%;
}

@keyframes skeleton-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* =================================================================
   Share & Export Actions
   ================================================================= */

.scorecard-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    justify-content: center;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-body);
}

.action-btn:hover {
    background: rgba(155, 92, 255, 0.15);
    border-color: rgba(155, 92, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(155, 92, 255, 0.2);
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn svg {
    flex-shrink: 0;
}

/* Post-Scan CTAs */
.post-scan-ctas {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-xl);
    border-top: 1px solid var(--border-primary);
}

.ctas-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    justify-content: center;
}

.ctas-header svg {
    width: 20px;
    height: 20px;
    color: var(--accent-primary);
}

.ctas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--spacing-md);
}

.cta-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    background: var(--bg-tertiary);
    border: 2px solid var(--border-primary);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition-base);
    cursor: pointer;
}

.cta-card.primary {
    border-color: var(--accent-primary);
    background: rgba(155, 92, 255, 0.05);
}

.cta-card.secondary {
    border-color: var(--color-cyan);
    background: rgba(0, 212, 255, 0.05);
}

.cta-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.cta-card.primary:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 8px 24px rgba(155, 92, 255, 0.3);
}

.cta-card.secondary:hover {
    border-color: var(--color-cyan);
    box-shadow: 0 8px 24px rgba(0, 212, 255, 0.3);
}

.cta-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    color: var(--accent-primary);
}

.cta-card.primary .cta-icon {
    color: var(--accent-primary);
    background: rgba(155, 92, 255, 0.1);
}

.cta-card.secondary .cta-icon {
    color: var(--color-cyan);
    background: rgba(0, 212, 255, 0.1);
}

.cta-content {
    flex: 1;
    text-align: left;
}

.cta-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.cta-subtitle {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

/* Responsive */
@media (max-width: 768px) {
    .ctas-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .scorecard-actions {
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
        justify-content: center;
    }

    .cta-card {
        padding: var(--spacing-md);
    }

    .cta-icon {
        width: 40px;
        height: 40px;
    }
}

/* =================================================================
   Full Analysis Modal/Panel - Tier 3 View
   Detailed probability distributions for security analysts
   ================================================================= */

/* Overlay */
.analysis-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.analysis-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Slide-out Panel */
.analysis-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 560px;
    height: 100vh;
    background: var(--bg-primary);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: -20px 0 60px rgba(0, 0, 0, 0.5);
    z-index: 1001;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.analysis-panel.active {
    transform: translateX(0);
}

/* Panel Header */
.analysis-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.analysis-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
}

.analysis-title svg {
    color: var(--accent-primary);
}

.analysis-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.analysis-close:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

/* Panel Content */
.analysis-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* Classifier Section */
.classifier-section {
    margin-bottom: 28px;
}

.classifier-section:last-child {
    margin-bottom: 0;
}

.classifier-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.classifier-name {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.classifier-name svg {
    color: var(--accent-primary);
    width: 18px;
    height: 18px;
}

.classifier-badge {
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    font-family: var(--font-mono);
}

.classifier-badge.binary {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.classifier-badge.multiclass {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
}

.classifier-badge.multilabel {
    background: rgba(236, 72, 153, 0.15);
    color: #f472b6;
}

/* Probability Distribution Bars */
.prob-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.prob-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.prob-item.detected {
    background: rgba(239, 68, 68, 0.08);
    margin: -8px -12px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.prob-item.top-result {
    background: rgba(52, 211, 153, 0.08);
    margin: -8px -12px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(52, 211, 153, 0.2);
}

.prob-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.prob-class {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.prob-item.detected .prob-class,
.prob-item.top-result .prob-class {
    color: var(--text-primary);
    font-weight: 600;
}

.prob-value {
    font-size: 0.8125rem;
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-tertiary);
}

.prob-item.detected .prob-value {
    color: #ef4444;
}

.prob-item.top-result .prob-value {
    color: #34d399;
}

.prob-bar-container {
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

.prob-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: linear-gradient(90deg, rgba(155, 92, 255, 0.4) 0%, rgba(155, 92, 255, 0.6) 100%);
}

.prob-item.detected .prob-bar {
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}

.prob-item.top-result .prob-bar {
    background: linear-gradient(90deg, #34d399 0%, #10b981 100%);
}

/* High probability bars */
.prob-bar.high {
    background: linear-gradient(90deg, #f59e0b 0%, #ef4444 100%);
}

.prob-bar.medium {
    background: linear-gradient(90deg, #84cc16 0%, #eab308 100%);
}

.prob-bar.low {
    background: linear-gradient(90deg, rgba(148, 163, 184, 0.3) 0%, rgba(148, 163, 184, 0.5) 100%);
}

/* Show More Button for long lists */
.show-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px;
    margin-top: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.show-more-btn:hover {
    background: rgba(155, 92, 255, 0.1);
    border-color: rgba(155, 92, 255, 0.3);
    color: var(--accent-primary);
}

.show-more-btn svg {
    transition: transform 0.2s ease;
}

.show-more-btn.expanded svg {
    transform: rotate(180deg);
}

/* Model Info Section */
.model-info-section {
    margin-top: 24px;
    padding: 16px;
    background: rgba(155, 92, 255, 0.05);
    border: 1px solid rgba(155, 92, 255, 0.15);
    border-radius: 10px;
}

.model-info-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.model-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.model-info-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.model-info-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.model-info-value {
    font-size: 0.8125rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

/* View Full Analysis Button */
.view-analysis-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: rgba(155, 92, 255, 0.1);
    border: 1px solid rgba(155, 92, 255, 0.3);
    border-radius: 8px;
    color: var(--accent-primary);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-analysis-btn:hover {
    background: rgba(155, 92, 255, 0.2);
    border-color: rgba(155, 92, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(155, 92, 255, 0.25);
}

.view-analysis-btn svg {
    width: 16px;
    height: 16px;
}

/* Panel Footer */
.analysis-footer {
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.analysis-footer-note {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

.analysis-footer-note svg {
    color: var(--accent-primary);
    width: 14px;
    height: 14px;
}

/* Export JSON button in footer */
.export-json-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.export-json-btn:hover {
    background: rgba(155, 92, 255, 0.15);
    border-color: rgba(155, 92, 255, 0.3);
    color: var(--text-primary);
}

/* Responsive */
@media (max-width: 640px) {
    .analysis-panel {
        max-width: 100%;
        border-left: none;
    }

    .analysis-header {
        padding: 16px 20px;
    }

    .analysis-content {
        padding: 20px;
    }

    .classifier-section {
        margin-bottom: 24px;
    }

    .model-info-grid {
        grid-template-columns: 1fr;
    }

    .analysis-footer {
        flex-direction: column;
        gap: 12px;
        padding: 16px 20px;
    }

    .analysis-footer-note {
        text-align: center;
    }
}
