/**
 * TechHub Theme - n8n Workflow & JSON Viewer Styles
 * Thiết kế khối xem trước mã luồng tự động hóa n8n và xuất file cấu hình .json.
 */

.th-workflow-card {
    background: var(--wp--preset--color--card-bg);
    border: 1px solid var(--wp--preset--color--border-light);
    border-radius: var(--wp--preset--spacing--md);
    overflow: hidden;
    margin: var(--wp--preset--spacing--lg) 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.th-workflow-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background: var(--wp--preset--color--background-alt);
    border-bottom: 1px solid var(--wp--preset--color--border-light);
    flex-wrap: wrap;
    gap: 1rem;
}

.th-workflow-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.th-workflow-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: linear-align;
    background: #ff6d5a;
    color: #ffffff;
    font-weight: 800;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(255, 109, 90, 0.3);
}

.th-workflow-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.th-workflow-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.15rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.2s, box-shadow 0.2s;
}

.th-workflow-btn-copy {
    background: var(--wp--preset--color--blue-electric);
    color: #ffffff;
}

.th-workflow-btn-copy:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.th-workflow-btn-download {
    background: var(--wp--preset--color--background-alt);
    color: var(--wp--preset--color--text-main);
    border: 1px solid var(--wp--preset--color--border-light);
}

.th-workflow-btn-download:hover {
    background: var(--wp--preset--color--card-bg);
    border-color: var(--wp--preset--color--text-muted);
}

/* Các Nodes trong Workflow */
.th-workflow-nodes-preview {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.02);
    border-bottom: 1px solid var(--wp--preset--color--border-light);
    overflow-x: auto;
}

.th-workflow-node-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 9999px;
    background: var(--wp--preset--color--background-alt);
    border: 1px solid var(--wp--preset--color--border-light);
    white-space: nowrap;
}

/* Khung Code JSON */
.th-workflow-code-body {
    position: relative;
    max-height: 380px;
    overflow-y: auto;
    background: #0d1117;
    padding: 1.25rem 1.5rem;
    margin: 0;
}

.th-workflow-json-code {
    font-family: var(--wp--preset--font-family--code);
    font-size: 0.85rem;
    line-height: 1.6;
    color: #c9d1d9;
    white-space: pre;
    margin: 0;
}

/* Hướng dẫn 3 bước nhập vào n8n */
.th-workflow-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    padding: 1.5rem;
    background: var(--wp--preset--color--background-alt);
    border-top: 1px solid var(--wp--preset--color--border-light);
}

.th-workflow-step-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.th-workflow-step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--wp--preset--color--blue-electric);
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
}

.th-workflow-step-text {
    font-size: 0.85rem;
    color: var(--wp--preset--color--text-muted);
    line-height: 1.45;
}

.th-workflow-step-text strong {
    color: var(--wp--preset--color--text-main);
    display: block;
    margin-bottom: 0.15rem;
}
