/* TAKA Link AI Agent Learning Platform - CSS Diagram Engine Stylesheet */

/* ==========================================
   Base Diagram Engine Container & Controls
   ========================================== */

.diagram-engine-wrapper,
.diagram-engine-container {
    background-color: var(--bg-primary, #0f172a);
    border: 1px solid var(--border-color, #334155);
    border-radius: var(--radius-md, 10px);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-card, 0 4px 6px -1px rgba(0, 0, 0, 0.3));
}

.diagram-header-bar,
.diagram-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color, #334155);
    padding-bottom: 0.5rem;
}

.diagram-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent-indigo-light, #60a5fa);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.diagram-controls-group,
.diagram-controls,
.diagram-controls-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.diagram-controls .btn-diagram,
.btn-diagram-ctrl {
    background-color: var(--bg-card, #1e293b);
    color: var(--text-secondary, #94a3b8);
    border: 1px solid var(--border-color, #334155);
    padding: 0.35rem 0.65rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.diagram-controls .btn-diagram:hover,
.btn-diagram-ctrl:hover {
    color: #ffffff;
    border-color: var(--accent-indigo-primary, #3b82f6);
    background-color: rgba(59, 130, 246, 0.2);
}

.diagram-controls .btn-diagram.active,
.btn-diagram-ctrl.active {
    background-color: var(--accent-indigo-primary, #3b82f6);
    color: #ffffff;
    border-color: var(--accent-indigo-primary, #3b82f6);
}

.diagram-speed-select {
    background-color: var(--bg-card, #1e293b);
    color: var(--text-primary, #f8fafc);
    border: 1px solid var(--border-color, #334155);
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    outline: none;
    cursor: pointer;
}

.diagram-speed-select:focus {
    border-color: var(--accent-indigo-primary, #3b82f6);
}

.diagram-canvas {
    position: relative;
    min-height: 220px;
    background-color: var(--bg-secondary, #020617);
    border: 1px solid var(--border-color, #334155);
    border-radius: 8px;
    padding: 1.25rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 1rem;
}

.diagram-step-indicator {
    font-size: 0.78rem;
    font-family: var(--font-mono, monospace);
    color: var(--text-muted, #64748b);
    text-align: right;
    margin-top: 0.25rem;
}

/* Common Node & SVG Styles */
.diagram-node {
    background-color: var(--bg-panel, #1e293b);
    border: 1px solid var(--accent-indigo-primary, #3b82f6);
    color: var(--text-primary, #f8fafc);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    z-index: 2;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.diagram-node.active,
.funnel-node.active,
.ch01-stage-node.active,
.ch03-req-card.active,
.ch05-checklist-item.active {
    box-shadow: 0 0 18px rgba(59, 130, 246, 0.8);
    border-color: var(--accent-indigo-light, #60a5fa);
    transform: scale(1.04);
}

.diagram-node.completed {
    border-color: var(--status-success, #10b981);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
    color: #34d399;
}

/* ==========================================
   ch-01: 最速MVP構築 (Funnel Flow Animation)
   ========================================== */

.ch01-funnel-container,
.funnel-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    position: relative;
    gap: 0.75rem;
}

.ch01-stage-node,
.funnel-node {
    flex: 1;
    max-width: 140px;
    padding: 0.75rem;
    background-color: var(--bg-panel, #1e293b);
    border: 1px solid var(--border-color, #334155);
    border-radius: 8px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-primary, #f8fafc);
    transition: all 0.3s ease;
}

.funnel-arrow {
    width: 40px;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    position: relative;
    flex-shrink: 0;
}

.funnel-arrow::after {
    content: '';
    position: absolute;
    right: -4px;
    top: -4px;
    border-width: 6px 0 6px 8px;
    border-style: solid;
    border-color: transparent transparent transparent #60a5fa;
}

@keyframes dash-flow {
    0% { stroke-dashoffset: 24; }
    100% { stroke-dashoffset: 0; }
}

.animate-dash-flow {
    stroke: var(--accent-indigo-primary, #3b82f6);
    stroke-dasharray: 6 6;
    stroke-width: 2.5;
    animation: dash-flow 1.2s linear infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(59, 130, 246, 0.3);
        border-color: var(--accent-indigo-primary, #3b82f6);
    }
    50% {
        box-shadow: 0 0 22px rgba(59, 130, 246, 0.9);
        border-color: var(--accent-indigo-light, #60a5fa);
        transform: scale(1.03);
    }
}

.animate-pulse-glow,
.funnel-node {
    animation: pulse-glow 2s infinite ease-in-out;
}

/* ==========================================
   ch-02: AIエージェント業務自動化 (Audio-to-Text Pipeline)
   ========================================== */

.ch02-audio-container,
.audio-pipeline-container {
    display: flex;
    align-items: center;
    justify-content: space-around;
    width: 100%;
    gap: 1rem;
}

.wave-node,
.ch02-wave-container {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 50px;
    padding: 0 0.5rem;
}

.wave-bar,
.ch02-wave-bar {
    width: 5px;
    height: 16px;
    background-color: var(--accent-indigo-primary, #3b82f6);
    border-radius: 3px;
    transition: height 0.2s ease;
}

@keyframes wave-bounce {
    0%, 100% {
        height: 12px;
        opacity: 0.5;
        background-color: var(--accent-indigo-primary, #3b82f6);
    }
    50% {
        height: 44px;
        opacity: 1;
        background-color: var(--accent-indigo-light, #60a5fa);
        box-shadow: 0 0 10px rgba(96, 165, 250, 0.8);
    }
}

.animate-wave-pulse,
.wave-bar,
.ch02-wave-bar {
    animation: wave-bounce 1.2s ease-in-out infinite;
}

.wave-bar:nth-child(1), .ch02-wave-bar:nth-child(1) { animation-delay: 0.0s; }
.wave-bar:nth-child(2), .ch02-wave-bar:nth-child(2) { animation-delay: 0.2s; }
.wave-bar:nth-child(3), .ch02-wave-bar:nth-child(3) { animation-delay: 0.4s; }
.wave-bar:nth-child(4), .ch02-wave-bar:nth-child(4) { animation-delay: 0.1s; }
.wave-bar:nth-child(5), .ch02-wave-bar:nth-child(5) { animation-delay: 0.3s; }

.text-output-card {
    background: var(--bg-panel, #1e293b);
    border: 1px solid var(--status-success, #10b981);
    border-radius: 8px;
    padding: 0.6rem 1rem;
    color: #34d399;
    font-family: var(--font-mono, monospace);
    font-size: 0.85rem;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

/* ==========================================
   ch-03: プロンプトフレームワーク (Typewriter Effect)
   ========================================== */

.ch03-prompt-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    font-family: var(--font-mono, monospace);
}

.ch03-terminal-box {
    background-color: var(--bg-panel, #1e293b);
    border: 1px solid var(--border-color, #334155);
    border-radius: 8px;
    padding: 0.8rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ch03-req-card {
    background-color: var(--bg-panel, #1e293b);
    border: 1px solid var(--border-color, #334155);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    color: var(--text-primary, #f8fafc);
}

.typewriter-text,
.animate-typewriter {
    font-family: var(--font-mono, monospace);
    font-size: 0.9rem;
    color: var(--accent-indigo-light, #60a5fa);
    border-right: 2px solid var(--accent-indigo-primary, #3b82f6);
    white-space: nowrap;
    overflow: hidden;
    display: inline-block;
    animation: typing 3.5s steps(40, end) infinite, blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { max-width: 0; }
    to { max-width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--accent-indigo-primary, #3b82f6); }
}

/* ==========================================
   ch-04: マルチモーダル・ワークフロー (Light Particle Stream)
   ========================================== */

.ch04-multimodal-container,
.particle-canvas {
    position: relative;
    width: 100%;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
}

.api-endpoint {
    background: var(--bg-panel, #1e293b);
    border: 1px solid #6366f1;
    border-radius: 50%;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a5b4fc;
    font-weight: 700;
    font-size: 0.8rem;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
    z-index: 2;
}

.ch04-particle,
.particle-glow {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: var(--accent-indigo-light, #60a5fa);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-indigo-primary, #3b82f6), 0 0 18px #6366f1;
    z-index: 1;
}

@keyframes particle-travel {
    0% {
        transform: translateX(0) scale(0.6);
        opacity: 0;
    }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% {
        transform: translateX(200px) scale(1.2);
        opacity: 0;
    }
}

.animate-particle-stream,
.particle-glow {
    animation: particle-travel 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.ch04-particle:nth-child(1) { animation-delay: 0s; }
.ch04-particle:nth-child(2) { animation-delay: 0.6s; }
.ch04-particle:nth-child(3) { animation-delay: 1.2s; }

/* ==========================================
   ch-05: AI著作権・コンプライアンス (Compliance Shield)
   ========================================== */

.ch05-compliance-container,
.shield-container {
    display: flex;
    align-items: center;
    justify-content: space-around;
    width: 100%;
    gap: 1rem;
}

.shield-badge,
.ch05-shield-svg {
    background: rgba(16, 185, 129, 0.15);
    border: 2px solid var(--status-success, #10b981);
    border-radius: 50px;
    padding: 0.5rem 1.5rem;
    color: #34d399;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
    animation: shield-glow 2.5s infinite ease-in-out;
}

@keyframes shield-glow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
        transform: scale(0.98);
    }
    50% {
        box-shadow: 0 0 25px rgba(16, 185, 129, 0.7);
        transform: scale(1.04);
    }
}

.animate-shield-expand {
    animation: shield-glow 2s ease-out infinite alternate;
}

.compliance-checklist,
.ch05-checklist {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-primary, #f8fafc);
}

.checklist-item,
.ch05-checklist-item {
    background: var(--bg-panel, #1e293b);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    border: 1px solid var(--border-color, #334155);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.3s ease;
}
