/* =================================================================
   RAXE - Shared Widgets
   Reusable complex components used across multiple pages.
   Extracted from home.css for modular architecture.
   Loaded globally via base.html.
   ================================================================= */

/* ===== TRUST ROW / BADGES ===== */
.trust-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    padding: 6px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
}

.trust-badge svg {
    color: var(--accent-cyan);
}

/* ===== HERO CTA ===== */
.hero-cta-single {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

@media (max-width: 640px) {
    .hero-cta-single {
        width: 100%;
        padding: 0 var(--space-md);
    }

    .install-box {
        width: 100%;
        max-width: 320px;
        justify-content: center;
    }
}

/* ===== DEMO PREVIEW TERMINAL ===== */
.demo-preview-terminal {
    background: var(--bg-dark);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-dark-subtle);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.demo-preview-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.2);
}

.demo-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.demo-dot-red { background: var(--terminal-dot-red); }
.demo-dot-yellow { background: var(--terminal-dot-yellow); }
.demo-dot-green { background: var(--terminal-dot-green); }

.demo-preview-title {
    margin-left: 8px;
    font-size: 0.75rem;
    color: var(--text-on-dark-muted);
    font-family: var(--font-mono);
}

.demo-preview-body {
    padding: 16px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.8;
}

.demo-line {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.demo-line-input {
    color: var(--text-on-dark-muted);
    margin-bottom: 8px;
}

.demo-prompt {
    color: var(--accent-cyan);
    font-weight: 700;
}

.demo-cmd {
    color: var(--color-error);
    font-style: italic;
}

.demo-line-result {
    display: flex;
    align-items: center;
    gap: 10px;
}

.demo-blocked {
    background: var(--color-error);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.demo-threat {
    color: var(--accent-magenta);
    font-weight: 600;
}

.demo-confidence {
    color: var(--accent-cyan);
}

.demo-time {
    color: var(--text-on-dark-muted);
    font-size: 0.75rem;
}

.demo-preview-link {
    display: block;
    text-align: center;
    padding: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.demo-preview-link:hover {
    color: var(--accent-cyan);
}

@media (max-width: 480px) {
    .demo-preview-body {
        font-size: 0.7rem;
        padding: 12px;
    }

    .demo-line-result {
        gap: 6px;
    }
}

/* ===== INSTALL BOX ===== */
.install-box {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    background: var(--bg-dark);
    padding: 14px 20px;
    border-radius: var(--radius-lg);
}

.install-box code {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--text-on-dark);
}

.copy-btn {
    background: none;
    border: none;
    color: var(--text-on-dark-muted);
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}

.copy-btn:hover {
    color: var(--accent-cyan);
}

/* ===== CODE COMPARISON ===== */
.code-comparison {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.code-arrow {
    display: flex;
    align-items: center;
    font-size: 2rem;
    color: var(--text-muted);
    font-weight: 300;
}

.code-example {
    flex: 1;
    max-width: 400px;
    background: var(--bg-dark);
    border-radius: var(--radius-lg);
    overflow: visible;
    box-shadow: var(--shadow-lg);
}

.code-example-after {
    border: 2px solid var(--accent-cyan);
}

.code-header {
    display: flex;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    background: rgba(255,255,255,0.05);
    border-bottom: 1px solid var(--border-dark);
}

.code-lang, .code-file {
    font-size: 0.75rem;
    color: var(--text-on-dark-muted);
}

.code-block {
    padding: var(--space-lg);
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.8;
    color: var(--text-on-dark);
    min-height: 120px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.code-comment { color: var(--code-comment); }
.code-keyword { color: var(--code-keyword); }
.code-highlight { color: var(--accent-cyan); }
.code-function { color: var(--code-function); }
.code-string { color: var(--code-string); }
.code-class { color: var(--code-class); }

.code-decorator {
    color: var(--accent-cyan);
    font-weight: 600;
}

.code-new {
    display: inline;
    background: rgba(34, 211, 238, 0.15);
    border-left: 2px solid var(--accent-cyan);
    margin-left: -16px;
    padding-left: 14px;
}

.code-copy-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255,255,255,0.1);
    border: none;
    color: var(--text-on-dark-muted);
    font-size: 0.7rem;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.code-copy-btn:hover {
    background: rgba(255,255,255,0.2);
    color: var(--text-on-dark);
}

.code-copy-btn.copied {
    background: var(--color-success);
    color: white;
}

@media (max-width: 768px) {
    .code-comparison {
        flex-direction: column;
        align-items: center;
    }

    .code-arrow {
        transform: rotate(90deg);
    }

    .code-example {
        max-width: 100%;
        width: 100%;
    }
}

/* ===== FRAMEWORK LOGOS ===== */
.logo-section-label {
    text-align: center;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.framework-logos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-top: var(--space-sm);
}

.framework-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm);
}

.framework-logo img {
    height: 40px;
    width: auto;
    filter: grayscale(100%);
    opacity: 0.65;
    transition: all 0.2s ease;
}

.framework-logo:hover img {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.08);
}

