/* ワークフローページ専用スタイル */
.workflow-main {
    background: #f8f9fa;
    min-height: 100vh;
    padding-top: 70px;
}

.page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 60px 0;
    margin-bottom: 40px;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.page-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* ワークフロー概要 */
.workflow-toc {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-left: 5px solid #667eea;
}

/* フェーズ概要 */
.phase-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin: 30px 0;
    padding: 20px 0;
}

.phase-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border: 2px solid #f0f0f0;
    transition: all 0.3s ease;
}

.phase-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.phase-header {
    padding: 20px;
    color: white;
    text-align: center;
    font-weight: 600;
}

.phase-header.phase-1 {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.phase-header.phase-2 {
    background: linear-gradient(135deg, #007bff, #6610f2);
}

.phase-header.phase-3 {
    background: linear-gradient(135deg, #dc3545, #e83e8c);
}

.phase-num {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 5px;
    opacity: 0.9;
}

.phase-title {
    font-size: 1.4rem;
    font-weight: 700;
}

.phase-content {
    padding: 20px;
    background: #f8f9fa;
}

.phase-content p {
    margin: 0;
    color: #666;
    line-height: 1.6;
    font-size: 0.95rem;
}

.workflow-toc h3 {
    color: #333;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.workflow-overview {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 20px 0;
}

.overview-step {
    background: #667eea;
    color: white;
    padding: 12px 16px;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    min-width: 120px;
    justify-content: center;
    transition: all 0.3s ease;
}

.overview-step:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.step-num {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

.arrow {
    color: #667eea;
    font-weight: bold;
    font-size: 1.2rem;
}

/* ワークフローノードセクション */
.workflow-nodes {
    display: flex;
    flex-direction: column;
    gap: 40px;
    margin-bottom: 60px;
}

.workflow-node-section {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.workflow-node-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

/* ノードヘッダー */
.node-header {
    padding: 30px;
    color: white;
    display: flex;
    align-items: center;
    gap: 20px;
}

.node-header.start { background: linear-gradient(135deg, #28a745, #20c997); }
.node-header.search { background: linear-gradient(135deg, #007bff, #6610f2); }
.node-header.extract { background: linear-gradient(135deg, #17a2b8, #6f42c1); }
.node-header.gpt { background: linear-gradient(135deg, #20c997, #17a2b8); }
.node-header.gemini { background: linear-gradient(135deg, #ffc107, #fd7e14); }
.node-header.loop { background: linear-gradient(135deg, #fd7e14, #dc3545); }
.node-header.rag { background: linear-gradient(135deg, #6f42c1, #e83e8c); }
.node-header.claude { background: linear-gradient(135deg, #6c757d, #495057); }
.node-header.end { background: linear-gradient(135deg, #dc3545, #e83e8c); }

.node-icon {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

.node-info h2 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.node-info p {
    opacity: 0.9;
    font-size: 1rem;
    margin: 0;
}

/* ノードコンテンツ */
.node-content {
    padding: 40px;
}

.node-content h3 {
    color: #333;
    font-size: 1.3rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.node-content h3 i {
    color: #667eea;
}

/* 設定グリッド */
.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.config-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.config-item:hover {
    background: #f0f2ff;
    transform: translateX(5px);
}

.config-label {
    font-weight: 600;
    color: #333;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.config-type {
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-block;
    margin-bottom: 8px;
}

.config-desc {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* プラグイン情報 */
.plugin-info {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.plugin-name {
    font-weight: 600;
    color: #333;
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.plugin-settings {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.setting-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.setting-label {
    color: #666;
    min-width: 100px;
}

.setting-row code {
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* モデル情報 */
.model-info {
    background: #667eea;
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 20px;
}

.knowledge-info {
    background: #20c997;
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: 600;
    display: inline-block;
}

/* プロンプトセクション */
.prompt-section {
    margin-top: 30px;
}

.prompt-container {
    position: relative;
    background: #2d3748;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 15px;
}

.prompt-container pre {
    margin: 0;
    padding: 25px;
    background: transparent;
    color: #e2e8f0;
    font-size: 0.9rem;
    line-height: 1.6;
    overflow-x: auto;
}

.copy-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

/* 出力変数 */
.node-output {
    margin-top: 30px;
}

.output-var,
.output-vars {
    margin-top: 15px;
}

.output-vars {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.output-var {
    background: #f8f9fa;
    padding: 15px 20px;
    border-radius: 8px;
    border-left: 4px solid #28a745;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.output-var:hover {
    background: #f0fff4;
    transform: translateX(5px);
}

.output-var.important {
    border-left-color: #dc3545;
    background: #fff5f5;
}

.output-var.important:hover {
    background: #ffe6e6;
}

.var-name {
    background: #28a745;
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    font-weight: 600;
    min-width: 140px;
    text-align: center;
}

.output-var.important .var-name {
    background: #dc3545;
}

.var-desc {
    color: #666;
    line-height: 1.4;
}

/* ループ設定 */
.loop-conditions {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #fd7e14;
    flex-wrap: wrap;
    justify-content: center;
}

.condition-item {
    background: white;
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.condition-item i {
    color: #28a745;
}

.condition-item code {
    background: #fd7e14;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.condition-operator {
    background: #667eea;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

/* ループ処理 */
.loop-process {
    margin-top: 25px;
}

.process-steps {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

.process-step {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    border-left: 4px solid #fd7e14;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.process-step:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.step-number {
    background: #fd7e14;
    color: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

/* 最終出力 */
.output-final {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 15px;
}

.final-output-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #dc3545;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
}

.final-output-item:hover {
    background: #fff5f5;
    transform: translateX(5px);
}

.final-output-item i {
    font-size: 2rem;
    color: #dc3545;
    min-width: 40px;
}

.final-output-item strong {
    display: block;
    color: #333;
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.final-output-item code {
    background: #dc3545;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.final-output-item span {
    color: #666;
    font-size: 0.9rem;
}

/* 実装のポイント */
.implementation-tips {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-left: 5px solid #ffc107;
}

.implementation-tips h2 {
    color: #333;
    font-size: 2rem;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.implementation-tips h2 i {
    color: #ffc107;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.tip-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.tip-card:hover {
    border-color: #ffc107;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.tip-card i {
    font-size: 2.5rem;
    color: #ffc107;
    margin-bottom: 15px;
}

.tip-card h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.tip-card p {
    color: #666;
    line-height: 1.5;
    margin: 0;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .page-header h1 {
        font-size: 2rem;
        flex-direction: column;
        gap: 10px;
    }

    .workflow-overview {
        flex-direction: column;
        align-items: center;
    }

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

    .node-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .node-content {
        padding: 25px;
    }

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

    .loop-conditions {
        flex-direction: column;
        align-items: center;
    }

    .condition-operator {
        transform: rotate(90deg);
    }

    .copy-btn {
        position: static;
        margin-top: 15px;
        width: 100%;
    }

    .overview-step {
        min-width: 200px;
    }

    .setting-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .final-output-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

/* プリントスタイル */
@media print {
    .navbar,
    .footer,
    .copy-btn {
        display: none;
    }

    .workflow-main {
        padding-top: 0;
    }

    .workflow-node-section {
        break-inside: avoid;
        margin-bottom: 20px;
    }

    .prompt-container {
        background: #f8f9fa !important;
        border: 1px solid #dee2e6;
    }

    .prompt-container pre {
        color: #333 !important;
    }
}