/* =================================================================
   RAXE Scanner Scorecard - Modern UI Components
   Beautiful, animated result cards with confidence meters
   ================================================================= */

/* ===== Scorecard Base Styles ===== */
.threat-scorecard,
.safe-scorecard {
    background: rgba(255, 255, 255, 0.02);
    border: 2px 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);
}

.threat-scorecard {
    background: linear-gradient(135deg,
        rgba(239, 68, 68, 0.05) 0%,
        rgba(239, 68, 68, 0.02) 100%);
    border-color: rgba(239, 68, 68, 0.3);
}

.safe-scorecard {
    background: linear-gradient(135deg,
        rgba(52, 211, 153, 0.05) 0%,
        rgba(52, 211, 153, 0.02) 100%);
    border-color: rgba(52, 211, 153, 0.3);
}

@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;
}

/* ===== Animated Icons ===== */
.icon-pulse {
    position: absolute;
    inset: -8px;
    border: 2px solid rgba(239, 68, 68, 0.4);
    border-radius: 50%;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.icon-glow {
    position: absolute;
    inset: -8px;
    border: 2px solid rgba(52, 211, 153, 0.4);
    border-radius: 50%;
    animation: glow 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0;
    }
}

@keyframes glow {
    0%, 100% {
        transform: scale(1);
        opacity: 0.6;
        box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.4);
    }
    50% {
        transform: scale(1.2);
        opacity: 0;
        box-shadow: 0 0 20px 10px rgba(52, 211, 153, 0);
    }
}

.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;
    }
}

@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;
    }
}

/* ===== 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;
    }
}
