/* ===================================================================
   WARUM-ICH/ARCHITECTURE.CSS - Architecture Diagrams & Code Showcase
   =================================================================== */

.architecture {
    padding: 100px 0;
}

.architecture-showcase {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
    margin-top: 60px;
    margin-bottom: 60px;
}

.arch-diagram {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 32px;
    position: relative;
    overflow: hidden;
}

.arch-diagram.pro-diagram::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #10b981, #3b82f6, #8b5cf6);
}

.arch-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.arch-title h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.arch-badge {
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.arch-badge.live {
    background: linear-gradient(135deg, #10b981, #059669);
    animation: pulse-badge 2s ease-in-out infinite;
}

.arch-badge.async {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

@keyframes pulse-badge {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
}

/* ===== Cloud Architecture Diagram ===== */
.cloud-architecture {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.arch-layer {
    background: var(--bg-darker);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid var(--border-color);
}

.layer-label {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.label-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.label-badge.edge { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }
.label-badge.api { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.4); }
.label-badge.data { background: rgba(139, 92, 246, 0.2); color: #a78bfa; border: 1px solid rgba(139, 92, 246, 0.4); }

.cache-hint {
    font-size: 0.75rem;
    color: #34d399;
    font-weight: 600;
    padding: 2px 8px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 4px;
}

.layer-nodes {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.arch-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    min-width: 80px;
    position: relative;
    transition: all 0.3s ease;
}

.arch-node:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

.node-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.3);
    filter: blur(15px);
    opacity: 0.5;
    pointer-events: none;
}

.node-glow.green { background: rgba(16, 185, 129, 0.4); }
.node-glow.red { background: rgba(239, 68, 68, 0.4); }

.arch-node .node-icon { font-size: 1.5rem; }
.arch-node .node-name { font-size: 0.8rem; font-weight: 600; color: var(--text-primary); }
.arch-node .node-detail { font-size: 0.65rem; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }

.node-connector {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 4px;
}

.node-connector.fast { position: relative; }
.speed-label { font-size: 0.6rem; color: #34d399; font-weight: 600; font-family: 'JetBrains Mono', monospace; }
.connector-arrow { color: var(--text-muted); font-size: 1.25rem; }

.layer-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
    position: relative;
}

.layer-divider::before {
    content: '';
    position: absolute;
    left: 20%;
    right: 20%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
}

.cache-miss {
    background: var(--bg-card);
    padding: 4px 12px;
    font-size: 0.7rem;
    color: var(--text-muted);
    border-radius: 20px;
    position: relative;
    z-index: 1;
}

/* ===== Async Flow Diagram ===== */
.async-flow {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.flow-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-darker);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.flow-step.highlight {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.step-number {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.flow-step.highlight .step-number { background: #10b981; }

.step-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.step-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border-radius: 8px;
    flex-shrink: 0;
}

.step-info { display: flex; flex-direction: column; gap: 2px; }
.step-title { font-size: 0.9rem; font-weight: 600; color: var(--text-primary); }
.step-desc { font-size: 0.75rem; color: var(--text-muted); }
.step-time { font-size: 0.7rem; font-family: 'JetBrains Mono', monospace; color: #34d399; font-weight: 600; }
.step-time.async-time { color: var(--text-muted); }

.step-arrow { color: var(--text-muted); font-size: 1.25rem; padding: 0 8px; }
.step-arrow.split { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.arrow-label { font-size: 0.6rem; color: var(--text-muted); }

.flow-comparison {
    display: flex;
    gap: 16px;
    margin-top: 16px;
    padding: 12px;
    background: var(--bg-darker);
    border-radius: 8px;
}

.comparison-item { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; }
.comparison-item.bad { color: #f87171; }
.comparison-item.good { color: #34d399; }
.comp-icon { font-size: 1rem; }

.arch-benefit {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding: 12px 16px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 8px;
    font-size: 0.9rem;
}

.arch-benefit.pro {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(59, 130, 246, 0.1));
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.benefit-icon { font-size: 1.25rem; }

/* ===== Code Showcase ===== */
.code-showcase { max-width: 800px; margin: 0 auto; }

.code-window.large {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
}

.code-window.large .code-content {
    padding: 24px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.7;
    overflow-x: auto;
}

.code-window.large pre { margin: 0; white-space: pre-wrap; }
.code-window.large code { color: var(--text-primary); }

/* Code Syntax Highlighting */
.code-keyword { color: #c792ea; }
.code-class { color: #ffcb6b; }
.code-function { color: #82aaff; }
.code-string { color: #c3e88d; }
.code-comment { color: #546e7a; font-style: italic; }
.code-type { color: #f78c6c; }
.code-decorator { color: #c792ea; }