.framework-logo span {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
    opacity: 0.8;
}

.framework-logo:hover span {
    opacity: 1;
    color: var(--text-secondary);
}

.framework-logo-more {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 var(--space-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
}

.framework-logo-more .more-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .framework-logos {
        gap: var(--space-md);
    }

    .framework-logo {
        padding: var(--space-sm);
    }
}

/* ===== PIPELINE VISUALIZATION ===== */
.pipeline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    max-width: 900px;
    margin: 0 auto var(--space-xl);
}

.pipeline-input,
.pipeline-output {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    min-width: 80px;
}

.pipeline-input span,
.pipeline-output span {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.pipeline-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pipeline-icon-threat {
    background: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%);
    color: var(--color-error);
    animation: threatPulse 2s ease-in-out infinite;
}

.pipeline-icon-safe {
    background: linear-gradient(135deg, #bbf7d0 0%, #86efac 100%);
    color: var(--color-success);
    animation: safePulse 2s ease-in-out infinite;
    animation-delay: 2s;
}

@keyframes threatPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.2);
    }
    50% {
        box-shadow: 0 0 0 12px rgba(220, 38, 38, 0);
    }
}

@keyframes safePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.2);
    }
    50% {
        box-shadow: 0 0 0 12px rgba(22, 163, 74, 0);
    }
}

.pipeline-flow {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0;
}

.pipeline-connector {
    flex: 0 0 24px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-cyan) 0%, var(--accent-magenta) 100%);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.pipeline-connector::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
    animation: flowPulse 2s ease-in-out infinite;
}

@keyframes flowPulse {
    0% { left: -100%; }
    50%, 100% { left: 100%; }
}

.pipeline-stages {
    flex: 1;
    display: flex;
    justify-content: space-between;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
}

.pipeline-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    transition: all 0.2s;
    cursor: default;
}

.pipeline-stage:hover {
    background: rgba(34, 211, 238, 0.1);
}

.stage-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    animation: stagePulse 3s ease-in-out infinite;
}

/* Sequential animation delays for each stage */
.pipeline-stage:nth-child(1) .stage-icon { animation-delay: 0s; }
.pipeline-stage:nth-child(2) .stage-icon { animation-delay: 0.4s; }
.pipeline-stage:nth-child(3) .stage-icon { animation-delay: 0.8s; }
.pipeline-stage:nth-child(4) .stage-icon { animation-delay: 1.2s; }
.pipeline-stage:nth-child(5) .stage-icon { animation-delay: 1.6s; }

@keyframes stagePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(34, 211, 238, 0);
    }
    15% {
        transform: scale(1.1);
        box-shadow: 0 0 0 8px rgba(34, 211, 238, 0.3);
    }
    30% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(34, 211, 238, 0);
    }
}

.pipeline-stage strong {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.pipeline-stage span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Layer Details (collapsible) */
.layer-details {
    max-width: 900px;
    margin: var(--space-md) auto 0;
}

.layer-details summary {
    display: flex;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    transition: color 0.2s, border-color 0.2s;
}

.layer-details summary:hover {
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
}

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

.layer-details summary::before {
    content: "► ";
    font-size: 0.7rem;
    margin-right: 6px;
    transition: transform 0.2s;
}

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

.layer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--space-md);
    margin-top: var(--space-md);
}

.layer-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    text-align: center;
}

.layer-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    background: var(--gradient-primary);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-xs);
}

.layer-card strong {
    display: block;
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.layer-card p {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

/* Pipeline mobile */
@media (max-width: 768px) {
    .pipeline {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .pipeline-input,
    .pipeline-output {
        flex-direction: row;
        gap: var(--space-sm);
    }

    .pipeline-flow {
        flex-direction: column;
        width: 100%;
    }

    .pipeline-connector {
        width: 3px;
        height: 16px;
        flex: 0 0 16px;
    }

    .pipeline-stages {
        flex-direction: column;
        gap: var(--space-xs);
    }

    .pipeline-stage {
        flex-direction: row;
        justify-content: flex-start;
        gap: var(--space-sm);
    }

    .layer-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== COMPLIANCE BADGES ===== */
.compliance-badges {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-top: var(--space-2xl);
}

.compliance-badge {
    opacity: 0.7;
    transition: opacity 0.2s, transform 0.2s;
}

.compliance-badge:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.compliance-badge img {
    height: 40px;
    width: auto;
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    .pipeline-icon-threat,
    .pipeline-icon-safe,
    .stage-icon,
    .pipeline-connector::after {
        animation: none !important;
    }
}

