/* ============================================================
   ARCHITECTURE.CSS — Architecture diagram renderer
   ============================================================ */

/* ── Service Nodes ────────────────────────────────────────── */

.service-node {
    cursor: move;
}

.service-node .node-body {
    transition: filter 0.2s, stroke 0.2s;
}

.service-node:hover .node-body {
    filter: brightness(1.15);
}

.service-node.selected .node-body {
    stroke: var(--success);
    stroke-width: 3;
}

.service-node .node-label {
    font-size: 12px;
    font-weight: 600;
    fill: var(--text-primary);
    pointer-events: none;
}

.service-node .node-type {
    font-size: 10px;
    fill: var(--text-muted);
    pointer-events: none;
}

/* ── Architecture zoom container ─────────────────────────── */

.architecture-zoom-container {
    transition: transform 0.1s;
}

/* ── Architecture Flows (arrows) ─────────────────────────── */

.flow-line {
    fill: none;
    stroke-width: 2;
    stroke-dasharray: 6 4;
    opacity: 0.7;
    animation: flowDash 1s linear infinite;
}

@keyframes flowDash {
    to { stroke-dashoffset: -10; }
}

.flow-arrow {
    fill: currentColor;
    opacity: 0.7;
}

/* ── Service type colors (used via JS) ──────────────────── */

.service-frontend .node-body { fill: #3b82f6; stroke: #2563eb; }
.service-backend   .node-body { fill: #10b981; stroke: #059669; }
.service-database  .node-body { fill: #f59e0b; stroke: #d97706; }
.service-api       .node-body { fill: #8b5cf6; stroke: #7c3aed; }
.service-cache     .node-body { fill: #ef4444; stroke: #dc2626; }
.service-queue     .node-body { fill: #06b6d4; stroke: #0891b2; }
.service-storage   .node-body { fill: #84cc16; stroke: #65a30d; }
.service-external  .node-body { fill: #6b7280; stroke: #4b5563; }
.service-default   .node-body { fill: #1e2a38; stroke: var(--border); }

/* ── Architecture Sidebar (Vertical Menu) ────────────────── */

.arch-menu-vertical {
    width: 64px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0;
    gap: 12px;
}

.arch-menu-item {
    width: 44px;
    height: 44px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    padding: 4px;
}

.arch-menu-item i {
    font-size: 18px;
}

.arch-menu-item span {
    font-size: 9px;
    margin-top: 2px;
    text-transform: uppercase;
    font-weight: 600;
}

.arch-menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.arch-menu-item.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.arch-menu-divider {
    width: 32px;
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}

#arch-services-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    width: 100%;
    align-items: center;
}

/* ── Architecture Content Transition ──────────────────────── */

.arch-content-container {
    flex: 1;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.arch-tab-pane {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 24px;
    background: var(--bg-primary);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    overflow-y: auto;
}

.arch-tab-pane.active {
    transform: translateX(0);
    z-index: 10;
}

.arch-tab-pane h3 {
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    border-left: 4px solid var(--primary);
    padding-left: 12px;
}

.mermaid {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
}

.credentials-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

/* ── Service Pane Sub-Tabs ────────────────────────────────── */

.arch-subtabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border);
    margin: 15px 0;
    padding-bottom: 0;
}

.arch-subtab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    padding: 8px 12px;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.arch-subtab-btn:hover {
    color: var(--text-primary);
}

.arch-subtab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.arch-subtab-content {
    display: none;
    animation: archFadeIn 0.3s ease;
}

.arch-subtab-content.active {
    display: block;
}

@keyframes archFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Selected architecture node highlight ─────────────────── */

.iso-box.selected .main-poly {
    stroke: #fff;
    stroke-width: 2.5;
    filter: url(#glow-arch);
}
